Quote:
function attribSelect(winFrame, nAttrib)
local nodeWin = winFrame.getDatabaseNode();
Debug.chat("nodeWin:");
Debug.chat(nodeWin);
local nAttribute = nodeWin.createChild("attrib");
Debug.chat("nAttribute:");
Debug.chat(nAttribute);
local attrib = DB.getValue(nodeWin, nAttrib, 0);
Debug.chat("attrib:");
Debug.chat(attrib);
return true;
end
And the same thing for the disciplines.
Quote:
function discipSelect(winFrame, nDiscip)
local nodeWin = winFrame.getDatabaseNode();
Debug.chat("nodeWin:");
Debug.chat(nodeWin);
local nDiscipline = nodeWin.createChild("discip");
Debug.chat("nDiscipline:");
Debug.chat(nDiscipline);
local discip = DB.getValue(nodeWin, nDiscip, 0);
Debug.chat("discip:");
Debug.chat(discip);
return true;
end
What I would like to do now is whenever either function value changes, I want to add the two of them together together and pass them into a third field. For that I wrote this:
Quote:
function targetNumber(winFrame, attrib, discip)
local nodeWin = winFrame.getDatabaseNode();
Debug.chat("nodeWin:");
Debug.chat(nodeWin);
local att = nodeWin.getValue(nodeWin, attrib, 0);
local dis = nodeWin.getValue(nodeWin, discip, 0);
local TN = att + dis;
Debug.chat("TN:");
Debug.chat(TN);
DB.setValue(nodeWin, "rollable.targetroll", "number", TN);
end
Now, I don't know if I am even close to doing that right. Or how to then get the values from the two other functions into this function. I don't know if I need the second winNode command, or if it's just redundant.