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 .
×
Advertisement Create a free account

Ammo Confusion

1634590377
I use the 5E OGL, it has ammo tracking, it works fine. I see there is a second API (add on, replacement?) that allows you to track more than one type of ammo.&nbsp; We kinda need this, but I'm confused if the second Kyle G. script which reads "added a cursory script" is a second API I need to add, or do I need to replace the original. And is there any chance what was posted here 4 years ago is outdated? <a href="https://app.roll20.net/forum/post/4986382/multiple-ammo-type-for-same-attack/?pageforid=4989873#post-4989873" rel="nofollow">https://app.roll20.net/forum/post/4986382/multiple-ammo-type-for-same-attack/?pageforid=4989873#post-4989873</a>
1634597701

Edited 1634598135
Oosh
Sheet Author
It probably works, but it looks like Kyle has just modified the block of Companion code which handles the ammo. This means if you use both scripts, they'll probably both fire. This won't be an issue for multiple ammo types - "arrow, dart" won't process in the normal Companion API as that resource label won't be found. However anything with a single ammo type e.g. "arrow" is going to trigger both scripts and deduct the ammo twice. I think the intention was to manually install the Companion script, and then paste Kyle's handleAmmo function over the standard one - uninstall the one-click version of the script, grab the script from the repo, paste it into a New Script tab. Then find the handleAmmo function (searching for "var handleAmmo =" should find it quickly) and replace it with Kyle's modification. Alternatively, someone might have a suggestion on a script that already handles ammo better without Companion conflicts.