After loading "tunnels.sbx" into a simple program it is my job to then recreate lights in the engine.
Running the following code:
DrawText(0,0,"%s",(str)GetEntityKey(scene,"class"));
int i;
for(i=1;i<=CountChildren(scene);i++)
{
DrawText(0,15+(i*15),"%s",(str)GetEntityKey(GetChild(scene,i),"class"));
}
This shows me that the scene loads in as a Pivot entity and all of the other 62 entities created in the Leadwerks editor load in as Models. This means that I am unable to simply create lights in the engine that correspond to the lights created in the Leadwerks editor.
I noticed that in the Leadwerks editor entities can’t share the same key (name). This meant that even if I created the scene from scratch with the above problem in mind using:
GetEntityKey(entity, “name");
Was an inefficient process.
Upon opening the "tunnels.sbx" file in a text editor the problem became apparent. All entities created in the Leadwerks editor were saved as models, even light entities loaded in an invisible sphere model but more importantly all entities had their class set to "model" regardless of what their actual class was.
Based off this information I have some questions and invite discussion:
Why does the editor load in invisible spherical objects for entities?
When saving the .SBX file why not save lights or for that matter any entity as their actual type? Or even step down and just save their class property as their actual class?
Should this loss of data be addressed or am I missing something myself? (Quite probable)