Log in

View Full Version : Porting older rulesets to FGUnity ... Exploding dice doesn't sum properly.



Oberoten
October 6th, 2020, 16:16
39988

This worked straight of the bat for FGclassic, same code under FGUnity doesn't seem to add anything but the first rolled dice. How can I force the dice-list to take the updated exploding dice value before summing up the rolls?

(And maybe even get to quarter finished rolls as well for extreme circumstances?)

- Obe

Moon Wizard
October 6th, 2020, 21:20
If you're interpreting the roll results returned in the onDiceLanded callback, then feeding those into a call to add a chat message after performing some manipulations; then most likely you need to clear the "expr" field in the "dice" table. (i.e. dice.expr = nil) Dice rolls are actually full expressions in FGU with math operator support plus additional die mechanics; and that expression value is returned in the dice.expr field. If you clear it by setting to nil, it rebuilds a basic dice expression from the dice data provided. Also, make sure you change die.value as well as die.result.

Regards,
JPG

Oberoten
October 6th, 2020, 22:45
That worked beutifuly, thank you.

- Obe