Author Topic: What's the difference between a ScriptGroup and a SimGroup?  (Read 1006 times)

I just discovered the ScriptGroup object on the RTB XMLParser.

I'd also like to know the difference between ScriptObject and SimObject

can i get a list of all these goddamn script* and sim* thingies

can i get a list of all these goddamn script* and sim* thingies
dumpConsoleClasses();

All objects are Sim objects and all groups are Sim groups.  Script objects and script groups are just a specific type of them.

For example, creating a new function starting with Simobject:: will make that function available for all objects in the engine.

The ScriptGroup/ScriptObject classes inherit from the SimGroup/SimObject classes but have onAdd/onRemove callbacks and have "class" and "superClass" internal variables.

Appendix A
Quote
class - A new namespace to place after the object's name and before ScriptObject in the namespace chain.
superClass - A new namespace to place after class and before ScriptObject in the namespace chain.

Some other example
Code: [Select]
new ScriptObject(MyObject) {
class = Bar;
superClass = Foo;
};

function Bar::doSomething(%this)
{
echo("Hi!");
}

This only works with a ScriptObject and not a SimObject. After trying this you seem to have to set the class when creating the object. (setting the variable afterwards doesn't affect which calls are done, which would have been helpful for some dynamic changing behaviour)

The only other Sim___ one I know about is SimSet, which is used like a SimGroup (can loop through it, get count, etc.) except objects can exist in any number of SimSets and only one SimGroup.
« Last Edit: August 05, 2012, 01:45:10 PM by Space Guy »

I swear we had a topic about this before

I swear we had a topic about this before
my topic on the difference between simsets and simgroups.

different slightly.

Port told me that a ScriptGroup is just a SimGroup with onAdd, onRemove, class, and superClass.

Port told me that a ScriptGroup is just a SimGroup with onAdd, onRemove, class, and superClass.
That sounds right, pretty much sums up space guy's post.