Brenn
June 4th, 2015, 10:15
I'm having issues with the following code:
function onInit()
ActionsManager.registerModHandler("dice", modRoll);
ActionsManager.registerResultHandler("dice", onRoll);
end
function modRoll(rSource, rTarget, rRoll)
Debug.chat("ModRoll");
end
function onRoll(rSource, rTarget, rRoll)
Debug.chat("onRoll");
end
I get the onRoll in chat when I throw a die from the desktop, however I do not get the ModRoll.
Any clues?
I've gone so far as to run a modded version of core with the following changes in manager_actions:
function applyModifiers(rSource, rTarget, rRoll, bSkipModStack)
Debug.chat("Apply Modifiers");
local bAddModStack = (#(rRoll.aDice) > 0);
if bSkipModStack then
bAddModStack = false;
elseif GameSystem.actions[rRoll.sType] then
bAddModStack = GameSystem.actions[rRoll.sType].bUseModStack;
end
Debug.chat("RollType: ",rRoll.sType);
local fMod = aModHandlers[rRoll.sType];
if fMod then
fMod(rSource, rTarget, rRoll);
end
...
end
I get the "RollType: | dice" in chat when I throw a die from the desktop, which means that fMod should equal aModHandlers["dice"], right? And I registered it in my other code so it should be there... however it never does fire. I'm baffled.
function onInit()
ActionsManager.registerModHandler("dice", modRoll);
ActionsManager.registerResultHandler("dice", onRoll);
end
function modRoll(rSource, rTarget, rRoll)
Debug.chat("ModRoll");
end
function onRoll(rSource, rTarget, rRoll)
Debug.chat("onRoll");
end
I get the onRoll in chat when I throw a die from the desktop, however I do not get the ModRoll.
Any clues?
I've gone so far as to run a modded version of core with the following changes in manager_actions:
function applyModifiers(rSource, rTarget, rRoll, bSkipModStack)
Debug.chat("Apply Modifiers");
local bAddModStack = (#(rRoll.aDice) > 0);
if bSkipModStack then
bAddModStack = false;
elseif GameSystem.actions[rRoll.sType] then
bAddModStack = GameSystem.actions[rRoll.sType].bUseModStack;
end
Debug.chat("RollType: ",rRoll.sType);
local fMod = aModHandlers[rRoll.sType];
if fMod then
fMod(rSource, rTarget, rRoll);
end
...
end
I get the "RollType: | dice" in chat when I throw a die from the desktop, which means that fMod should equal aModHandlers["dice"], right? And I registered it in my other code so it should be there... however it never does fire. I'm baffled.