Bidmaron
March 9th, 2014, 03:20
In the Ruleset documentation in the website Library, there is the "Scripting" page with the "Accessing XML parameters from script" section, and it has the following XML class code:
local sStuff=nodeSource.getChildren();
for k,v in pairs(sStuff) do
--[[Debug.chat("key=",k,";value=",DB.getValue(v,""),";type=",DB.getType(v));]]
local newChild=newNode.createChild(k,DB.getType(v));
newChild.setValue(DB.getValue(v,""));
end
Then, in the explanation of the lua equivalent table, it has the following:
states = {
[1] = {
empty = {
[1] = {
icon = {
[1] = "emptyicon"
}
},
[2] = {
icon = {
[1] = "normalicon"
}
}
},
normal = {
}
}
}
flags = {
[1] = {
first = {
[1] = true;
}
},
[2] = {
second = {
[1] = true;
}
}
}
label = {
[1] = "Control label"
}
I think this is not correct and it instead should be:
states = {
[1] = {
empty = {
[1] = {
icon = {
[1] = "emptyicon"
}
},
[2] = {
normal = {
[1] = {
icon = {
[1] = "normalicon"
}
},
}
flags = {
[1] = {
first = {
[1] = true;
}
},
[2] = {
second = {
[1] = true;
}
}
}
label = {
[1] = "Control label"
}
The red text is the part I think is incorrect in the documentation.
local sStuff=nodeSource.getChildren();
for k,v in pairs(sStuff) do
--[[Debug.chat("key=",k,";value=",DB.getValue(v,""),";type=",DB.getType(v));]]
local newChild=newNode.createChild(k,DB.getType(v));
newChild.setValue(DB.getValue(v,""));
end
Then, in the explanation of the lua equivalent table, it has the following:
states = {
[1] = {
empty = {
[1] = {
icon = {
[1] = "emptyicon"
}
},
[2] = {
icon = {
[1] = "normalicon"
}
}
},
normal = {
}
}
}
flags = {
[1] = {
first = {
[1] = true;
}
},
[2] = {
second = {
[1] = true;
}
}
}
label = {
[1] = "Control label"
}
I think this is not correct and it instead should be:
states = {
[1] = {
empty = {
[1] = {
icon = {
[1] = "emptyicon"
}
},
[2] = {
normal = {
[1] = {
icon = {
[1] = "normalicon"
}
},
}
flags = {
[1] = {
first = {
[1] = true;
}
},
[2] = {
second = {
[1] = true;
}
}
}
label = {
[1] = "Control label"
}
The red text is the part I think is incorrect in the documentation.