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

Api to refresh page UDL or force vision update on a page?

Hi all, Is there an API that could either refresh the UDL settings on a page (toggle off and on the page "DYNAMIC LIGHTING" or force to refresh the vision on all tokens ? I have an API (Observer) that seems to get probalems doing this with the UDL now... I know it's quite an old script but will be very handy for IRL games that i plan to do in a few days. The script works well with all permissions to edit and control tokens, but unfortunately, the visions of the tokens don't update as they're supposed to when the turn order is switched from one player to another (or to a NPC either). I know it's probably a refresh vision problem because doing it manually through the page settings, the vision update correctly. It also work well when your refresh the browser page (but you must admit that's totally unbearable during a game at each character's turn. So in the meantime that someone finds a solution on the "observer" scrcipt itself, it could also work if afetr each turn order, i'd press a macro to refresh the vision. Of course, if the page DYNAMIC LIGHTING is toggle off then on again, it would be great if the map wasn't fully discovered and the re-hidden. Thank you anyone for your help if you have an idea and/or a solution. Coders, the challenge is yours !!!
I've seen this bug with UDL, and it's often fixed by simply moving the token.  So a workaround could be adding a couple lines of code to just move the token 1px which should hopefully 'update' the vision settings to the client computer.
Actually all the tokens should move then. But even moving a token by hand doesn't have the refresh vision effect unfortunately...  Thank you. 

Edited 1624262502
So, just to confirm that it works or not, how would I create a token mod macro to select all my players and move them 3px forth and back to their position.  I will have to select all tokens because all tokens vision should refresh each time turn order advances...  Also, the "observer script" don't act on the vision itself but on the controlled by settings, would updating the vision for the tolens  by moving them be of any use? 
!token-mod --move 3 -3 I don't know for sure if using TokenMod to move a token will force the vision to update after Observer changes edit & view permissions, but it's worth a try.

Edited 1624281376
Thank you. That would be for one token selected. Any idea how to move all tokens  in one time? Using character id's? What would be the token mod macro to move all characters 2 px, and back to their original position right after the move?  EDIT: I just tried on each character separately and it actually doesn't refresh the views.