Terrain Overlays for difficult terrain, cover, etc.
Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice
Re: Terrain Overlays for difficult terrain, cover, etc.
and I've found a better (faster !!) solution ! It requires one line of code to find the difficult terrain tokens ONLY where the token has walked!
Attached a self explanatory campaing file, see the campaign panel for the macro.
Cheerz!
Attached a self explanatory campaing file, see the campaign panel for the macro.
Cheerz!
- Attachments
-
- diff. terrain.cmpgn
- (225.28 KiB) Downloaded 152 times
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: Terrain Overlays for difficult terrain, cover, etc.
Why am I not surprised?
What a clever trick, nice!
What a clever trick, nice!
Re: Terrain Overlays for difficult terrain, cover, etc.
thnx!CoveredInFish wrote:Why am I not surprised?
What a clever trick, nice!
What's really funny, and this I just realise, is that you can use the lastPath to define an area e.g. a difficult terrain area, store that and use json.difference with the lastPath of a player token to filter out the coords of that have traversed this area. But I think my zero-zero trick is easier to set up and maintain.
Edit: but it *does* open up a whole WORLD of possibilities to create eventAreas... hmm who knows.
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: Terrain Overlays for difficult terrain, cover, etc.
by the way, I noticed AMs remark on getTokens being slow and I did some tests, while using DpC=0 isn't really slow, it isn't really fast either, for a long walk over say 50 tokens its takes about a second to burb them up. (it does not matter whether you walk over the tokens or not, if you have a lot of tokens on the object layer and you drag a token over many cells: slow)
So.... trick to: define the area with the use of getLastPath, store it on a lib token and retrieve when needed. Before doing all that I defined a large area to see how wel it works. It works VERY well!
OLD (see below for live version): http://dl.dropbox.com/u/9052014/Difficu ... area.cmpgn
What you do is:
- trace with a token over the entire red area (using space bar to set waypoints)
- get the last path of the token
- store it
- then use json.intersection with the lastpath of a player token with this area and all relevant coords pop-up in no time.
This way you can define several areas (overlapping as well!!) and do the intersection trick per area. As you get ALL the coords of ALL cells traversed you can simply do a count of number of items in the array to know how many 'special' area cells have been traversed. In short: you don't need the gettokens anyore. This way its going a similar way as with the Bag of Tricks, save the fact that you have to reinitialize each time you move overlay tokens around.
This is FAST! BUT its more hassle to set up as you need to 'draw' the entire area with your moving token
Note: you can even create a check macro that places a token on each of the coords, to see if you have the whole area covered... hmm come to think of it... you could scan the area for overlay tokens, store there coords as an area and use that!! He ho best of both worlds!
Edit: live version: http://dl.dropbox.com/u/9052014/Difficu ... area.cmpgn
Edit2: out of curiosity, if the shaded area is difficult terrain and a token walks from A to B along the red path (see pic) what exactly is its total movecount and why?
So.... trick to: define the area with the use of getLastPath, store it on a lib token and retrieve when needed. Before doing all that I defined a large area to see how wel it works. It works VERY well!
OLD (see below for live version): http://dl.dropbox.com/u/9052014/Difficu ... area.cmpgn
What you do is:
- trace with a token over the entire red area (using space bar to set waypoints)
- get the last path of the token
- store it
- then use json.intersection with the lastpath of a player token with this area and all relevant coords pop-up in no time.
This way you can define several areas (overlapping as well!!) and do the intersection trick per area. As you get ALL the coords of ALL cells traversed you can simply do a count of number of items in the array to know how many 'special' area cells have been traversed. In short: you don't need the gettokens anyore. This way its going a similar way as with the Bag of Tricks, save the fact that you have to reinitialize each time you move overlay tokens around.
This is FAST! BUT its more hassle to set up as you need to 'draw' the entire area with your moving token
Note: you can even create a check macro that places a token on each of the coords, to see if you have the whole area covered... hmm come to think of it... you could scan the area for overlay tokens, store there coords as an area and use that!! He ho best of both worlds!
Edit: live version: http://dl.dropbox.com/u/9052014/Difficu ... area.cmpgn
Edit2: out of curiosity, if the shaded area is difficult terrain and a token walks from A to B along the red path (see pic) what exactly is its total movecount and why?
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: Terrain Overlays for difficult terrain, cover, etc.
For Pathfinder, for diagonal movement, you would need the one_two_one measurement.wolph42 wrote:out of curiosity, if the shaded area is difficult terrain and a token walks from A to B along the red path (see pic) what exactly is its total movecount and why?
For Pathfinder difficult terrain...PRD wrote:Diagonals: When measuring distance, the first diagonal counts as 1 square, the second counts as 2 squares, the third counts as 1, the fourth as 2, and so on.
For your diagram, the count looks like 5 squares to me:PRD wrote:Each square of difficult terrain counts as 2 squares of movement. Each diagonal move into a difficult terrain square counts as 3 squares.
- First movement (first diagonal): +1
- Second movement into difficult terrain: +2
- Third movement (second diagonal): +2
(hope that helped)
My form-fillable PDF Character Sheet for Pathfinder can be found here.
- CoveredInFish
- Demigod
- Posts: 3104
- Joined: Mon Jun 29, 2009 10:37 am
- Location: Germany
- Contact:
Re: Terrain Overlays for difficult terrain, cover, etc.
Okay, me using 1-2-1 and house ruling that each cell of diff. terrain gives +1 comes to the same total.
But then its actually the same rules ...
EDIT: this new method really looks fast. And scanning the map for tokens with a given state (eg) is easy enough for setup.OR summoning the tokens to show the diff terrain. I like to mark the difficult terrain so players can see. *sigh* probably I have to change it ... again
But then its actually the same rules ...
EDIT: this new method really looks fast. And scanning the map for tokens with a given state (eg) is easy enough for setup.OR summoning the tokens to show the diff terrain. I like to mark the difficult terrain so players can see. *sigh* probably I have to change it ... again
Re: Terrain Overlays for difficult terrain, cover, etc.
Did you check out my live version two posts up ?
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: Terrain Overlays for difficult terrain, cover, etc.
Yeah, you already did all the hard work
Re: Terrain Overlays for difficult terrain, cover, etc.
Is there actually a function dat shows the move distance a token just travelled? Like Getlastpath but then just a number showing the move count?
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: Terrain Overlays for difficult terrain, cover, etc.
Oh yeah, we totally should use that. It'll consider the move metrics.
Wiki: getMoveCount()
(I've written this Guide to onTokenMove when it was all new ... its my goto page when I wanna know what functions exist in that context)
Wiki: getMoveCount()
(I've written this Guide to onTokenMove when it was all new ... its my goto page when I wanna know what functions exist in that context)
Re: Terrain Overlays for difficult terrain, cover, etc.
check! well that makes it fairly easy then. use that function and add the number of entries in the json.intersection result!
Edit: updated live version with total move counter. Works pretty well!
Im wondering though... if you make one step onto diff. terrain its 1+1, so how much is it if you move one step back? Currently the example campaign will again calc. 1+1, so I think you should remove the first entry from getLastPath(0). Am I right in that assumption??
To elaborate a bit say you have square 1,2 and 3 where 2 is difficult terrain. If you move from 1 to 3 it totals to 3 steps. If you however first move to 2, wait and then move to 3 then all of a sudden it calculates 4 steps. To prevent this from happening you need to remove the first entry from lastpath before you calculate the intersection. (updated in life campaign file.)
edit2: new update in live version
Edit: updated live version with total move counter. Works pretty well!
Im wondering though... if you make one step onto diff. terrain its 1+1, so how much is it if you move one step back? Currently the example campaign will again calc. 1+1, so I think you should remove the first entry from getLastPath(0). Am I right in that assumption??
To elaborate a bit say you have square 1,2 and 3 where 2 is difficult terrain. If you move from 1 to 3 it totals to 3 steps. If you however first move to 2, wait and then move to 3 then all of a sudden it calculates 4 steps. To prevent this from happening you need to remove the first entry from lastpath before you calculate the intersection. (updated in life campaign file.)
edit2: new update in live version
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: Terrain Overlays for difficult terrain, cover, etc.
That's what I referred to for my onTokenMove macros, and it was excellently useful. Never did get to thanking you about that one, so thanks!CoveredInFish wrote:(I've written this Guide to onTokenMove when it was all new ... its my goto page when I wanna know what functions exist in that context)
- CoveredInFish
- Demigod
- Posts: 3104
- Joined: Mon Jun 29, 2009 10:37 am
- Location: Germany
- Contact:
Re: Terrain Overlays for difficult terrain, cover, etc.
wolph42 wrote:Im wondering though... if you make one step onto diff. terrain its 1+1, so how much is it if you move one step back? Currently the example campaign will again calc. 1+1, so I think you should remove the first entry from getLastPath(0). Am I right in that assumption??
Yeah, you're right. I already did that, but hasnt communicated it. If you check the code I did you will see json.remove(getLastPath(0),0) - I removed the first cell because when you leave it you'll already have paid the diffTerrain-penalty.
@BW
Great, I'm glad its useful
Re: Terrain Overlays for difficult terrain, cover, etc.
@CIF: If you like you can recheck my live version, I'm nearing the point that it can be merged with the bag of tricks.
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: Terrain Overlays for difficult terrain, cover, etc.
Sure thing, but it wont happen today too much work to do.
EDIT: okay. I got a look. I think I already saw that It does not yet remove the cell the token leaves. I dont get why there are huge hard-coded coordinate lists in all onTokenMove-macros. Oh, and its really fast
EDIT: okay. I got a look. I think I already saw that It does not yet remove the cell the token leaves. I dont get why there are huge hard-coded coordinate lists in all onTokenMove-macros. Oh, and its really fast