PDA

View Full Version : Ruleset Documentation Error?



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.

Moon Wizard
March 11th, 2014, 02:42
Fixed.
JPG

Bidmaron
March 11th, 2014, 03:06
Thanks, JPG. I thought I might have had a gross conceptual error.

Question: I see </nohide > at places in the rulesets, but I can't find what that means anywhere. I've looked in all the inheritance chains (the place I last saw it was in a string field inherited tag.)

Moon Wizard
March 11th, 2014, 04:12
It might be a tag used by a template script.

Regards,
JPG

Bidmaron
March 11th, 2014, 04:37
Ah, didn't look in the template hierarchy. Thanks, JPG.