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

[PageFX/TokenMod] - BUG: Changing status through TokenMod not turning on/off effects

1476756280

Edited 1476756657
Support Class
Marketplace Creator
TL;DR: I want to use TokenMod to toggle the interdiction status of a token to turn on/off an attached PageFX, but PageFX is ignoring the change and only works if the status is changed manually. Okay, so this is my third thread on this task in the last couple days, but it's always asking about slightly different aspects and I want answers to be easily tracked down by other users, please forgive my clutter. The Goal: The players are going to be interacting with an NPC who is in a room with a powerful sphere of energy that exhibits very strange behavior --and suggests a bit of sentience. I'm using PageFX to represent the sphere. Sphere animation (Normal) :&nbsp; <a href="https://gfycat.com/AncientScholarlyCoyote" rel="nofollow">https://gfycat.com/AncientScholarlyCoyote</a> Sometimes, something gets said in the room and suddenly the sphere seems to get mad . In those cases, the appearance will change to this: Sphere animation (Mad):&nbsp; <a href="https://gfycat.com/PastelColossalCopperbutterfly" rel="nofollow">https://gfycat.com/PastelColossalCopperbutterfly</a> Now, at first, I was going to use TokenMod to change the token's GM info, and thereby change which effect the token was displaying, but GM Info is the one major parameter of the token that TokenMod can't affect. So, as a backup, I built two tokens, one with each effect, with the plan of stacking them on top of each other and then writing a macro that switches the interdiction status as true on one of the tokens, and false on the other, thus making a seamless change. The Problem: When you do this, PageFX does not recognize the change. The status marker appears or disappears on each of the tokens, but their effect state doesn't change. So, what I'm looking for is either confirmation that this is a bug, or an alternative execution I can use to pull this effect off. Demonstration of bug:&nbsp;<a href="https://gfycat.com/HealthyElementaryBasenji" rel="nofollow">https://gfycat.com/HealthyElementaryBasenji</a> Thank you for your continued tolerance of my bumbling through the dark recesses of API scripting.
1476757605
Support Class
Marketplace Creator
Oh, and just to be thorough, this is the macro I'm using to control their statuses. (There's two macros, but the second is essentially identical with the id's switched. !token-mod --ids -KUKJttuoU-foVxgrFZd --set statusmarkers|=interdiction !token-mod --ids -KUKPrS6yNgqgOmNorEO --set statusmarkers|=interdiction|-interdiction
1476758553
Support Class
Marketplace Creator
Trying to debug this: Would it be a fair guess that TokenMod's action of changing the status somehow doesn't trigger the change event inside PageFX? PageFX - Line 368: // Whenever a property of a PageFX token is changed, update its effect. on('change:graphic', function(obj) { if(obj.get('name') === 'PageFX') { // A PageFX token's "interdiction" status marker (the one that // looks like a "NO, you can't do this!" sign) can be used to // toggle its fx on and off. if(obj.get('status_interdiction')) deactivateEffect(obj); else _try(function() { activateEffect(obj); }); } });
API Events are only triggered by changes made by players/the GM playing the game. Events will not be triggered by API changes. For more information, please see <a href="https://wiki.roll20.net/API:Events" rel="nofollow">https://wiki.roll20.net/API:Events</a>
1476761260
Support Class
Marketplace Creator
Aw, nuts. Is there an alternate way to toggle the visiblity between the two tokens?
1476761685

Edited 1476761811
Support Class
Marketplace Creator
Solved! I added !pageFX off and !pageFX on to both macros, which forces PageFX to re-evaluate the token status and updates the effects as desired. <a href="https://gfycat.com/TiredTanAlaskajingle" rel="nofollow">https://gfycat.com/TiredTanAlaskajingle</a>
1476766855
The Aaron
Pro
API Scripter
Great! Btw, you can simplify slightly. &nbsp;This should flip the interdiction marker on both tokens in one go: !token-mod --ids -KUKJttuoU-foVxgrFZd -KUKPrS6yNgqgOmNorEO --set statusmarkers|!interdiction