Game Development Community

SimObject vs. ScriptObject

by Chaim Krause · in Torque Game Builder · 11/04/2007 (9:14 am) · 5 replies

I see ScriptObjects being used in example code, but I cannot determine why it was chosen to use a ScriptObject over a SimObject. Can somebody explain why I would want to create a ScriptObject instead of SimObject?

#1
11/04/2007 (11:41 am)
I could be wrong, but I think it is because other scene objects are derived from SimObjects, which means an actual object is placed in the scene. However, script objects are just created and do not appear in the scene.

Though, I'm not 100% sure.
#2
11/05/2007 (8:00 am)
Philip is correct, scriptobjects can be added to simsets / simgroups and be assigned dynamic fields like a simobject but they do not have a position, scenegraph, etc... They can be useful for representing data in script.
#3
11/05/2007 (9:52 am)
So ScriptObjects have less overhead as SimObjects? Use less resources? IOW what do I gain by using a ScriptObject over a SimObject? I understand from a methodology perspective why you would use one over the other, but is that the sole reason?
#4
11/05/2007 (10:43 am)
The only difference from a script point of view is that ScriptObject supports namespace linkage setup in script through the class / superClass fields while SimObject doesnt. Thus, if you need script classes, you have to use ScriptObject. If you don't, it doesn't matter which you use. SimObject will be a tiny bit lighter, but that difference is negligible.

Neither of them can be placed in the scene, you need something derived from t2dSceneObject for that. But, that wasn't part of the initial question ;-)

T.
#5
11/05/2007 (11:04 am)
That's just the info I needed Tom. Thank you.