Page 1 of 1

getAllActorsInCollision

PostPosted: Sun Jun 26, 2005 11:13 am
by jazz_e_bob
Actor *getAllActorsInCollision(char *cloneName, int *nActors)

cloneName: nameactor.cloneindex (Ex.: ship.1, ship.2, ...), "Event Actor", "Collide Actor", "Parent Actor" or "Creator Actor"

Return actor's array with all actors colliding with cloneName if success or NULL if there are no collisions the
Actor count will be returned in nActors

The returned array will be valid until the next call to getAllActorsInCollision
The returned array is read only.

For Example, to make the "Event Actor" the parent of all the colliding actors:

int n;
Actor *actors;

actors = getAllActorsInCollision("Event Actor", &n);

if(actors)
{
int i;
for(i = 0; i < n; i++)
{
ChangeParent(actors[i].clonename, "Event Actor");
}
}


I can't seem to get this to work. :(

In which event would I use the example script? Can it be used in any event?

A demo would be nice! :wink:

PostPosted: Sun Jun 26, 2005 6:57 pm
by makslane
See the example at http://game-editor.com/examples/collisiongroups.zip
(run and use right click to catch the actors)

Can be used in any event.

PostPosted: Sun Jun 26, 2005 9:47 pm
by jazz_e_bob
Thanks mate.

8)