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 sheet ammo management

Suppose I have a button that does this in a character sheet: button type='roll' value='/em attempts to fire with @{firearmname} [[1d100]]<@{firearmskill}' The above checks if it's a successful shot with a 1d100 vs your weapon skill. Is there a way to make it so when this is triggered, the amount that I have set on attr_weaponammo (where weapon ammo is held) is also decreased by 1?
1422542362
The Aaron
Pro
API Scripter
You can do this with a API Script as a Mentor. I happen to have one. =D <a href="https://app.roll20.net/forum/post/1034829/script-a" rel="nofollow">https://app.roll20.net/forum/post/1034829/script-a</a>...
1422568918
Stephen Koontz
Forum Champion
Marketplace Creator
Sheet Author
API Scripter
Compendium Curator
I've been very happy with Aaron's ammo script and use it in my personal game and on the Roll20 Live Stream.
1422576891
The Aaron
Pro
API Scripter
Rats! Now I have to watch it for that "Look Ma" moment! =D
Thanks Aaron, your APIs are amazing as usual, this should do the trick. I am wondering if in the future we will be able to edit parameters directly from the character sheet or tokens instead.
1422577550
Stephen Koontz
Forum Champion
Marketplace Creator
Sheet Author
API Scripter
Compendium Curator
The Aaron said: You can do this with a API Script as a Mentor. I happen to have one. =D <a href="https://app.roll20.net/forum/post/1034829/script-a" rel="nofollow">https://app.roll20.net/forum/post/1034829/script-a</a>... Haha, you're even in the credits!
1422580073
The Aaron
Pro
API Scripter
Wha!?!? That and Lionel Trains DS. My life is now complete. =D
1422580134
The Aaron
Pro
API Scripter
Brother Sharp said: I am wondering if in the future we will be able to edit parameters directly from the character sheet or tokens instead. What do you mean?
I do not know how other people manage their scenarios/campaigns, however in my case I create new scenarios by extending previous ones to carry over new macros or changes I made to the character sheet. When I do this, APIs don't carry over and I have to manually add them every time. I use different kinds of APIs like your IsGM and automatic turn tracker but adding all of them manually everytime I create something new is starting to become a hassle. I do not know if I am doing it wrong but the API seems to crash and do nothing sometimes, making it a bit unstable. That is why I try not to rely on APIs for major functions as they may delay the session should they crash, that is why I was wondering if some functions would be implemented without the need to run API every time OR have a way to store API scrips per account so I can quickly access and add stored ones to my scenarios.
1422586393
The Aaron
Pro
API Scripter
Ah. The Devs have mentioned the desire to automate installing scripts, step one of which is putting them in the new API Script Repo. In the interim, you can paste all the scripts in a single tab to make a single mega script, which will at least make it easier to copy and paste between campaigns.
The Aaron said: Ah. The Devs have mentioned the desire to automate installing scripts, step one of which is putting them in the new API Script Repo. In the interim, you can paste all the scripts in a single tab to make a single mega script, which will at least make it easier to copy and paste between campaigns. Interesting, I did not know you could merge them all together. Thanks again.
1422587716
The Aaron
Pro
API Scripter
Yup. I suggest you put some sort of marker between like this: // AMMO ////////////////////////////////////////////////////////////// That will make it easier to take out individual scripts later.
1422614559
Ziechael
Forum Champion
Sheet Author
API Scripter
Did you ever find time to implement the recovery/universal application updates to your Ammo script Aaron? I've had my beady little API grabbing eyes on that particular bad boy for a while now... and since my players have finally gotten ranged weapons again (i started my campaign with them being robbed Mwahahahaaaaaa!) it would be a great time to implement an ammo management script (would also be extremely useful for tracking spells too since i have a sorcerer, a druid and a bard... all very easy to track numerically :)
1422625523
The Aaron
Pro
API Scripter
I haven't. It's at about 50%. Life is busy. :(
1422631246
Ziechael
Forum Champion
Sheet Author
API Scripter
Hmm, an entire ideology shattered in one sentence... it turns out that Aaron, The Aaron, is human after all? I'm genuinely not sure how to process this...
1422631593
The Aaron
Pro
API Scripter
Hahahah... =D