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

Workaround for Global Damage Bonus not working with ChatSetAttr and Sheetworkers on Roll20 sheet

1567468852

Edited 1590169657
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
EDIT: The workaround below still works, but there is a new and better workaround that became  possible with the API upgrade of JavaScript. You can find it here . or: "How can I send my barbarian into a rage?" As detailed in several threads,[ 1 ][ 2 ] as well as the Sheetworker bug thread , toggling the checkbox on Global Damage modifiers using the API does not actually turn the modifier on or off. It just changes the state of the checkbox. So until this gets fixed, I present this incredibly lame workaround. :) I'll use Barbarian rage for the example, but the principle can be applied to Hunter's Mark or other abilities. Note: I have an improved version of this a couple of posts down. 1. Create a custom attribute on your barbarian character called "Raging". This will hold a value of 0 or 2. 2. Create token abilities (sheet macros) on the sheet called Rage-On and Rage-Off: Rage-On: !setattr --sel --silent --evaluate --Raging|2 !token-mod --set statusmarkers|strong /em flies into a terrifying rage! !setattr --sel  --silent --evaluate --repeating_damagemod_$0_global_damage_active_flag|1 Rage-Off: !setattr --sel  --silent --evaluate --Raging|0 !token-mod --set statusmarkers|-strong /em calms himself. !setattr --sel  --silent --repeating_damagemod_$0_global_damage_active_flag|0 Line 1 Toggles the rage damage value in the attribute "Raging" Line 2 puts a status marker on the token to remind you that your character is ticked off. Line 3 puts an emote in chat to let others know he is murderously upset. Line 4 toggles the Global Damage Mod flag so a casual glance at your sheet will confirm that your character is not at all happy. 3. In each of your weapons, in the damage 1 field add this to the damage: +@{Raging}[Rage] When you use that weapon the rage damage will be calculated as part of the base damage for the attack. It will work properly for criticals and will be part of the total. It will display on a hover, like other damage calculations: And yes, my barbarian character is named Marmaduke Gallant. Why do you think he's so angry?
1567469604
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
And before anybody asks, just toggling the bonus value in the Global Damage Mod field does not change the value. It just toggles the displayed  value. (Thanks for keeping me honest, Scott C)
1568349084

Edited 1568351075
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Worked this a little more. It was not always obvious that the rage bonus was active if only looking at the chat output. I created a second new attribute called "rage_text". I use ChatSetAttr to toggle the value between " plus raging" and "". Then in any melee weapon attack, I add @{rage_text} to the damage type field: slashing @{rage_text} I also added a counter to display the number of rages remaining. Then when raging is active/inactive, I get this: I removed the code to toggle the global damage bonus, since it doesn't work and was confusing. Here's the new code: Rage ON: !setattr --sel --silent --Raging|2 --rage_text| plus raging !token-mod --set statusmarkers|strong /em flies into a terrifying rage! !setattr --modb --sel  --silent --class_resource|-1 /w "@{character_name}" Number of rages left: [[@{class_resource}-1]] Rage OFF: !setattr --sel  --silent --Raging|0 --rage_text| !token-mod --set statusmarkers|-strong /em calms himself.