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

Dark Heresy 1st Ed - Ballistic Skill Test and Degrees of Sucess Macro Help

Hi everyone, new to Roll20 and I am trying to get things ready for my first Dark Heresy game that I will be GM'ing. I am currently in the process of trying to set up some basic macros and I am having trouble with one in particular.  I would like it to be a ballistic skill test that shows the degrees of success without having to do the math myself. It is currently working except I can't figure out how to divide the roll by 10 to show the degrees of success properly. For example right now it shows "So and so scored 44 degrees of success." Also if there is a way for it to show Success if it is a positive number and Failure if it is negative that would be awesome. Pretty new to the whole Java Scripting thing and I would greatly appreciate any help. Thank you! /e @{selected|character_name} Takes aim with the Autopistol and fires! Scoring [[-1*1d100-((@{Selected|BS}+?{Modifier|0})*-1)]] degree(s) of success!
1533162751

Edited 1533163255
GiGs
Pro
Sheet Author
API Scripter
If you wrap the calculation in the ceil() function (and add 1 to the result, to account for hits of exactly 0), and divide by 10 you should get what you need. This will show misses as negative degrees of success.  Try replacing your calculation with this one:  [[ceil( (@{Selected|BS}+?{Modifier|0} +1 -1d100)/10)]]  A fail by 1-10 will be reported as a degree 0, 11-20 = -1, 21-30 = -2, etc. A success by 0-9 will be reported as degree 1, 10-19 as degree 2. If you want success of 0-9 to have a degree of 0, and failure of 1-10 reported as -1, use this: [[ceil( (@{Selected|BS}+?{Modifier|0} +1 -1d100)/10) -1]]  Alternatively, if you are happy with success 0-9 reported as degree 1, and want all failures reported as 0, you can use the Keep Highest function, like so: [[{ceil( (@{Selected|BS}+?{Modifier|0} +1 -1d100)/10),0d0}kh1]]