SimObject and ScriptObject!!
by praju · in Torque Game Builder · 08/10/2010 (10:21 am) · 5 replies
Hi guys,
Can somebody please explain to me the difference between a scriptObject and a simObject????
Thanks in advance!!!
Can somebody please explain to me the difference between a scriptObject and a simObject????
Thanks in advance!!!
About the author
#2
Scripting-wise, ScriptObject and ScriptGroup originally (in TGE) were the only classes giving you access to the "class" and "superClass" mechanism but that has since been moved to SimObject--though in TGB classes need to explicitly enable it which in turn does not make it available for SimObject or SimGroup (which really doesn't make a lot of sense). Other than that, the classes only differ by ScriptObject and ScriptGroup exposing "onAdd" and "onRemove" callbacks which SimObject and SimGroup don't have.
08/10/2010 (6:04 pm)
Scripting-wise, ScriptObject and ScriptGroup originally (in TGE) were the only classes giving you access to the "class" and "superClass" mechanism but that has since been moved to SimObject--though in TGB classes need to explicitly enable it which in turn does not make it available for SimObject or SimGroup (which really doesn't make a lot of sense). Other than that, the classes only differ by ScriptObject and ScriptGroup exposing "onAdd" and "onRemove" callbacks which SimObject and SimGroup don't have.
#3
@Rene : I did not understand ScriptGroup. Is it a group of ScriptObjects??
08/11/2010 (4:00 am)
Thanks guys!! @Rene : I did not understand ScriptGroup. Is it a group of ScriptObjects??
#4
It's doing the same as ScriptObject except with SimGroup instead of SimObject as the parent class.
SimGroup is a SimObject that contains and owns a set of SimObjects.
08/11/2010 (4:05 am)
It's doing the same as ScriptObject except with SimGroup instead of SimObject as the parent class.
SimGroup is a SimObject that contains and owns a set of SimObjects.
#5
08/11/2010 (5:30 am)
Oh ok!! thanks Rene!!
Associate William Lee Sims
Machine Code Games
ScriptObject
The short of it:
Virtually everything you'll see in Torque is a SimObject. It has all of the common features that are needed to create, refer to, destroy, organize, and schedule objects.
A ScriptObject is a SimObject that allows you to create simple classes and objects within the scripting language without having to write a full-up class in C++.