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

Ki Points & Charsetattr

1509755937

Edited 1509755971
Hey guys, So I'm part of a game that has the API script Charsetattr.  What I'm trying to do is have it so that when I use monk abilities via the features & traits block that it deducts the appropriate amount of Ki points from the character. Then sets the class_resource(Ki) to the correct number. Here is how I work my monk's stunning strike: DC = [[8 + @{char_name|PB} + @{char_name|wisdom_mod}]] vs @{target|foe|token_name}'s con save = [[1d20+ @{target|constitution_save_bonus}]] What I would then like to do is, when I click on this that the class resources deducts 1 and then shows the new amount.  Then when I click on this or another monk ability, it uses the updated value instead of the total. It may sound complicated, and I'm sorry about that but also really thankful for any and all help/responses!! Thanks, Chris
DC = [[8 + @{char_name|PB} + @{char_name|wisdom_mod}]] vs @{target|foe|token_name}'s con save = [[1d20+ @{target|constitution_save_bonus}]] !setattr --charid @{char_name|character_id} --mod --class_resource|-1 Ki points remaining @{char_name|class_resource} Try this. Technically with the setattr command it will output what the remaining Ki points but calling it class_resource. Once you verify that it works as intended you can put --silent on the end of the middle line to silence the ChatSetAttr output.
Hey Kyle, Thanks for your quick response. So I copied and pasted in your code changing the char_name to my character's name and here is a screen shot of the output.  I'm rather new to this, am I missing something or have I done something wrong?
1509814511

Edited 1509814523
Ahh so you are using the trait to call it instead of a normal macro. In that case you are going to have to do this using an API command button Put this into the description underneath the DC = XX vs  con save = XX [Use Ki](!setattr --charid @{character_id} --mod --class_resource|-1)
You sir, are a legend!  You have helped me so much!