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

ChatSetAttr - Spell Slot Expended Help

I am trying to use ChatSetAttr to modify spell slots for a paladin using Divine Smite as a global modifier. My first step was to try and modify the spell slot: !modattr --name Pierce -- lvl1_slots_expended | -1 It gives me an output:  (From ChatSetAttr): Setting attributes Setting lvl1_slots_expended to 1 for character Pierce. But it doesn't update on his character sheet. If I use it again, it says its changed but it remains the same on the character sheet. Any idea on what I am doing wrong? (I haven't even tried putting it in the Global modifier yet, since I can't even update it from chat yet.)
Try using: "--lvl1_slots_expended|-1" without any space between the "--" and the "lvl1_slots_expended"
Marco you are amazing. Thanks man! Didn't think the spacing would affect the api! Do you know the api will work via global mods?
Marco said: Try using: "--lvl1_slots_expended|-1" without any space between the "--" and the "lvl1_slots_expended" I've gotten it to work in the Global Attack Modifier field. I apply {} around the api command. However I am having trouble getting it to work in the Global Damage Modifier. Any Ideas?
1592238337
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
You have run into a known issue. The Global Damage Modifier Field does not work well with being set by the API. There are a number of fields like this on the D&D 5th Edition by Roll20 Sheet, and they don't look likely to change any time soon. Here is a thread describing the behavior and how to work with it.
keithcurtis said: You have run into a known issue. The Global Damage Modifier Field does not work well with being set by the API. There are a number of fields like this on the D&D 5th Edition by Roll20 Sheet, and they don't look likely to change any time soon. Here is a thread describing the behavior and how to work with it. Thanks Keithcurtis! I appreciate it! Is it at all possible to have damage be applied via the Global Attack Modifier Field?
1592245501
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Nope, that just modifies to-hit calculations. That one works correctly though, I believe.
1592282066

Edited 1592282237
Oosh
Sheet Author
API Scripter
I'm not sure if this helps your intended use at all, but you can add  your own global modifiers on a per-macro basis. An example spell damage template: @{bob|wtype}&{template:dmg} {{rname=Eldritch Blast}} 0 {{range=120 feet}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d10 + @{bob|pb}[PROF]]]}} {{dmg1type=Force}} 0 {{dmg2=}} {{dmg2type=}} {{dmg2flag=}} {{crit=1}} {{crit1=[[1d10]]}} {{desc=}}  {{spelllevel=}} {{innate=}} {{globaldamage=[[@{bob|global_damage_mod_roll} + @{bob|customGD} ]]}} {{globaldamagetype=@{bob|global_damage_mod_type}}} ammo= @{bob|charname_output} Could you then use ChatSetAttr to modify @{bob|customGD} or does this still run into the problem Keith has highlighted? Don't have API to check, sorry! Edit - for clarity, they are not really "global modifiers" as you have to add them to each macro, but it is added to the global mod damage and still function correctly as a single roll if called multiple times in the macro, for example using a custom attack modifier on an Advantage roll.
1592284166
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
That's pretty much the lame workaround I came up with here .
Joe, if you use the 5e charecter sheet by Roll20, you will get the desired result also by using the automatic spell slot tracking . Just make it a spell with an attack so that it appears on the "core page" as an attack. If you add the "higher lvl cast dmg", you will also have the option to chose from different spell slot lvls.
Thanks for the responses guys! Yea I figured out the macro, it just kind of sucks. I wanted the players to be able use the global modifiers and it track spells when they use them. I appreciate all the responses, yall rock.