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

Hi there I asked this 2 weeks ago but no-one could help. Just thought I'd give it one more try..

Hi, Looking to include the ammo tracking from the 5e OGL script so it works with my powercards macro. I have a powercards macro for my players so they can click on the token they want to attack. It does the required rolls and applies damage to the token if they hit as well as having a visual and sound effect. The problem with it is that as they are using a macro not interacting with the character sheet it no longer triggers the ammo tracker reducing their ammo. Does anyone think its possible to add some code to the macro that will trigger the ammo tracker from the 5e OGL script?  The script is below and thanks for any advice. !power {{  --name|Squocka  fires his Longbow  --leftsub|Ranged Attack  --rightsub|120/600 ft Range  --@{target|npc_name}  --Attack:|[[ [$Atk] ?{Attack|Standard,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1} + @{selected|dexterity_mod} +@{selected|pb} ]] vs AC @{target|bar2}  --?? $Atk >= @{target|bar2} AND $Atk.base <> 20 ?? Damage:|[[ [$Dmg] 1d8 + @{selected|dexterity_mod}   ]]  --?? $Atk.base == 20 ?? Critical Hit|[[ [$CritDmg] 2d8 + @{selected|dexterity_mod}  ]]  --soundfx|_audio,play,nomenu|  --vfx_opt|@{selected|token_id} @{target|token_id} beam-smoke   --?? $Atk >= @{target|bar2} AND $Atk.base <> 20 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] _show|all  --?? $Atk.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg] _show|all }} !sfx volume:50 song:arrow  action:play Thanks for your help.
1622295373
Andreas J.
Forum Champion
Sheet Author
Translator
I think the Ammo Tracking in the 5E Companion API is supposed to be automatic, so it listens to normal rolls made from the sheet. Not sure if you can make that API to force update when doing a powercard roll, but I'd think it might be easier to instead use either of these API instead to update the ammo count, when the powercard is rolled: <a href="https://wiki.roll20.net/Script:Ammo" rel="nofollow">https://wiki.roll20.net/Script:Ammo</a> <a href="https://wiki.roll20.net/Script:ChatSetAttr" rel="nofollow">https://wiki.roll20.net/Script:ChatSetAttr</a>
Spot on Andreas J! Thanks heaps mate :)