Page 1 of 1

matching clone problem

PostPosted: Tue Dec 22, 2009 6:24 am
by SpiritofRadio
Hello. Here is my situation:

//this is in the draw actor for the turret of the tank (enemyt)

if(enemy.health<1)
dead=1;

//enemy is the tank body, health and dead are both actor variables

The problem is i need to make clones of both and i need a formula that will match the body with the turret
(enemy.0 and enemyt.0, enemy.1 and enemyt.1... and so on) so if enemy.0 health fell below 1 enemyt.0 dead would equal 1.

Can anyone help me?

Re: matching clone problem

PostPosted: Tue Dec 22, 2009 7:14 am
by skydereign
Well, that is one way of doing it, and you can use Actor*, and getCloneIdx to do it, though I wouldn't do it that way. What I suggest is to create the base of your tank, and in the create actor, make the turret part. Now you can use the tank base's actor variables, for both the tank and its turret. Whenever you want the turret to use the tank's actor variable, in this case dead, just do it like this.
turret -> DrawActor -> Script Editor
Code: Select all
creator.dead=1;

Re: matching clone problem

PostPosted: Tue Dec 22, 2009 9:14 pm
by SpiritofRadio
DUDE! It worked perfectly! Thanks much man!