PDA

View Full Version : Retrieving the last dice rolls



MadBeardMan
January 9th, 2019, 01:18
Folks,

Asking a wild question here.

Using script, is it possible to fetch the last dice roll results a player made?

If it's not currently possible, are there any ideas about how I might 'save' a roll result.

I *have* thought about using a character/NPC's sheet and saving it there and thus I can use the DB, or better, save against the campaign data?

Any thoughts, I'm off to the land of sleep, oh dear, gotta be up for work in 6 hours.

Cheers!

damned
January 9th, 2019, 01:49
You are going to have to save it as a variable or save it into a new database field.
If this is to add damage bonus to your next roll send the value direct to the modifier stack instead.

Trenloe
January 9th, 2019, 01:59
You'd need the rRoll table, which is not stored anywhere after the roll completes - it's passed as an argument throughout the action process.

Maybe have a script package that you can call to store it there - if it is needed outside of the individual client, then use OOB messaging from the player's side to the GM side, which stores the last rRoll table for each player. Or maybe have it as a file level variable in the relevant action script packages, which would store it at each client script - with OOB messaging functions so the GM can access the relevant variables (if it is needed at the GM level, if not it's easy to get within the same client global package). This second option would allow you to potentially get the last roll for each action type.

The main gotcha with the OOB messaging side is that I've had issues in the past trying to pass a LUA table within the msgOOB table. But I didn't investigate it too deeply as I just split out the variables with the table I needed. So you may have to split out what you need from rRoll to return in the msgOOB table.