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

How to implement a stance that changes the stat damage is based on?

1460712780
AliceSteel
Sheet Author
API Scripter
One of my players has a feat that lets them use Strength as their damage stat when in certain stances. I'm currently trying to use TokenMod and/or Ammo in their Ability to automatically change the value of @{Akry|weapon1damagestat} from "@{str-mod}" to "@{dex-mod}". What would be the correct syntax to do this?
1460716482

Edited 1460719916
Silvyre
Forum Champion
Try this out: !ammo @{Akry|character_id} weapon1damagestat [[ -1 * @{Akry|weapon1damagestat} + {@{Akry|weapon1damagestat} + d0}=@{Akry|str-mod} * @{Akry|dex-mod} + {@{Akry|weapon1damagestat} + d0}=@{Akry|dex-mod} * @{Akry|str-mod} * (1 - {@{Akry|str-mod} - @{Akry|dex-mod} + d0}=0) ]] If @{weapon1damagestat} = @{str-mod}, sets weapon1damagestat equal to @{dex-mod}. Else, if @{weapon1damagestat} = @{dex-mod}, sets weapon1damagestat equal to @{str-mod}. Else, if @{weapon1damagestat} = @{str-mod} = @{dex-mod}, sets weapon1damagestat equal to @{dex-mod}. Else, (if @{weapon1damagestat} ≠ @{str-mod} and @{weapon1damagestat} ≠ @{dex-mod}), sets weapon1damagestat to 0 (if you'd like, this behaviour could be altered with the insertion of a bit more code, e.g. such that weapon1damagestat does not get changed in this case).
1460756396
AliceSteel
Sheet Author
API Scripter
I put that in to the stance application macro where weapon1damagestat starts as "@{str-mod}" and Ammo gave the following error message:  Amount [0] is not correct. Please specify a positive or negative integer value like -1 or 4 Any ideas?
1460760608
Silvyre
Forum Champion
Oh, I was unaware that such a limitation existed... I've asked the script's author about whether this behaviour could be changed.
1460839515
The Aaron
Pro
API Scripter
I've pushed version 0.3.3 which will now accept an adjustment of 0.  The message is slightly weird: Foo gains 0 ammo and has 1 remaining. But the functionality will work until my pet unicorn is released.
1460839544
The Aaron
Pro
API Scripter
Convenience link:&nbsp; <a href="https://github.com/shdwjk/Roll20API/blob/master/Am" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/Am</a>...
1460839568
Silvyre
Forum Champion
Thank you!
1460839841
The Aaron
Pro
API Scripter
Yup! &nbsp;Sorry for the delay, busy Friday. =D &nbsp; Let me know if that works out, or if you need any other adjustments. Happy Rolling!
1460844100
AliceSteel
Sheet Author
API Scripter
The Aaron said: I've pushed version 0.3.3 which will now accept an adjustment of 0. &nbsp;The message is slightly weird: Foo&nbsp;gains 0 ammo and has 1 remaining. But the functionality will work until my pet unicorn is released. How long before this new version is in the One-Click Install system?
1460852525
The Aaron
Pro
API Scripter
I would guess tuesday as that seems to be historically when Steve has done the merge. &nbsp;I can help you get it setup before then if you need it sooner.
1461022839
The Aaron
Pro
API Scripter
The updated version is now available via 1-click. &nbsp;Let me know if you run into any more problems.