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

Macro to add Temp HP

One of my players is using a custom barbarian subclass which adds temp HP when they Rage. I'm trying to do a Macro that adds temp HP. I got this from one of the other help topics but I'm struggling to get it to calculate the value I need. Con Modifier + Class Level !token-mod --set bar3_value|[[ @{selected|bar3}+ (constitution_mod+base_level) ]] Also if anyone can work out how to make the macro also tick that RAGE global damage box on the character sheet that would be amazing, but this is beyond me
1601936981
The Aaron
Roll20 Production Team
API Scripter
Probably ChatSetAttr would be more appropriate as it can let you set attributes without linking them to bars.
Hmmm I managed to get it to add temp HP with this: !token-mod --set bar3_value|[[ @{selected|bar3}+(@{selected|constitution_mod}+@{selected|base_level}) ]] I'm not sure what you're suggesting Aaron. I've got the ChatSetAttr API installed
1601937517
The Aaron
Roll20 Production Team
API Scripter
ChatSetAttr would let you toggle that global rage damage mod on and off.  I don't recall the specific syntax or know what the attribute name is, but it should be pretty easy to sort out from the documentation.  I'd look into it more directly, but I'm a bit swamped with work right now...
1601937810

Edited 1601937862
Oosh
Sheet Author
API Scripter
Looks like you already have this bit sorted I think you've got the calculation right, apart from the syntax? You need to keep using Attribute calls: [[@{selected|bar3}+@{selected|constitution_mod}+@{selected|base_level}]] If they are multiclassed and Custom Barbarian wasn't the first class taken (at level 1) then you might need @{selected|multiclass1_lvl} instead. The global damage mod Attributes are hidden, I have no idea if ChatSetAttr will work with it or not, but the checkboxes are linked to these: @{selected|repeating_damagemod_$0_global_damage_active_flag} with $0 being the first slot and counting up from there. So theoretically: !setattr --sel --repeating_damagemod_$0_global_damage_active_flag|1 should set the first global damage mod to "on".
I'm with ya. I'll have a look. Is there an easy way to identify the attributes as that the bit that I always struggle with? 
1601938306
Oosh
Sheet Author
API Scripter
If you right click the input for the Attribute (or checkbox in this case) then select "inspect element", the <name="attr_some_name_here"> property of the input generally tells you the Attribute name. Drop the attr_ from the front - you need that for the sheet & API side, but not from the chat bar. If it's part of a repeating section, you'll have to scroll back up through the parent elements in the HTML to find the parent rep container name as well. It'll also have the rep row id as a long string like -YAG1278641msldkvnsAUI, you can ignore those and just use $0, $1, $2 in most cases. Putting the 3 together, you have <rep container><row id><rep attribute name>. If you have a look at the global damage mod flag, it should make sense. Kind of.
Thanks I found someone who had already done it and managed to cobble together this: /em unleashes her inner RAGE !token-mod --set bar3_value|[[ @{selected|bar3}+(@{selected|constitution_mod}+@{selected|base_level}) ]] !ammo @{selected|token_id} class_resource -1 Rage, !setattr --silent --sel --repeating_damagemod_$0_global_damage_active_flag|1