SimObject AutoDelete Flag
by Demolishun · in Torque 3D Professional · 04/14/2012 (4:21 pm) · 0 replies
I am exploring the idea of temporary simobjects for holding external objects. I want to be able to create simobjects on the fly. However, when they are no longer referenced in code I want the temporary simobjects to go away.
Here is an example of what I am talking about:
Here is an example of what I am talking about:
$object = new extScriptObject();
function manipobject(%object){
// assume attribute returns extScriptObject with AutoDelete flag set
%tmp = $object.attribute;
%tmp.print(); // do something
}
manipobject($object);
// lets say that %tmp inside the function was actually object id = 4200
// if %tmp is out of scope at this point then 4200 should have been deleted
4200.print(); // this call should failSo, when the object created on the fly in the function goes out of scope and it has the AutoDelete flag set, does the console implement SimObjectPtr to facilitate the auto delete feature of the SimObject? Do local scope variables implement the SimObjectPtr internally?About the author
I love programming, I love programming things that go click, whirr, boom. For organized T3D Links visit: http://demolishun.com/?page_id=67