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 .
×
Create a free account

World Discovery reversal question

Hello team.  I've been using API scripts a lot, but I do not know how to code much.  I was wondering if there was a way to edit the World Discovery script so it will do the opposite of it's current function.   I'd like to have a roof on a house as a separate object, obviously hiding the interior of the building.  When the players 'enter the house' it will trigger the API script, moving the roof object onto the GM layer revealing the inside of the house.  Is this a quick edit? Or should I just get the mouse ready and hit 'L, K?' Thanks for any input! Stoph
1496505089

Edited 1496505116
Ziechael
Forum Champion
Sheet Author
API Scripter
One thing I've toyed with, but never quite been able to commit any time to, is using the 'It's a Trap!' script to do something like this but in reverse. I'd have the map complete with roofing and then have the interiors as 'traps' on the GM layer so that when the players collide with them, by trying to enter for example, it would trigger the 'trap' interior to move to the front of the map layer thereby revealing the interior of the property! For those more savvy than I it must be possible using the same kind of functions that It's a Trap! does to do what you want in a more bespoke way though ;)
1496508109
Pat S.
Forum Champion
Sheet Author
It can be edited to change what layer the token goes to. I was running an edited version once that shifted the trap token from the gm layer to the map layer instead of the token layer. I didn't think about copying the script when I deleted that game so I don't have the code anymore.
1496508880
Ziechael
Forum Champion
Sheet Author
API Scripter
The one-click has a user option for choosing the layer for the traps built in now :)
Thank you for the replies! I'll look into these ideas.
1496514574
Pat S.
Forum Champion
Sheet Author
Ziechael said: The one-click has a user option for choosing the layer for the traps built in now :) Cool but i hacked mine to whisper the alert to the GM and the player not to public chat also. I had it hacked for something else also.
1496530484
The Aaron
Pro
API Scripter
You could actually queue that up as a couple TokenMod commands pretty easily. You could even set them up as token action Abilities on a switch character and use various of the bars to specify the tokenid and positions to move to.  hide roof: !token-mod {{ --set top|-10000 left|-10000 --ids @{selected|bar3} }} restore roof: !token-mod {{ --set top|[[@{selected|bar2}*70]] left|[[@{selected|bar1}*70]] --ids @{selected|bar3} }}
1497764934

Edited 1497765173
Great idea, i tried it, but only the hiding works for me. Restore doesn't bring it back in place for me, its somewhere out there : ) I use cmd+shift+k to hide and cmd+shift+m (or "o" for tokens) to restore, for me it is also a good way for quick hide and reset something (don't now what cmd for windows is, perhaps strg?)
1497819300
The Aaron
Pro
API Scripter
hmm.. did you have the original coordinates in bar1 and bar2 of the switch character?
Oooops :) Okay, forget what i said.
1498324872
The Aaron
Pro
API Scripter
=D  Happy Rolling!