Page 1 of 1

Grouping actors

PostPosted: Mon Jan 19, 2015 12:14 pm
by lverona
Hey everyone!

From what I understand right now, there is no way to group actors. Here's what I mean - say you create a square (that is actually going to do colliding) and then you create a character animation actor. This is often better to do because a square object will be more robust, where as character object will get its hands and feet stuck in other objects and its not very reliable.

Anyway, if both object are unique, then fine. But if we are talking about enemies in the game, of which several clones are created, it looks like we are not able to connect one clone to the other in any meaningful way.

For instance, you shoot at the square object. It notices the collision. Now you need to destroy it, but how do you destroy the associated character object? You can, of course, use a parent/child relationship, though this is not always wanted. And perhaps destroy all children of the object (is it even possible?)

But maybe there is some other method I am missing here?

Re: Grouping actors

PostPosted: Thu Jul 30, 2015 1:24 pm
by bat78
Aha, you are greatly missing a number of methods.

For instance, on collision event you can do:
Code: Select all
DestroyActor("Collide Actor");

or
Code: Select all
DestroyActor(collide.clonename);

Other ways involve obtaining a pointer to the specified actor using getAllActorsInCollision or getclone or getclone2 (since gE1.4.1b) or getactor or CreateActor depending what exactly you need to do.