problem with create actor

Non-platform specific questions.

problem with create actor

Postby Francisco » Wed Sep 13, 2006 1:39 pm

Hi, I have a problem when I want to create actors. I want to put four or more enemies with the same properties as the first one but when I change for example, the animation of the first, the second actor created changes the animation also, the changes produced on one, are produced in all the others also. I can´t put more than one enemy at the same type.

Can you help me?

Thanks.
Francisco
 
Posts: 7
Joined: Wed Sep 13, 2006 1:34 pm
Score: 0 Give a positive score

Postby makslane » Wed Sep 13, 2006 4:42 pm

If in the action you use the name of actor, like 'enemy', the action will be executed on all enemy actors. To change a particular clone, you need to use the clone name, the 'Event Actor' actor or other special actor name.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

problems

Postby Francisco » Wed Sep 13, 2006 5:10 pm

for example, I have a script for Draw Actor of an object called PAQUETE:

if (paquete.x < -6) ChangeAnimation("Event Actor", "paquete2_fix", FORWARD);

but it changes all the clones of paquete, not only this one.

and when a PAQUETE is moving to the left by a Timer:

paquete.x += -15;
PlaySound2("data/Enemy.wav", 1.000000, 1, 0.000000);

and another Timer creates a new second PAQUETE, the second PAQUETE doesn´t move, the first PAQUETE moves at double speed :(

I don´t know what to do.
Francisco
 
Posts: 7
Joined: Wed Sep 13, 2006 1:34 pm
Score: 0 Give a positive score

Postby makslane » Wed Sep 13, 2006 5:14 pm

Try change the code to:

Code: Select all
if (x < -6) ChangeAnimation("Event Actor", "paquete2_fix", FORWARD);
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

a problem fixed

Postby Francisco » Wed Sep 13, 2006 6:02 pm

With this change this works correctly, thanks :)

but the second PAQUETE actor created doesn´t move and the first PAQUETE moves at double speed when there are two same actors created. But when a collision destroy the first PAQUETE actor the second actor begins to move. how could I move the two same PAQUETE actors at the same time?

If you can solve this problem I can continue my game, this is the last problem at the moment :)

Thanks again.
Francisco
 
Posts: 7
Joined: Wed Sep 13, 2006 1:34 pm
Score: 0 Give a positive score

I hav solved the problem! :)

Postby Francisco » Wed Sep 13, 2006 6:20 pm

PROBLEM FIXED!!! :)

the same thing you said. I converted all "paquete.x" to "x" and all works well :)

Thanks for all
Francisco
 
Posts: 7
Joined: Wed Sep 13, 2006 1:34 pm
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest