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] Character sheet integrated Ammo tracking

Okay so I am looking for someone that would be able to write or modify one of the ammo tracking scripts to integrate within my Custom character sheet, and hopefully I'm posting this in the right spot. I am using a modified version of the Star Wars Saga Edition character sheet and would like to add some api functionality to my version to track ammo and weapon mode. I can provide the code for my character sheet upon request as well as a flowchart of what I am wanting to accomplish. Basically I want to be able to create some kind of macro that on activation it checks the weapons attribute first if it is ranged or melee, then if ranged notifies the player with with the current amount of ammo remaining and what the current weapon setting is, next ask if they want to switch modes (single shot or autofire) then verifies there is enough ammo left to make the shot if not then prompt for reload. If they choose to reload it removes a power pack from the inventory's power pack quantity attribute or tells the player they are out of power packs and can't reload. I have setup attributes in the sheet for weapon type (melee/ranged), weapon mode (single shot, autofire, stun), and an inventory slot specific to power packs with a quantity attribute. So I am pretty sure I have the attributes I need in the sheet just have no idea how to write the javascript to do all this, I'm competent with the HTML/CSS but not so much with the API when it comes to starting from scratch or potentially major rewrites of existing code. Thank you
1430975539
The Aaron
Pro
API Scripter
crap.. I typed a response to this... but too much wine... didn't post it before I left the page... I'll see if I can recreate it... So, here is what you're after? Activate Weapon Informs user of ammo Informs user of current Rate of Fire Prompts user for Change to rate of fire Prompts user if current rate of fire exceeds current ammo to reload deducts from attribute counting power packs or Fails if no power packs Prompts the user to fire Deducts ammo from current load That sound about right?
1430987137

Edited 1430987174
Basically yes, I have a couple more steps and paths in it. If on Autofire but insufficient ammo (less than 10 rounds left) it prompts to either reload (which is more action intensive; Move and swift action) or switch to single shot rate of fire (just a swift action). If the user reloads proceed as you have mapped Prompts user if current rate of fire exceeds current ammo to reload deducts from attribute counting power packs or Fails if no power packs If they switch modes to single prompts for the attack roll and deducts 1 round from current ammo. If the weapon is on autofire but does not need to reload then prompts for the attack roll and deducts 10 rounds from current ammo. I do have another stage here before the prompt for the attack roll that would be optional but nice to have where if the user didn't select to change modes at the start it asks if they wish to Brace the weapon, if yes then the attack roll has a -2 penalty applied, if they don't brace it (either because they had to switch modes earlier, don't want to or the option is not available to that gun) the attack has a -5 penalty applied to it. Then it proceeds with the attack roll and ammo deduction. My Flowchart (it was done in visio saved as pdf) if that will be of assistance and not overly confusing :) And thank you for the reply!