PDA

View Full Version : Help needed bringing custom data from roll into the results handlers



Valarian
August 10th, 2021, 10:43
I'm trying to add automation to the dice results for The One Ring 2nd edition. To this end, I've created a custom data object that I'm adding to the onDragStart dragdata object, and to the Comm.throwDice function call used for double-click rolling.

4863248633

The custom data holds the target number (TN) and condition information to process the results. This object doesn't seem to come through to the rRoll object in the results handler.

Is there any way to get custom data to go through to the results handler?

Valarian
August 10th, 2021, 11:05
For information, the custom data is to be used as follows:
customData.favoured = if set to true, adds an additional d12 to the dice pool. The higher of the two d12 values will be used in the results.
customData.illfavoured = if set to true, adds an additional d12 to the dice pool. The lower of the two d12 values will be used in the results.
customData.bonusdice = adds/removes a number of d6s in the dice pool. Results processed to total the d6s and to report number of 6s rolled.
customData.weary = if set to true, will ignore results of 1 to 3 on d6s
customData.miserable = if set to true, will report automatic Failure if an 11 (Eye of Sauron) result is recorded for the d12s
customData.wounded = no effect at the moment on rolls.
customData.tn = the target number to compare the final result against to report Success / Failure

Moon Wizard
August 10th, 2021, 20:59
The custom data in a drag object is actually a reference to a Lua variable; and that can't be passed through the roll mechanism and thus isn't handled by ActionsManager. I did set up ActionsManager to serialize any string/number variables in rRoll; so that they are available as strings in the rRoll in the result handler.

So, you'll need to apply the custom data from the drag object to the rRoll table as string or number variables before sending to ActionsManager; then you can pick up those variables in the result handler.

There's a very simple example in the ActionSkill script of 5E ruleset which attaches a target number to the roll when creating the roll, and reads that value in the result handler.

Regards,
JPG

Valarian
August 11th, 2021, 07:10
Thanks. I'll have a look there.