Copying Pointer to Actor

Non-platform specific questions.

Copying Pointer to Actor

Postby jazz_e_bob » Sat Jul 30, 2005 6:27 am

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.
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 » Sat Jul 30, 2005 2:46 pm

I didn't understand. What do you want?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby jazz_e_bob » Sun Jul 31, 2005 1:13 am

: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
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 » Mon Aug 01, 2005 4:10 am

Just doing actorB = actorA; don't works?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby jazz_e_bob » Tue Aug 02, 2005 10:40 pm

Yes. :oops:
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