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

Need some help with combat automation

I'm looking to write three scripts, they can be macros or API. I checked in the macro forum and this seems to be an API area. 1) All characters (PCs or NPCs) have an attack value with a dice roll and a static defence value. I'm having a little trouble getting the system to roll the attack for a targeted character, check the attack against the defence and display (Hit, Miss, Fumble, Critical). A 1 being a fumble and a 10 being a critical. I don't want the player to know how close to hit or miss they were, since that gives away the defence of the enemy. 2) If an attack hits roll for damage (that's easy enough) but also apply -2 points to the Armor value of the character that got hit per attack it protects against. I figure I can put the armor value as a bar on the token, but not sure how I can get it to go down or up. This might be something I have to do manually as DM. 3) An ammo counter, most of the attacks in the game will be using ranged weapons, I need to have a counter for how much ammo is left in the magazine for the weapon, if possible to have this effect another value holding the amount of ammo being carried. I"m learning a lot reading these forums, and you are some of the most helpful people out there. I'd be very grateful if someone could help me with this.
Currently I can roll attack but it doesn't check any other values, so I have to manually check the defence values. Not ideal but if it has to be done then so be it, I think other systems have combat automation so it shouldn't be totally impossible.
1390900014
Alex L.
Pro
Sheet Author
Ok this is what I get as your requirements please correct me if I am wrong. D10 System: Attack value = 1d10+Mods One single defence for all attacks. A 1 on the d10 is a fumble and the DM need to be alerted to this. All attacks deduct 2 from the defence of the target. Damage is some sort of roll depending on the weapon. Ammo, HP, and defence can all be on bars.
That's exactly right Alex, I'd appreciate any help you can give me. Though only deduct 2 from armor if an attack hits.
1390903133
Alex L.
Pro
Sheet Author
What happens on a crit?
just flag it up as a crit, no exploding dice
1390905382
Alex L.
Pro
Sheet Author
Here we go Tested and working, if you look at the top you can set what bar is for what. Same install instructions as my other combat script . <a href="https://gist.github.com/pigalot/8665369" rel="nofollow">https://gist.github.com/pigalot/8665369</a>
Alex you are a genius. Will go test this out. I appreciate your help.
I think I have it installed, but how do I call that script
1391062842
Alex L.
Pro
Sheet Author
!power @{selected|token_id} @{target|token_id} [[1d10]] [[1d8]] 2 First roll is attack, second is damage and the number after is ammo.
Thanks Alex. Will test this out.
I must be doing something wrong. I Add the script, check it's enabled. Open the testbed campaign to mess around . I have to click which is the attacking token, click the macro button to run the script, click the target. Nothing. No error message, no dice roll, no bar changes. I tried this script also honey badgers alter attrib that makes the pop up window appear, I enter numbers and nothing happens. Maybe I don't have the token set up right.
Cannot call method 'on' of undefined is now appearing when I try to run this.
1393515948
Alex L.
Pro
Sheet Author
Steven B. said: Cannot call method 'on' of undefined is now appearing when I try to run this. you are missing apicmd
and if I put back apicmd and add any other scripts they fail
ok, deleted all scripts, added apicmd and this one. No response from the API when called.
aha, copied out the text and had another look, I was copying an extra character somewhere. When I dumped it into notepad and removed any strange ASCII characters it worked. Awesome job.
This script seems like a very good idea, although it would be of no use for the Pathfinder system I use, but could it be modified to simply report a Crit based on the attacking weapon's crit range, reporting Fumble (natural 1), Miss (missed Target's AC), Hit (normal hit), and Threatened Crit (within attacking weapon's crit range)...