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

change:token called multiple times

Howdy folks, I'm having an issue where change:token  is called multiple times. The number of times it is called seems to differ between characters. With one character, I change the value of bar1, and I change:token  is called 2 times. On another character in the same game, it is called 7 times. For testing purposes, I have disabled all scripts except the one in question, and stripped the script in question down to present the bug only. Does anyone know why this happens, and how to work around it? Thank you! var MASSIVEDAMAGE = MASSIVEDAMAGE || (function() { 'use strict'; var version = '0.1.2', MassiveDamage, HandleGraphic = function(obj, prev) { log("test3") }, RegisterEventHandlers = function() { on('change:token', HandleGraphic); }; return { RegisterEventHandlers: RegisterEventHandlers }; }()); on("ready", function() { 'use strict' MASSIVEDAMAGE.RegisterEventHandlers(); log('MassiveDamage started...') })
1594224330
The Aaron
Roll20 Production Team
API Scripter
It's called for each token that represents the same character and links the bar that was changed. If you log the token ids and page ids, you'll find the tokens are different and on various other pages (probably).