Wolph42's 'Drop-in' Difficult Terrain v.1.0

These are tools and utilities that make it easier to run games. This includes Lib: macro tokens dropped into MapTool to manage the game, a conversion file for CharacterTool to allow use in MapTool, or just about anything else you can think of -- except graphics with macros and anything specific to a particular campaign framework. Those are already covered by the Tilesets subforum and the Links and External Resources forum.

Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Wolph42's 'Drop-in' Difficult Terrain v.1.0

Post by wolph42 »

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:
Wolph42 - Difficult Terrain.cmpgn
(279.76 KiB) Downloaded 190 times

User avatar
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

Post by Bone White »

Just to add to the discussion about "terrain" have you seen how I handle terrain in my framework?

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0

Post by wolph42 »

Bone White wrote:Just to add to the discussion about "terrain" have you seen how I handle terrain in my framework?
No, how *do* you handle terrain in your framework?

User avatar
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

Post by Bone White »

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.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0

Post by wolph42 »

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.

User avatar
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

Post by Bone White »

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?

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0

Post by wolph42 »

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).

User avatar
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

Post by Bone White »

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 :twisted: Thanks for the info, and congratulations on the efficient, working implementation.

Lee
Dragon
Posts: 958
Joined: Wed Oct 19, 2011 2:07 am

Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0

Post by Lee »

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 :)

User avatar
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

Post by CoveredInFish »

I can't reproduce. What did you do to trigger the error?


User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0

Post by wolph42 »

it seems it was in use lastPath method in the define area method. I noticed a typo 'astPathName'. Its been corrected, thanks!

User avatar
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

Post by CoveredInFish »

Do you have an ETA of the next BoT version including this?

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0

Post by wolph42 »

CoveredInFish wrote:Do you have an ETA of the next BoT version including this?
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.

User avatar
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

Post by CoveredInFish »

Thats good to hear. Then I delay my revision of my current gaming file :)

Post Reply

Return to “Drop-In Macro Resources”