Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

Controlling Token Visibility With Macros

Hello all. I have been tinkering with  roll20 for a long time now.  I have played one War Hammer game as a player and I have used it as the battle map for my D&D games/dungeon crawls as a DM (I use my laptop behind my DM screen and one of the players moves the party around the dungeon as I 'reveal' it to them). But, recently, I have decided that I want to put a board game into this system.  I have chosen to try to set up Avalon Hill's Dune.  It all seems to work very well so far -- the board looks good, the tokens are good and the card mechanic seems to work very well. One thing that I want to do, however, is to have a way to semi-automate the 'storm'.  If you don't about Dune, allow me to fill in some details...  the game board is basically a circle.  There are 19 pie shaped regions around the board.  The 'storm' moves through these regions, 1 to 6 regions at a time, each turn, and in the real game, it's signified by a marker around the perimeter.  Each region the storm moves through, it wipes out everything in it.  So, if the storm moves 5 regions, it will clear out 5 regions, moving clockwise, from it's start position to it's final position. So, my idea was (after watching people stream a game on YouTube) was to have a translucent wedge that moves around overlaying on the game map. I originally did this by drawing all the wedges out, placing them on the GM layer of the map and then trying to move them to the game player map as needed. This is proving to be very awkward -- ti's hard to select the correct wedge, and when moving to the token layer, that cool translucent effect disappears. I did notice that there is a macro option.  But, it seems to me that anything done in the macro will only effect the chat window -- stuff like die roles and such. So, my question, is there any way a macro can be written that would how and hide tokens?  For example, #storm 1 3, which would hide any currently visible wedge and display wedges 1 to 3? Or, does anybody have any other ways to approach this? Thanks for any input.
1572358610
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
This is possible to do with API access. Macros by themselves are little more than an automated way of printing text and dice results to the chat. With an API script—such as Token Mod—you could very easily automate this sort of action. If you are handy at programming, you could even make a dedicated script to do exactly what you are talking about with minimal fuss.
Thank you so much for this _very_ quick and helpful response!!! I just did a quick read of the API's and... wow...  this is mighty kung-fu you have introduced me to...   i mean, after reading just a little bit, I can already see by incorporating the 'toBack' and 'toFront' combined with the 'findObjs' I can put all my wedges on the map layer (which is better as they then can't be messed with by the players) and toggle the selected one from front to back... Now, I am going to go dig into a way to trigger this from playing a card...  ie.... 'the storm moves 3 regions'....  nice. Again, thanks so very much for this!! Greg
Argh. Just realized that I need to be a 'pro' level user to use an api script. Time to talk with the wife and see if that's in the budget..:) Greg
1572364544
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Sorry, I get used to people just knowing that API access is a Pro subscription. I should have made that more clear up front. If you do find it within your budget, it's amazingly powerful. It would be hard to go back.