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

[Script Request?] Expanded Ammo Tracking for 5E OGL

I am looking for a way to track expended ammunition automatically and then at the end of battle be able to recover half of the ammo rounded down per Players Handbook. Does this already exist or can someone make an API that could do it?
I use ChatSetAttr for the very same thing Theodore. Combined with the ammo-script from the OGL companion.
That is the part I am struggling with on trying to get it functioning correctly. I tried it with ChatSetAttr but it only will add the expended ammo and not give a calculation of recovered ammo.
Ok this is what I have. First part is connected to the shooting macro adding 1 to the attribute: Firedarrows for the affected character. The next one is keeping count on how many arrows can be retrieved after the battle. Note that it doesn't add the arrows automatically. It just tells the player how many that could be retrieved. If anyone have a more elegant solution I'm all ears. :D !setattr {{ --silent --name Wilhelm Kranke --mod --Firedarrows|1 }} &{template:npcaction} {{name=Wilhelm Kranke}} {{rname=Retrieving Arrows}} {{description=[[ceil(@{Wilhelm Kranke|Firedarrows}/2)]] arrows.}} !setattr {{ --silent --sel --Firedarrows|0 }}
Ravenknight said: Ok this is what I have. First part is connected to the shooting macro adding 1 to the attribute: Firedarrows for the affected character. The next one is keeping count on how many arrows can be retrieved after the battle. Note that it doesn't add the arrows automatically. It just tells the player how many that could be retrieved. If anyone have a more elegant solution I'm all ears. :D !setattr {{ --silent --name Wilhelm Kranke --mod --Firedarrows|1 }} &{template:npcaction} {{name=Wilhelm Kranke}} {{rname=Retrieving Arrows}} {{description=[[ceil(@{Wilhelm Kranke|Firedarrows}/2)]] arrows.}} !setattr {{ --silent --sel --Firedarrows|0 }} That will work. I was sort of wondering if I would have to go that route.