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

Auto Add Temp HP

1628193393

Edited 1628193627
I'm about to start a new Dungeons and Dragons game. I'm playing an Arte Armorer. I'm attempting to create in the "Attacks and Spell Casting" field, the Defensive Field ability of the class, and have it auto add the designated amount to temp hp.  I can get it to out put the right number using @{Charname|level} but my attempt to use something like: !setattr --name Raysh --hp_temp|@{Raysh|level} keeps failing.  anyone got any ideas? Or is this just not possible without using API scripts (something i dont want to ask the DM to do, since he is new to DMing, and i dont want to bring him down the rabbit hole of Roll20 and API's just yet). Edit to add: Ive also tried !setattr --Raysh --hp_temp|@{Raysh|level} and this is what chat returns to me:  SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but "!" found. Raysh: !setattr --Raysh --hp_temp|5 5 Temp Hit Points Defensive Field
1628193855
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Try this: !setattr --name Raysh --hp_temp|@{level} If you have already defined the character to affect, you shouldn't need to do it again. Also, try: !setattr --name Raysh --hp_temp|[[@{level}]] just in case level is not defined as an integer?
keithcurtis said: Try this: !setattr --name Raysh --hp_temp|@{level} If you have already defined the character to affect, you shouldn't need to do it again. Also, try: !setattr --name Raysh --hp_temp|[[@{level}]] just in case level is not defined as an integer? Hey thanks for the quick reply! I have tried both of your suggestions: The first returns a syntax error, and the second returns nothing
1628197271

Edited 1628197288
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
There seems to be an issue with the --name parameter. Using a test character named "Kestrel" and putting it in quotes, I get this message: No character named "Kestrel" found. No target characters. You need to supply one of --all, --allgm, --sel, --allplayers, --charid, or --name. It does work with a charid, though. To find the charid, select the token representing the characetr and run: @{selected|character_id} this will return the id. Copy it (including the dash at the beginning), and change your macro to: !setattr --charid -1234567890123456789 --hp_temp|@{Raysh|level} replacing the charid with the one you copied. It worked on my test.
Thanks man! appreciate the help.