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

Character Attributes & Abilties Question

So I have a simple script which is able to adjust values on a character sheet.  It is working without issues.  The issue I am wondering about is that I am trying to use it to reduce the ammo count by 1 immediately before the attack.  So I listed two lines in the Eregrin character's Attributes & Abilities section as below: !acsv Eregrin,repeating_attack_-K9xRpBSW1oL9e7Rn01l_ammo,-1 %{Eregrin|repeating_attack_-K9xRpBSW1oL9e7Rn01l_attack} The issue is when the second line displays the attack, the ammo is starting amount and not the reduce by 1 amount.  When I go double-check the character sheet, I do see in fact that the ammo is reduced.  In this example, ammo is 60 to start.  When the longbow attack displays, it shows ammo 60.  When I check the character sheet, it is showing 59. Is there some timing issue that causes this?
1456677653

Edited 1456677678
Yeah. API takes affect after any commands in chat and that includes roll templates. No way around it without scripting the entire thing and not using roll templates.
That is what I was afraid of.  Thanks for the quick response.
1456678570
Lithl
Pro
Sheet Author
API Scripter
Of course, you could modify the attack macro to send (ammo - 1) to the roll template. =)
1456696770
Kryx
Pro
Sheet Author
API Scripter
Ya, not being able to sync the roll template and API is really unfortunate. I could potentially create a toggle that shows ammo - 1 in the roll template.