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

Disabling global AC mod via API does not change AC - ideas?

1592746159
Magnar S.
Pro
API Scripter
I am working on my short/long rest script , and would like to turn off short-lived blessings via the API. This is what I am doing now: var attr = ... // find the relevant repeating_acmod_$0_global_ac_active_flag attr if (attr.get("current") == "1") { attr.set({ current: "0" }); } This successfully toggles the checkbox off in the UI, but it does not change the characters current AC. Curiously, toggling it on again via the UI does nothing, then back off finally updates the AC correctly. What do I do to properly turn off a global modifier?
1592747664
Magnar S.
Pro
API Scripter
I figured this one out myself. Turns out there is a setWithWorker that makes sure to run any worker scripts. Should I always use this for other attrs too, just in case there's a worker script I am unaware of?
1592753815
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The Global Modifiers are buggy like that, although my experience is with the ChatSetAttr script. Although I have it set to work with sheet workers, the behavior is quirky.