frostbyte000jm
September 8th, 2020, 21:15
I was working on some dice last night and this was an issue I was running into. I am attaching an extension that works with MoreCore (it isn't specific to MoreCore it is just the easiest extension I could make to show my problem).
If you load the extension and make a roll from a character sheet of "/dice_mod" and "/dice_mod2" and look at the results in the console window you may see what is the problem.
What is happening?
My code on both of these dice are very simple.
/dice_mod
In performAction() I have a table "aRoll" in aRoll I have some numbers, strings, and booleans.
I then do a very simple for loop where I add dice to aRoll.aDice
I then do a Debug.console check and these are still numbers, booleans, and strings.
It then performs ActionsManager.performAction() and my onLanded() function does another Debug.console check.
What happens is when I do the console check after onLanded() the bools are empty, the numbers are strings, and the strings are fine.
/dice_mod2
This coded the same, the only difference is I do not load dice into aRoll.aDice.
My onLanded() does NOT lose the numbers and bools.
Now that I know this is a thing, I can easily work with it, but anyone know why this is a thing?
copy paste of test:
/dice_mod
Runtime Notice: s'*** performAction() ***'
Runtime Notice: s'draginfo: ' | nil | s' rActor: ' | { s'sType' = s'pc', s'sCreatureNode' = s'charsheet.id-00001', s'sCTNode' = s'combattracker.list.id-00001', s'sName' = s'Character Sheet' } | s' sParams:' | s' dice_mod'
Runtime Notice: s'*** End performAction() ***'
Runtime Notice: s'aRoll.nExplodeValue' | #0
Runtime Notice: s'aRoll.nCapHits' | #9999
Runtime Notice: s'aRoll.nGlitchValue' | #1
Runtime Notice: s'aRoll.bTest' | bFALSE
Runtime Notice: s'aRoll.bTest2' | bTRUE
Runtime Notice: s'aRoll.sStringTest' | s'I am a String'
Runtime Notice: s'*** onLanded(rSource, rTarget, rRoll) ***'
Runtime Notice: s'rRoll.nExplodeValue' | s'0'
Runtime Notice: s'rRoll.nCapHits' | s'9999'
Runtime Notice: s'rRoll.nGlitchValue' | s'1'
Runtime Notice: s'rRoll.bTest' | s''
Runtime Notice: s'rRoll.bTest2' | s''
Runtime Notice: s'rRoll.sStringTest' | s'I am a String'
/dice_mod2
Runtime Notice: s'*** performAction() ***'
Runtime Notice: s'draginfo: ' | nil | s' rActor: ' | { s'sType' = s'pc', s'sCreatureNode' = s'charsheet.id-00001', s'sCTNode' = s'combattracker.list.id-00001', s'sName' = s'Character Sheet' } | s' sParams:' | s' dice_mod2'
Runtime Notice: s'*** End performAction() ***'
Runtime Notice: s'aRoll.nExplodeValue' | #0
Runtime Notice: s'aRoll.nCapHits' | #9999
Runtime Notice: s'aRoll.nGlitchValue' | #1
Runtime Notice: s'aRoll.bTest' | bFALSE
Runtime Notice: s'aRoll.bTest2' | bTRUE
Runtime Notice: s'aRoll.sStringTest' | s'I am a String'
Runtime Notice: s'*** onLanded(rSource, rTarget, rRoll) ***'
Runtime Notice: s'rRoll.nExplodeValue' | #0
Runtime Notice: s'rRoll.nCapHits' | #9999
Runtime Notice: s'rRoll.nGlitchValue' | #1
Runtime Notice: s'rRoll.bTest' | bFALSE
Runtime Notice: s'rRoll.bTest2' | bTRUE
Runtime Notice: s'rRoll.sStringTest' | s'I am a String'
If you load the extension and make a roll from a character sheet of "/dice_mod" and "/dice_mod2" and look at the results in the console window you may see what is the problem.
What is happening?
My code on both of these dice are very simple.
/dice_mod
In performAction() I have a table "aRoll" in aRoll I have some numbers, strings, and booleans.
I then do a very simple for loop where I add dice to aRoll.aDice
I then do a Debug.console check and these are still numbers, booleans, and strings.
It then performs ActionsManager.performAction() and my onLanded() function does another Debug.console check.
What happens is when I do the console check after onLanded() the bools are empty, the numbers are strings, and the strings are fine.
/dice_mod2
This coded the same, the only difference is I do not load dice into aRoll.aDice.
My onLanded() does NOT lose the numbers and bools.
Now that I know this is a thing, I can easily work with it, but anyone know why this is a thing?
copy paste of test:
/dice_mod
Runtime Notice: s'*** performAction() ***'
Runtime Notice: s'draginfo: ' | nil | s' rActor: ' | { s'sType' = s'pc', s'sCreatureNode' = s'charsheet.id-00001', s'sCTNode' = s'combattracker.list.id-00001', s'sName' = s'Character Sheet' } | s' sParams:' | s' dice_mod'
Runtime Notice: s'*** End performAction() ***'
Runtime Notice: s'aRoll.nExplodeValue' | #0
Runtime Notice: s'aRoll.nCapHits' | #9999
Runtime Notice: s'aRoll.nGlitchValue' | #1
Runtime Notice: s'aRoll.bTest' | bFALSE
Runtime Notice: s'aRoll.bTest2' | bTRUE
Runtime Notice: s'aRoll.sStringTest' | s'I am a String'
Runtime Notice: s'*** onLanded(rSource, rTarget, rRoll) ***'
Runtime Notice: s'rRoll.nExplodeValue' | s'0'
Runtime Notice: s'rRoll.nCapHits' | s'9999'
Runtime Notice: s'rRoll.nGlitchValue' | s'1'
Runtime Notice: s'rRoll.bTest' | s''
Runtime Notice: s'rRoll.bTest2' | s''
Runtime Notice: s'rRoll.sStringTest' | s'I am a String'
/dice_mod2
Runtime Notice: s'*** performAction() ***'
Runtime Notice: s'draginfo: ' | nil | s' rActor: ' | { s'sType' = s'pc', s'sCreatureNode' = s'charsheet.id-00001', s'sCTNode' = s'combattracker.list.id-00001', s'sName' = s'Character Sheet' } | s' sParams:' | s' dice_mod2'
Runtime Notice: s'*** End performAction() ***'
Runtime Notice: s'aRoll.nExplodeValue' | #0
Runtime Notice: s'aRoll.nCapHits' | #9999
Runtime Notice: s'aRoll.nGlitchValue' | #1
Runtime Notice: s'aRoll.bTest' | bFALSE
Runtime Notice: s'aRoll.bTest2' | bTRUE
Runtime Notice: s'aRoll.sStringTest' | s'I am a String'
Runtime Notice: s'*** onLanded(rSource, rTarget, rRoll) ***'
Runtime Notice: s'rRoll.nExplodeValue' | #0
Runtime Notice: s'rRoll.nCapHits' | #9999
Runtime Notice: s'rRoll.nGlitchValue' | #1
Runtime Notice: s'rRoll.bTest' | bFALSE
Runtime Notice: s'rRoll.bTest2' | bTRUE
Runtime Notice: s'rRoll.sStringTest' | s'I am a String'