Objects losing properties
by David Horn · in Torque Game Engine · 02/01/2008 (6:37 am) · 4 replies
Here's my problem,
I'm loading a character select mission (charselect.mis) where the user selects from a series of fighters and also selects their skin (using the setSkinName resource)
I end up creating objects with properties. I'm uising a SimObject because it seems that these are the most generic of objects.
So I end up with something like...
$w1 = new SimObject();
$w1.bodyshape = "blah/blah/blah/tall_template.dts";
$w1.skin = "fighter2";
then I do the same this with a $w2;
Then what I want to do is load the fighting arena, and dynamically generate 2 AIPlayers using these settings. The problem is that when I load a new mission, the properties of these 2 SimObjects are erased. I've tracked it down to the disconnect() function.
So 1 of 2 things I'm guessing.
*Can I load another mission another way that doesnt destroy simobject properties?
*Is there some type of global general object that I can use simply to add and store properties (almost like a struct) so that would span across multiple missions?
I'm loading a character select mission (charselect.mis) where the user selects from a series of fighters and also selects their skin (using the setSkinName resource)
I end up creating objects with properties. I'm uising a SimObject because it seems that these are the most generic of objects.
So I end up with something like...
$w1 = new SimObject();
$w1.bodyshape = "blah/blah/blah/tall_template.dts";
$w1.skin = "fighter2";
then I do the same this with a $w2;
Then what I want to do is load the fighting arena, and dynamically generate 2 AIPlayers using these settings. The problem is that when I load a new mission, the properties of these 2 SimObjects are erased. I've tracked it down to the disconnect() function.
So 1 of 2 things I'm guessing.
*Can I load another mission another way that doesnt destroy simobject properties?
*Is there some type of global general object that I can use simply to add and store properties (almost like a struct) so that would span across multiple missions?
About the author
#2
Right now, I have a gui on top of the mission that call functions in the main.cs file.
Should I move those functions?
02/01/2008 (8:47 am)
Is that just the placement of the code?Right now, I have a gui on top of the mission that call functions in the main.cs file.
Should I move those functions?
#3
02/01/2008 (11:51 am)
Yes. You most likely need to put the functions on the server and use the functionality that allows you to call server functions from client to set the values.
#4
02/04/2008 (5:53 am)
Great - thank you
Torque 3D Owner Marc Dreamora Schaerer
Gayasoft