Log in

View Full Version : Counting Success



Valarian
May 3rd, 2007, 12:55
Is there any way to count the number of successes (over a difficulty number).

For example: roll 4d10 against a difficulty of 6
rolled 4,5,7,2 = 1
rolled 5,6,8,3 = 2
rolled 4,5,3,2 = 0

Ideally, I then want to subtract a success for any ones rolled.
For example: roll 4d10 against a difficulty of 6
rolled 4,5,7,1 = 0
rolled 5,6,8,1 = 1
rolled 4,5,3,1 = -1

No prizes for guessing the ruleset.

Goblin-King
May 3rd, 2007, 13:57
In the chatwindow.onDiceLanded function, go through the result table (dragdata.getDieList) and compare results to your target number. One way to report the result might be to return true from the function (disabling default processing), and before that create a chat message with only the number indicating the number of successes. The full attack handling in d20 does a similar thing, technically.

Depending on the rules, you might need to add a difficulty number control similar to the modifier stack somewhere.

Valarian
May 3rd, 2007, 14:39
Thanks for this, I'll have to really try and get the time to look in to the new functionality. Is there a way to override the current totalling functionality, so that successes are reported instead of the total? Or is this what is in the onDiceLanded function.