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

Automatic Reveal/Layer change

In the youtube video, it looked like a token was appearing when a PC token landed on a square on the grid. From the descriptions in the existing API topics, I couldn't find which script this would be. Is it available? What I'd like to do is put certain encounter tokens on the GM layer and have them move to the PC token layer (or map layer for traps) when they walk through a door, for example. I currently have most, if not all of my "enemy" tokens on the GM layer that I manually transfer when the PCs enter an area, as I've had players who like to move their tokens around to try and explore with the dynamic lighting. The lighting update on landing combined with judicious use of fog of war has helped with this, but I do like the idea of revealing traps and such as they're encountered in real time.
1386282257
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
That was from Riley D. video showcasing the split the party feature correct? He made that on the fly to demo the split that party feature... I think one could be made fairly easily... (Written from the hidden token perspective) If player token is where I am... reveal. If player is within my green bar radius.... reveal fragments.. (part of the ceiling falls.) If player is within my red bar radius... reveal.
1386282362
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
I think Brian had a barrier script... that might be worth looking at.
1386282518
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
<a href="https://app.roll20.net/forum/post/233192/script-automatic-trap-detection-an-advanced-approach-to-pathing-for-token-movement#post-233216" rel="nofollow">https://app.roll20.net/forum/post/233192/script-automatic-trap-detection-an-advanced-approach-to-pathing-for-token-movement#post-233216</a> Josh had this.
1386282559
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
<a href="https://app.roll20.net/forum/post/386135/script-collision-detection#post-387834" rel="nofollow">https://app.roll20.net/forum/post/386135/script-collision-detection#post-387834</a> Brian's
Here's the link: <a href="http://www.youtube.com/watch?v=I-JD8I8T_ic" rel="nofollow">http://www.youtube.com/watch?v=I-JD8I8T_ic</a> I'm talking about the Dragon Trap that appears around 1:02.
OK. I think I found the trigger code that Alex L. posted. <a href="https://gist.github.com/pigalot/5492222" rel="nofollow">https://gist.github.com/pigalot/5492222</a> Now, since I don't know much about the coding itself, what's the code for the "payload." How can I transfer a token from one layer to the next when it's triggered?
you use layer. like this I think. or close to it, can't remember exactly right now. obj.set(layer: "objects" ); can also use "gmlayer","map", or "walls". will send the object to the layer you want it to. generally the obj will be whatever token you have set, so you'll probably have it all named differently, but still.
This could probably be expanded as well so that you would only need to make whatever you want to reveal as part of an array, and it checks to see if you have moved over (or are within x feet of) the thing, then reveals it, as opposed to the current way of hardcoding the position and object as well as the layer swap. I will see what I can do over lunch today (if this 3hrs of sleep doesn't make me pass out before then).