RPTools.net

Discussion and Support

Skip to content

It is currently Fri Feb 23, 2018 11:48 am 






Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9483
Location: Netherlands
 Post subject: Wolph42's 'Drop-in' Difficult Terrain v.1.0
PostPosted: Fri Aug 17, 2012 8:05 am 
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:
Attachment:
Wolph42 - Difficult Terrain.cmpgn [279.76 KiB]
Downloaded 117 times

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
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


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Tue Aug 23, 2011 10:41 am
Posts: 1134
Location: Cornwall, UK
 Post subject: Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
PostPosted: Fri Aug 17, 2012 10:40 am 
Just to add to the discussion about "terrain" have you seen how I handle terrain in my framework?

_________________
How to get around the two code nest limit in MapTool (and MOTE)


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9483
Location: Netherlands
 Post subject: Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
PostPosted: Fri Aug 17, 2012 1:31 pm 
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?

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
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


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Tue Aug 23, 2011 10:41 am
Posts: 1134
Location: Cornwall, UK
 Post subject: Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
PostPosted: Fri Aug 17, 2012 3:11 pm 
Sorry for the closed question, I forget which was the last version of my framework you saw. The code I use is below:

Code:
[hareaOffsets '[ {x:0, y:0}]']
    [
hgetTokensArea json.set("""offsets"areaOffsets"token"selected)]
    [
hgetTokensConditions json.set("""area",getTokensArea,"layer","Background")]
    [
htoken(selected): backgroundTokenIDs getTokens(","getTokensConditions)]
    [
hcoverModifier 0]
    [
h, foreach(backgroundTokenID,backgroundTokenIDs), code :
        {
        [
hbackgroundTokenName getName(backgroundTokenID)]
        [
h, if(backgroundTokenName == "Light Cover"): coverModifier max(coverModifier1)]
        [
h, if(backgroundTokenName == "Medium Cover"): coverModifier max(coverModifier2)]
        [
h, if(backgroundTokenName == "Heavy Cover"): coverModifier max(coverModifier3)]
        }
    ] 


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.

_________________
How to get around the two code nest limit in MapTool (and MOTE)


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9483
Location: Netherlands
 Post subject: Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
PostPosted: Fri Aug 17, 2012 3:52 pm 
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

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
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


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Tue Aug 23, 2011 10:41 am
Posts: 1134
Location: Cornwall, UK
 Post subject: Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
PostPosted: Fri Aug 17, 2012 4:37 pm 
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?

_________________
How to get around the two code nest limit in MapTool (and MOTE)


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9483
Location: Netherlands
 Post subject: Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
PostPosted: Fri Aug 17, 2012 4:58 pm 
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

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
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


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Tue Aug 23, 2011 10:41 am
Posts: 1134
Location: Cornwall, UK
 Post subject: Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
PostPosted: Fri Aug 17, 2012 5:54 pm 
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.

_________________
How to get around the two code nest limit in MapTool (and MOTE)


Top
 Profile  
 
 Offline
Dragon
 
Joined: Wed Oct 19, 2011 1:07 am
Posts: 958
 Post subject: Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
PostPosted: Sat Aug 18, 2012 8:09 pm 
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 :)

_________________
My stuff for the community:
Donate to the Mote Project
The Mote Project's G+ community
Mote on Facebook
Fully Customizable Calendar Drop-in


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Mon Jun 29, 2009 9:37 am
Posts: 3108
Location: Germany
 Post subject: Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
PostPosted: Sun Aug 19, 2012 3:59 am 
I can't reproduce. What did you do to trigger the error?

_________________
HELP: GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC.

most complete list of my maptool stuff


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9483
Location: Netherlands
 Post subject: Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
PostPosted: Sun Aug 19, 2012 5:01 am 
@lee: it would be helpfully if you can tell me when/where this happens.

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
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


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9483
Location: Netherlands
 Post subject: Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
PostPosted: Sun Aug 19, 2012 8:32 am 
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

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
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


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Mon Jun 29, 2009 9:37 am
Posts: 3108
Location: Germany
 Post subject: Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
PostPosted: Sun Aug 19, 2012 8:40 am 
Do you have an ETA of the next BoT version including this?

_________________
HELP: GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC.

most complete list of my maptool stuff


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9483
Location: Netherlands
 Post subject: Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
PostPosted: Sun Aug 19, 2012 9:10 am 
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.

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
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


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Mon Jun 29, 2009 9:37 am
Posts: 3108
Location: Germany
 Post subject: Re: Wolph42's 'Drop-in' Difficult Terrain v.1.0
PostPosted: Sun Aug 19, 2012 2:08 pm 
Thats good to hear. Then I delay my revision of my current gaming file :)

_________________
HELP: GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC.

most complete list of my maptool stuff


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman