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

5e macro to adjust vision and attack damage roll with APIs / mods

January 22 (3 weeks ago)

Hello!

So I have a player with a 5e flaming axe, and I have set up a macro for the player using Tokenmod so that they can toggle the lighting effect on and off. I wanted to add one more command to that macro, and I was hoping someone could help me understand how to do that.

The thing I'd like to add is that when the fire is toggled on, it also toggles on an additional 2d6 fire damage, until it is toggled off.

Currently, i'm just using the global damage modifier checkbox, which is fine, but I'm thinking there might be a way to do it all with one click.

Any help is appreciated!

January 22 (3 weeks ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Hi Ken!

Which sheet are you using? There are a large number of 5e sheets, and all would require specific syntax.

January 22 (3 weeks ago)

Ah, right, of course, the 5e 2014 R20 sheet.

January 23 (3 weeks ago)

Edited January 23 (3 weeks ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

If you install the ChatSetAttr mod, you should be able to add the following code to any macro to turn the value on:

!setattr --sel  --silent  --repeating_damagemod_$0_global_damage_active_flag|1


and this to turn it off


!setattr --sel  --silent  --repeating_damagemod_$0_global_damage_active_flag|0

Assuming that Rage damage is the first global damage mod. Otherwise increment the $ number: $1, $2, etc.
January 24 (2 weeks ago)

Sweet! totally worked! thanks a lot!

here's the code fwiw:

/fx nova-fire
!token-mod {{ --on emits_bright_light emits_low_light --set lightcolor|#cc0000 --set bright_light_distance|40 low_light_distance|40 low_light_opacity|70 }}
!setattr --sel  --silent  --repeating_damagemod_$0_global_damage_active_flag|1


!token-mod {{ --off emits_bright_light emits_low_light --set }}
!setattr --sel  --silent  --repeating_damagemod_$0_global_damage_active_flag|0