Okay, for the first part, I'm just trying to get one of the fields to recalculate the target when it's updated.
Here's what I have in the function:
Here's what I have in one of the triggers:Code:function calculateAbilityMod(nodeChar, strMod, numCurrent)
local nResult =0;
if numCurrent < 10 then
nResult = math.ceil((nScore - 10) / 2);
elseif numCurrent > 10 then
nResult = math.floor((nScore - 10) / 2);
else
nResult = 0;
end
nodeChar.getChild(strMod).setValue(nResult);
return true;
end
Code:function onValueChanged()
--values passed> nodeChar, strMod, numCurrent
local nodeChar = window.getDatabaseNode();
local strMod = "numStrengthMod";
local numCurrent = nodeChar.getChild("numStrengthCurrent").getValue();
charManager.calculateAbilityMod(nodeChar, strMod, numCurrent);
end
I don't think I'm handling the strMod value properly... I need this value so the function knows which stat modifier to update...

