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

[Thinking About] "Dynamic Lighting Eye Tracking".... Or "Sneaking Up on Villager Vince."

1427753025
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
My token (selected) has light 100 feet that dims at 0 feet. Villager Vince has light 100 feet that dims at 100 feet (or never) but only has 10% field of view and his light is visible by all. He is a patrol token (API) and his eyes scan left and right but I can always tell where he is looking (shows up just as pictured.) If a transparent token was used for the villager's "eyes", you could get a really cool effect... he could scan -60 to 60 relative to the direction he was facing.
1427753385
The Aaron
Pro
API Scripter
Interesting. Could certainly run some interesting infiltration games... (looking for the Metal Gear Alerted Guard sound on sound cloud...)
1427756368
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Stuck in a dreadful place due to work so I can't do much online. Plan to try this with API in a few days. i think the "eye scans" could produce a really player engage effect.
1427778295
vÍnce
Pro
Sheet Author
So the player's are clueless as to wether or not they've been seen or "death-rayed" by "Vince"?
1427800231
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Players can the see the death ray. They can observe that patrolling of the the death ray... And time thier movements to avoid it.
1427917806
PaulOoshun
Marketplace Creator
Oh so a token on top of Villager Vince would look back and forth as well as along his patrol path??
1427921037

Edited 1428010870
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Yes.... however having tested it the lighting setup required leave much to be desired.
1428010891
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
I think I have something that work.... hacking away at the code.
1428025180
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
<a href="http://i.imgur.com/zSRVDsC.gif" rel="nofollow">http://i.imgur.com/zSRVDsC.gif</a> So.... I took a look at existing patrol scripts...and.... Started to think I could place pathing on the GM layer (tracks to follow and special instructions based on the GM layer image.) Long way off from anything working... but this has implications for map making too. The idea is the API makes the "best guess" at where to place the tile and avoids going off the map. The "start" token has a token action to relate it to an NPC later.
1428074536
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
<a href="http://i.imgur.com/3pdz75s.gif" rel="nofollow">http://i.imgur.com/3pdz75s.gif</a> Have to care for "flip" but at you can see the API tries to follow the path based on where the last tile was and which direction it was pointing. Again, this could be great for NPC path patrols but also map making.
1428076606
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
<a href="http://i.imgur.com/24pfBdQ.gif" rel="nofollow">http://i.imgur.com/24pfBdQ.gif</a> Supports 45 degrees....
1428078744
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Still a lot of work to do.... ..but.... <a href="https://github.com/BaldarSilveraxe/Pathing-Patrol/tree/master" rel="nofollow">https://github.com/BaldarSilveraxe/Pathing-Patrol/tree/master</a>
1428080782
Ziechael
Forum Champion
Sheet Author
API Scripter
I may be a bit sad but watching this grow has been the highlight of the past few days for me... especially the regular /talktomyself posts from Stephen, can't wait to see what comes next: 'Supports AI, skynet is born'??
1428083032
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
So I should post a bit more detail. The idea is setting up "paths" basically train tracks on the GM layer. NPC tokens related to the paths will auto patrol them. Currently supporting the following... but plan to expand it. 1) This token is start tile, a token associated to this tile will start here. When its time to move it will move in the direction of the arrow. This is also a single direction path. If it returns to this path (total path is a square path) it will continue through without stopping. 2) This token is start tile, a token associated to this tile will start here. When its time to move it will move in the direction of the arrow. This is also a single direction path. If it returns to this path (total path is a square path) it will pause before moving on. 3) This token is start tile, a token associated to this tile will start here. When its time to move it will move in the direction of the arrow. This is also a single direction path. If it returns to this path (total path is a square path) it will stop. 4) 5) and 6) just like 1) 2) and 3) but bi-directional. 7) Straight path. 8) Straight path, with pause. 9) Stopping point. 11) Bi-directional straight path. 12) Bi-directional u-turn 13) -17) are just turns and cross paths. Some samples of valid paths: For additional actions, such as... look around... ring a bell... eat.... sleep.... whatever Roll20 "Status Indicator Overlays" can be used to flag a path tile and the API can make the token do things while on that tile before moving forward. Example... the NPC would do four things (whatever they maybe) before turning around.
1428116493
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
<a href="http://i.imgur.com/yncS4ow.gif" rel="nofollow">http://i.imgur.com/yncS4ow.gif</a> Much better UI (based on a suggestion by a fiddle player.)
1428118557
The Aaron
Pro
API Scripter
Those darned fiddly players... =D
1428165400
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Updated the script (I even ran it through JSLint.) 1) Have some more paths to add. 2) Need to make the images clearer. 3) Need to finish the process for relating a path to a token. 4) Need to create "Status Indicator Overlays" feature. Once those are complete.... we will have the paths. Next part is making the related token follow instructions. Things like: 1) Open and close doors they pass through. 2) Turn on or turn off torches they pass. 3) Speak or say something. 4) Look around or inspect.
1428178062
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Added some "merges" and "forks"........ some 135 degree turns... removed the "pause" ones (there is a better way to care for those.)
1428181512
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
LOL <a href="http://i.imgur.com/kKdJXSP.png" rel="nofollow">http://i.imgur.com/kKdJXSP.png</a> This is pathing is going to be fun I think.
1428182043
The Aaron
Pro
API Scripter
Is that a chicken?
1428182320
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Damn! Will you look a that.... and I know just what to name it.
1428186533

Edited 1428341517
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Stephen S. said: Updated the script (I even ran it through JSLint.) 1) Have some more paths to add. 2) Need to make the images clearer. 3) Need to finish the process for relating a path to a token. 4) Need to create "Status Indicator Overlays" feature. Once those are complete.... we will have the paths. Next part is making the related token follow instructions. Things like: 1) Open and close doors they pass through. 2) Turn on or turn off torches they pass. 3) Speak or say something. 4) Look around or inspect. Started on 3... Process will be 1) place the desired token on the GM layer on any open space. 2) select the desire start path (a token action will appear.) macro is: !pathRepresents @{target|token_id} @{selected|token_id} 3) when prompted, target the desired token (on the GM layer) 4) API will detect: {"content":"!pathRepresents -Jm5UjlQoUEl0N-I3z3c -Jm5Dky-N6b-6lJYzTAm","playerid":"-JlvHNwmF_W9ep1vSa4s","type":"api","who":"Stephen S. (GM)"} 5) desired token will be: a) Tagged as an auto token in state. b) moved to the token layer. c) moved under its start path tile. d) turned to the starting direction. e) wait for the go signal from the API
1428237759
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
LOL who is "angularMangler" on Gist?!? They found my spelling mistake!
1428258734
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Thinking that.... Red Bar value will be delay on the path for that "square" null or 0 to "n" seconds... so "null" (or "0") value is no delay and "5" would be a 5 second delay. Green Bar value would be "Look Left" degree and then to Blue bar value "Look right" degree.... setting those will allow any dirction of "Looking."
1428259799
The Aaron
Pro
API Scripter
Depending on what game you're playing, delaying for X turns, or X amount of available movement might be more useful.
1428260418
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
The Aaron said: Depending on what game you're playing, delaying for X turns, or X amount of available movement might be more useful. I thought about that.... But was trying to reconcile turn based with rotation. But I guess if I am going "wait" three turns... on each of turns my action will be to look left and right.
1428262543
The Aaron
Pro
API Scripter
You could still have the token pan over the course of 10-20 seconds on it's turn. =D
1428341145
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
The Aaron said: You could still have the token pan over the course of 10-20 seconds on it's turn. =D True! <a href="http://i.imgur.com/XuJyGac.gif" rel="nofollow">http://i.imgur.com/XuJyGac.gif</a> So relating a token is complete. API.... 1) Expects you to be working on the GM layer for set (this saves changing layers and the script will bump them in) 2) "Green dots" a related token. 3) wont let you relate a path token to path token. 4) Wont let you relate a token already related. 5) Un-relates token that has its match deleted. 6) You can clear a single relationship 7) You can clear all relationship. Matched token will auto move to there start point when the script it "readied" Thought about using other colored dot, one for each match, but you run out and I think they will be useful for maker a path as a "turn of torch" action (or something.