Game Development Community

how do i add my sprites to a Simset

by hbomega · in Torque 2D Beginner · 12/06/2013 (6:57 pm) · 5 replies

i made my enemies sprite objects and used SceneGroup to group them realized Simset would be more appropriate but dont know if i have to change it from a sprite object or if i can jus add them to a simset and if i can jus add them to simset how do i go about it please help

#1
12/06/2013 (10:03 pm)
You can add any type of SimObject to a Simset.

Adding objects to a SimSet is as simple as can be

new Simset(MySimSet);

%sprite_object = new Sprite();

MySimSet.add(%sprite_object);

You can find all SimSet-related Script functions here
#2
12/08/2013 (4:34 am)
and how would i go about testing it example i teted the SceneGroup like:

if (sceneobject.getSceneGroup() == 4)

how would i do thisd with Simset

ps. It's great to hear from you Simon :-)
#3
12/08/2013 (5:16 am)
if(MySimSet.isMember(%sprite_object))

I highly recommend reading through the SimSet_ScriptBinding.h file that Simon linked in his post, there are many practical examples documented in that file which show how to use SimSets, it's not just code in there.
#4
12/08/2013 (5:47 am)
thanks and i did
#5
12/08/2013 (6:13 am)
i tried an got this in my log file " SimSet::isMember: is not an object "

i am testing for collision i have different enemies in different simset and would like to check which simset the collided object is from an react to suit then i would like to add all my simsets to one simset to check if all enemies are dead