Grimmbart
April 9th, 2019, 16:22
Hi everybody
I'm using the 3.5E (latest version) rule set for a custom ruleset and I need to send custom data when the player rolls a die.
In the "buildThrow (...)" function, I think it's a good place to insert custom data. But after, in the function "onDiceLanded (draginfo)", no way to find them!
In the function "buildThrow (...)", I add my data in the following way (in 2 different places!?):
local rThrow = {};
rThrow.type = rRoll.sType;
rThrow.description = rRoll.sDesc;
rThrow.secret = rRoll.bSecret;
rThrow.customData = rRoll.aCustomData;
...
local rSlot = {};
rSlot.number = rRoll.nMod;
rSlot.dice = rRoll.aDice;
rSlot.metadata = rRoll;
rSlot.customData = rRoll.aCustomData;
rThrow.slots = { rSlot };
return rThrow;
After that, in the "onDiceLanded (draginfo)" function, I can not find my information :
function onDiceLanded(draginfo)
local sDragType = draginfo.getType();
draginfo.setSlot(1);
local vRoll = draginfo.getMetaDataList();
vRoll.sDesc = draginfo.getStringData();
vRoll.aCustomData = draginfo.getCustomData();
Debug.console ("onDiceLanded-decodeActionFromDrag vRoll.sDesc: " .. vRoll.sDesc); OK
Debug.console ("onDiceLanded-decodeActionFromDrag vRoll.aCustomData: " .. vRoll.aCustomData); NIL Value !!
...
Any idea ?
I'm using the 3.5E (latest version) rule set for a custom ruleset and I need to send custom data when the player rolls a die.
In the "buildThrow (...)" function, I think it's a good place to insert custom data. But after, in the function "onDiceLanded (draginfo)", no way to find them!
In the function "buildThrow (...)", I add my data in the following way (in 2 different places!?):
local rThrow = {};
rThrow.type = rRoll.sType;
rThrow.description = rRoll.sDesc;
rThrow.secret = rRoll.bSecret;
rThrow.customData = rRoll.aCustomData;
...
local rSlot = {};
rSlot.number = rRoll.nMod;
rSlot.dice = rRoll.aDice;
rSlot.metadata = rRoll;
rSlot.customData = rRoll.aCustomData;
rThrow.slots = { rSlot };
return rThrow;
After that, in the "onDiceLanded (draginfo)" function, I can not find my information :
function onDiceLanded(draginfo)
local sDragType = draginfo.getType();
draginfo.setSlot(1);
local vRoll = draginfo.getMetaDataList();
vRoll.sDesc = draginfo.getStringData();
vRoll.aCustomData = draginfo.getCustomData();
Debug.console ("onDiceLanded-decodeActionFromDrag vRoll.sDesc: " .. vRoll.sDesc); OK
Debug.console ("onDiceLanded-decodeActionFromDrag vRoll.aCustomData: " .. vRoll.aCustomData); NIL Value !!
...
Any idea ?