PDA

View Full Version : Question about rRoll.aDice fields



darrenan
March 21st, 2022, 18:35
What is the difference between the 'result' and 'value' fields in a die result passed into the modRoll or onRoll handler? They seem to always have the same numeric value.

Context: There's a condition in the ruleset I'm working on that changes the highest die in a roll to a 1 (this is a count successes dice mechanic). Should my code change both 'result' and 'value' to 1, or is the answer to this question entirely dependent on the logic in my ruleset? Currently my code only looks at 'result' to determine overall results of the roll.

superteddy57
March 21st, 2022, 19:00
the result would be the die face that is rolled. So if I roll a d6 and a 5 comes up the result would be a 5. Some systems use custom d6 die and that 5 might mean a different value. Like say a rolled 5 equals a 2 instead. In majority of cases, the result and value are the same as the result rolled equals the value on the die face.

darrenan
March 21st, 2022, 19:19
Ok, sounds like I can just ignore it in my case then. Thanks.

Moon Wizard
March 25th, 2022, 06:19
If you look in the ActionsManager.total function that's used by many of the rulesets built on CoreRPG, it uses value, if available, and falls back to result. In the future, as I try to bring the new dice features slowly into CoreRPG, that specific implementation will become more important for different damage rolls. However, in many systems (such as D&D), it essentially should always be the same.

Regards,
JPG