Hi guys! I have a little problem.
I have a model and want to add custom properties to it. Here is LUA file for it
require("scripts/class")
local class=CreateClass(...)
function class:InitDialog(grid)
self.super:InitDialog(grid)
group=grid:AddGroup("Box01")
group:AddProperty("hitpoints",PROPERTY_INTEGER,"","hitpoints")
group:AddProperty("type",PROPERTY_INTEGER,"","type")
group:AddProperty("Param7",PROPERTY_FLOAT,"","Param7")
group:AddProperty("Param8",PROPERTY_BOOL,"false","Param8")
group:AddProperty( "BColor", PROPERTY_COLOR, "1" )
group:AddProperty("Param10",PROPERTY_STRING,"","Param10")
group:AddProperty("Param11",PROPERTY_FLOAT,"","Param11")
end
properies window looks like this:
All values are zero.
So if I save this map with this object and DONT EDIT any of my custom properties of the object, then in sbx file this properties are absent!
Here sbx file:
SBX_ASCII_1.0
cameraposition=0.000000000,5.73576403,-8.19152069
camerarotation=34.9999962,0.000000000,0.000000000
Model {
path="light_directional.gmf"
position=0.000000000,1.00000000,0.000000000
rotation=45.0000000,34.9999962,3.01372808e-007
scale=1.00000000,1.00000000,1.00000000
id=141729016
"aligntoground"="0"
"class"="Model"
"collisiontype"="0"
"damping"="0.000000000,0.000000000"
"friction"="0.000000000,0.000000000"
"gravity"="0"
"intensity"="1.0000000000000000"
"linearoffset"="0.310000002,0.400000006,0.699999988"
"mass"="0.00000000000000000"
"name"="light_directional_1"
"order"="0"
"range"="500.00000000000000"
"resolution"="2"
"shadowdistance"="6.00000000,20.0000000,100.000000"
}
Model {
path="luatest_box.gmf"
position=1.00000000,0.000000000,-1.00000000
rotation=0.000000000,0.000000000,0.000000000
scale=1.00000000,1.00000000,1.00000000
id=144936072
"class"="Model"
"intensity"="1.0"
"name"="box_2"
}
But if I edit them (at least one of them) then all this properties are present in sbx map file.
So the question is why does that happen? and
Can I somehow set initial values of custom properties?
Thanks in advanced.
PS
I need it for my 3ds max exporter. It will be possible to set properties for models in 3ds max and then automatically have them in the editor!