Page 1 of 1

Copying Pointer to Actor

PostPosted: Sat Jul 30, 2005 6:27 am
by jazz_e_bob
Example usage:

Code: Select all
Actor *actorWithBestHealth = getclone("invalid.0");

if ( actor[i].myHealth > actorWithBestHealth->myHealth )
  // what do I type here?



how do I copy the pointer to the actor?
eg actorWithBestHealth = getclone(actor[i]);

Thanks people.

PostPosted: Sat Jul 30, 2005 2:46 pm
by makslane
I didn't understand. What do you want?

PostPosted: Sun Jul 31, 2005 1:13 am
by jazz_e_bob
:oops:

( Sorry, I had too much red wine when I asked that one. ;-) )

How do I copy pointers to actors in script?

For example:

Actor *actorA = getclone("copyMe.0");
Actor *actorB;

actorB = actorA; // how do I do this bit?



What I want to do:

I want to be able to grab all actors at regular intervals. I am using the getAllActorsInCollision method.

I want to process the list in order to return pointers to useful actors.

For example:

healthiestSoldier
closestFood

This would also pave the way for a line of sight system. :-)

closestVisibleZombie

PostPosted: Mon Aug 01, 2005 4:10 am
by makslane
Just doing actorB = actorA; don't works?

PostPosted: Tue Aug 02, 2005 10:40 pm
by jazz_e_bob
Yes. :oops: