matching clone problem

Game Editor comments and discussion.

matching clone problem

Postby SpiritofRadio » Tue Dec 22, 2009 6:24 am

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?
SpiritofRadio
 
Posts: 8
Joined: Tue Dec 22, 2009 6:03 am
Score: 0 Give a positive score

Re: matching clone problem

Postby skydereign » Tue Dec 22, 2009 7:14 am

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;
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: matching clone problem

Postby SpiritofRadio » Tue Dec 22, 2009 9:14 pm

DUDE! It worked perfectly! Thanks much man!
SpiritofRadio
 
Posts: 8
Joined: Tue Dec 22, 2009 6:03 am
Score: 0 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron