drahkar
September 2nd, 2010, 09:44
Ok. I finally admit it. I'm a little stumped. Can someone look over the following code and let me know why the setValue() call in it isn't actually setting any data to the node?
function setdiepool( prcQscore, statName)
print("prcQscore: " .. prcQscore);
print("statName: " ..statName);
local highDieCountsource = window.getDatabaseNode().createChild("qualities." .. statName .. ".diepool.high.count");
local highDieTypesource = window.getDatabaseNode().createChild("qualities." .. statName .. ".diepool.high.type");
local lowDieCountsource = window.getDatabaseNode().createChild("qualities." .. statName .. ".diepool.low.count");
local lowDieTypesource = window.getDatabaseNode().createChild("qualities." .. statName .. ".diepool.low.type");
print("highDieCountsource NodeName outside if scope: " .. highDieCountsource.getNodeName());
print("highDieTypesource NodeName outside if scope: " .. highDieTypesource.getNodeName());
if prcQscore>0 then
while not diepoolref[prcQscore] do
prcQscore = prcQscore - 1;
end
print("Post While prcQscore: " .. prcQscore);
if diepoolref[prcQscore] then
if diepoolref[prcQscore]["highpool"] then
print("Highpool Processing");
if diepoolref[prcQscore]["highpool"]["count"] then
print("Diepool High Count: " .. diepoolref[prcQscore]["highpool"]["count"]);
print("Diepool High Typet: " .. diepoolref[prcQscore]["highpool"]["die"]);
print("highDieCountsource NodeName inside if scope: " .. highDieCountsource.getNodeName());
print("highDieTypesource NodeName inside if scope: " .. highDieTypesource.getNodeName());
highDieCountsource.setValue(diepoolref[prcQscore]["highpool"]["count"]);
highDieTypesource.setValue(diepoolref[prcQscore]["highpool"]["die"]);
print("highDieCountsource value inside if scope: " .. highDieCountsource.getValue());
print("highDieTypesource value inside if scope: " .. highDieTypesource.getValue());
else
print("-");
highDieCountsource.setValue("-");
highDieCountsource.setValue("-");
end
end
print("prcQscore: " .. prcQscore);
if diepoolref[prcQscore]["lowpool"] then
print("Lowpool Processing");
if diepoolref[prcQscore]["lowpool"]["count"] then
print("Diepool Low Count: " .. diepoolref[prcQscore]["lowpool"]["count"]);
print("Diepool Low Typet: " .. diepoolref[prcQscore]["lowpool"]["die"]);
print("lowDieCountsource NodeName inside if scope: " .. lowDieCountsource.getNodeName());
print("lowDieTypesource NodeName inside if scope: " .. lowDieTypesource.getNodeName());
lowDieCountsource.setValue(diepoolref[prcQscore]["lowpool"]["count"]);
lowDieTypesource.setValue(diepoolref[prcQscore]["lowpool"]["die"])
print("lowDieCountsource value inside if scope: " .. lowDieCountsource.getValue());
print("lowDieTypesource value inside if scope: " .. lowDieTypesource.getValue());
else
print("-");
lowDieCountsource.setValue("-");
lowDieCountsource.setValue("-");
end
end
end
end
end
The diepoolref table is defined later in the file and has been confirmed that its pulling all the data correctly.
function setdiepool( prcQscore, statName)
print("prcQscore: " .. prcQscore);
print("statName: " ..statName);
local highDieCountsource = window.getDatabaseNode().createChild("qualities." .. statName .. ".diepool.high.count");
local highDieTypesource = window.getDatabaseNode().createChild("qualities." .. statName .. ".diepool.high.type");
local lowDieCountsource = window.getDatabaseNode().createChild("qualities." .. statName .. ".diepool.low.count");
local lowDieTypesource = window.getDatabaseNode().createChild("qualities." .. statName .. ".diepool.low.type");
print("highDieCountsource NodeName outside if scope: " .. highDieCountsource.getNodeName());
print("highDieTypesource NodeName outside if scope: " .. highDieTypesource.getNodeName());
if prcQscore>0 then
while not diepoolref[prcQscore] do
prcQscore = prcQscore - 1;
end
print("Post While prcQscore: " .. prcQscore);
if diepoolref[prcQscore] then
if diepoolref[prcQscore]["highpool"] then
print("Highpool Processing");
if diepoolref[prcQscore]["highpool"]["count"] then
print("Diepool High Count: " .. diepoolref[prcQscore]["highpool"]["count"]);
print("Diepool High Typet: " .. diepoolref[prcQscore]["highpool"]["die"]);
print("highDieCountsource NodeName inside if scope: " .. highDieCountsource.getNodeName());
print("highDieTypesource NodeName inside if scope: " .. highDieTypesource.getNodeName());
highDieCountsource.setValue(diepoolref[prcQscore]["highpool"]["count"]);
highDieTypesource.setValue(diepoolref[prcQscore]["highpool"]["die"]);
print("highDieCountsource value inside if scope: " .. highDieCountsource.getValue());
print("highDieTypesource value inside if scope: " .. highDieTypesource.getValue());
else
print("-");
highDieCountsource.setValue("-");
highDieCountsource.setValue("-");
end
end
print("prcQscore: " .. prcQscore);
if diepoolref[prcQscore]["lowpool"] then
print("Lowpool Processing");
if diepoolref[prcQscore]["lowpool"]["count"] then
print("Diepool Low Count: " .. diepoolref[prcQscore]["lowpool"]["count"]);
print("Diepool Low Typet: " .. diepoolref[prcQscore]["lowpool"]["die"]);
print("lowDieCountsource NodeName inside if scope: " .. lowDieCountsource.getNodeName());
print("lowDieTypesource NodeName inside if scope: " .. lowDieTypesource.getNodeName());
lowDieCountsource.setValue(diepoolref[prcQscore]["lowpool"]["count"]);
lowDieTypesource.setValue(diepoolref[prcQscore]["lowpool"]["die"])
print("lowDieCountsource value inside if scope: " .. lowDieCountsource.getValue());
print("lowDieTypesource value inside if scope: " .. lowDieTypesource.getValue());
else
print("-");
lowDieCountsource.setValue("-");
lowDieCountsource.setValue("-");
end
end
end
end
end
The diepoolref table is defined later in the file and has been confirmed that its pulling all the data correctly.