Wolph42's 'Drop-in' Difficult Terrain v.1.0
Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice
Wolph42's 'Drop-in' Difficult Terrain v.1.0
From a discussion with CIF I've created a drop-in that can be used to add 'difficult terrain' to your maps and have a counter when a token moves over the pre defined area. The download is a full campaign file where you can check it out.
To use it as a drop in you need to:
- extract (save) the lib:OntokenMove token from the campaign file and drop it into your own campaign.
- create a token on each map where you are going to define an 'difficult terrain' area. This token must be medium sized and have the name: 'AreaToken'.
To actually use it in your campaign I would suggest to first check out the attached campaign file to get a feeling of how it works. When you've done that, you need to rewrite the onTokenMove macro that is on the lib:ontokenmove token, so it fits into your campaign. All the functions are their, but as each game does things differently I can only give the building tools, not the building itself.
One thing might not be entirely clear and that is the 'Assign Areas' macro. For this drop-in its actually redundant as there is only one event: 'limit movement'. However you still need to use it:
- Create an area (have a look at the Define Area tooltips for more info). Either create an area from the lastpath of a token or from a group of token on a certain layer with a certain state
- Define Area (give it a name)
- Assign Area (link it to 'Limit Movement')
Now it will be available in the onTokenMove macro where you can do with it what you like!!
Feel free to post any questions here.
Note that this drop-in (EDIT IS merged with the Bag of Tricks an if needed, further developed from there on. If you already use the bag of tricks I would suggest to wait for the next version where this drop-in is merged with.
I only post this for people who want to make use of this function and nothing else.
Download:
To use it as a drop in you need to:
- extract (save) the lib:OntokenMove token from the campaign file and drop it into your own campaign.
- create a token on each map where you are going to define an 'difficult terrain' area. This token must be medium sized and have the name: 'AreaToken'.
To actually use it in your campaign I would suggest to first check out the attached campaign file to get a feeling of how it works. When you've done that, you need to rewrite the onTokenMove macro that is on the lib:ontokenmove token, so it fits into your campaign. All the functions are their, but as each game does things differently I can only give the building tools, not the building itself.
One thing might not be entirely clear and that is the 'Assign Areas' macro. For this drop-in its actually redundant as there is only one event: 'limit movement'. However you still need to use it:
- Create an area (have a look at the Define Area tooltips for more info). Either create an area from the lastpath of a token or from a group of token on a certain layer with a certain state
- Define Area (give it a name)
- Assign Area (link it to 'Limit Movement')
Now it will be available in the onTokenMove macro where you can do with it what you like!!
Feel free to post any questions here.
Note that this drop-in (EDIT IS merged with the Bag of Tricks an if needed, further developed from there on. If you already use the bag of tricks I would suggest to wait for the next version where this drop-in is merged with.
I only post this for people who want to make use of this function and nothing else.
Download:
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
- Bone White
- Great Wyrm
- Posts: 1124
- Joined: Tue Aug 23, 2011 11:41 am
- Location: Cornwall, UK
Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
Just to add to the discussion about "terrain" have you seen how I handle terrain in my framework?
Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
No, how *do* you handle terrain in your framework?Bone White wrote:Just to add to the discussion about "terrain" have you seen how I handle terrain in my framework?
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
- Bone White
- Great Wyrm
- Posts: 1124
- Joined: Tue Aug 23, 2011 11:41 am
- Location: Cornwall, UK
Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
Sorry for the closed question, I forget which was the last version of my framework you saw. The code I use is below:
[code=php][h: areaOffsets = '[ {x:0, y:0}]']
[h: getTokensArea = json.set("", "offsets", areaOffsets, "token", selected)]
[h: getTokensConditions = json.set("", "area",getTokensArea,"layer","Background")]
[h, token(selected): backgroundTokenIDs = getTokens(",", getTokensConditions)]
[h: coverModifier = 0]
[h, foreach(backgroundTokenID,backgroundTokenIDs), code :
{
[h: backgroundTokenName = getName(backgroundTokenID)]
[h, if(backgroundTokenName == "Light Cover"): coverModifier = max(coverModifier, 1)]
[h, if(backgroundTokenName == "Medium Cover"): coverModifier = max(coverModifier, 2)]
[h, if(backgroundTokenName == "Heavy Cover"): coverModifier = max(coverModifier, 3)]
}
] [/code]
I drop some translucent coloured tokens on my background, and make sure the duplicate token number is in the GM name. Now I know this isn't ideal, I'm pretty sure if there's more than one background layer token in a cell then this would break, but I was wondering if this is something you've considered or are using.
[code=php][h: areaOffsets = '[ {x:0, y:0}]']
[h: getTokensArea = json.set("", "offsets", areaOffsets, "token", selected)]
[h: getTokensConditions = json.set("", "area",getTokensArea,"layer","Background")]
[h, token(selected): backgroundTokenIDs = getTokens(",", getTokensConditions)]
[h: coverModifier = 0]
[h, foreach(backgroundTokenID,backgroundTokenIDs), code :
{
[h: backgroundTokenName = getName(backgroundTokenID)]
[h, if(backgroundTokenName == "Light Cover"): coverModifier = max(coverModifier, 1)]
[h, if(backgroundTokenName == "Medium Cover"): coverModifier = max(coverModifier, 2)]
[h, if(backgroundTokenName == "Heavy Cover"): coverModifier = max(coverModifier, 3)]
}
] [/code]
I drop some translucent coloured tokens on my background, and make sure the duplicate token number is in the GM name. Now I know this isn't ideal, I'm pretty sure if there's more than one background layer token in a cell then this would break, but I was wondering if this is something you've considered or are using.
Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
Yup Im Aware of this method. We started out with this method but it turns out that the area method as in the drop in is a lot faster.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
- Bone White
- Great Wyrm
- Posts: 1124
- Joined: Tue Aug 23, 2011 11:41 am
- Location: Cornwall, UK
Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
Well after trying out your drop in it seems quite functional, however I have three questions: can I toggle off the difficulty area visibility, can I draw non-square areas, and why would my client (installed on a new pc) make the non-token part of the map completely black when moving/zooming sometimes?
Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
Bone White wrote:Well after trying out your drop in it seems quite functional, however I have three questions: can I toggle off the difficulty area visibility, can I draw non-square areas, and why would my client (installed on a new pc) make the non-token part of the map completely black when moving/zooming sometimes?
1. yes, well, that is, what you see in the drop in are just a couple of drawings marking the area, you can erase them with the erase tool, but the area remains defined. The areas are defined with the use of either lastpath of a token or putting tokens on the map and scanning their coordinates (which defines the area). Its in essence the same method as yours except that I store the coordinates of the tokens in a json object and then delete the tokens. Working with just the coordinates in a json is way faster then needing to use getTokens() everytime which is notoriously slow.
2. yes, the show area macro is a toggle, it drops tokens on the predefined coordinates that mark the area and running it again it removes them. You can use ANY token (e.g a semi transparent image) for that as long as its named AreaToken (and its size is medium)
3. yes, save the fact that an areas resolution is the size of the cells, but if you create e.g. a chessboard of coords then that is the area. Basically any area you can 'draw' by dropping tokens on a map is the area you can predefine
4. that sounds like a graphics driver issue, search the forum for more info, though the usual answer is: upgrade your driver software (or in some rare occasion: downgrade).
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
- Bone White
- Great Wyrm
- Posts: 1124
- Joined: Tue Aug 23, 2011 11:41 am
- Location: Cornwall, UK
Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
Ah now I understand how it works, clever idea. I'll probably ninja half the code to improve mine when I want to improve performance Thanks for the info, and congratulations on the efficient, working implementation.
Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
A quick point-out, there's an undefined variable error being thrown for lastPathName so I couldn't evaluate if it's the same approach as I use. I was too lazy to debug it myself hehe.
I'll just wait on the BoT update so I can see your implementation of the concept before making a comparison with my own
I'll just wait on the BoT update so I can see your implementation of the concept before making a comparison with my own
My stuff for the community:
Donate to the Mote Project
The Mote Project's G+ community
Mote on Facebook
Fully Customizable Calendar Drop-in
Donate to the Mote Project
The Mote Project's G+ community
Mote on Facebook
Fully Customizable Calendar Drop-in
- CoveredInFish
- Demigod
- Posts: 3104
- Joined: Mon Jun 29, 2009 10:37 am
- Location: Germany
- Contact:
Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
I can't reproduce. What did you do to trigger the error?
Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
@lee: it would be helpfully if you can tell me when/where this happens.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
it seems it was in use lastPath method in the define area method. I noticed a typo 'astPathName'. Its been corrected, thanks!
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
- CoveredInFish
- Demigod
- Posts: 3104
- Joined: Mon Jun 29, 2009 10:37 am
- Location: Germany
- Contact:
Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
Do you have an ETA of the next BoT version including this?
Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
erm... soon. I think I have everything in place, I had one tough pickle to pick and thats done, so now I only need to copy paste and change the lib calls. So as soon as I've got time ill do that.CoveredInFish wrote:Do you have an ETA of the next BoT version including this?
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
- CoveredInFish
- Demigod
- Posts: 3104
- Joined: Mon Jun 29, 2009 10:37 am
- Location: Germany
- Contact:
Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
Thats good to hear. Then I delay my revision of my current gaming file