getAllActorsInCollision

Non-platform specific questions.

getAllActorsInCollision

Postby jazz_e_bob » Sun Jun 26, 2005 11:13 am

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:
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby makslane » Sun Jun 26, 2005 6:57 pm

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.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby jazz_e_bob » Sun Jun 26, 2005 9:47 pm

Thanks mate.

8)
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron