Add individual actions to objects spawned by many enemies

Get help using Construct 2

Post » Wed Apr 05, 2017 7:05 am

Hello,

I am working on a 2D game (side view) since many hours and nights and I love the motor I created (but less than the moto YOU created!) . :)

BUT. I am blocked with an important part and I lost much time with it. So I will try to ask you if someone has a good tip for me.

I want to do these actions, my enemies are included in a family enemies :

- Put a skin animated on each obj_enemy in the layer (on a personalized point, not origin) ;
- Put a ! or a ? on the top of the head of each enemy depending of the alert status variable (which is correctly managed). I did it correctly for one enemy, but not for 2 or more ;

In fact the only problem is when I use the for each system condition, objects family enemies and objects created by them are not really linked. For example, when my player is in the line of sin of one enemy, the "!" is put on all my enemies in the layer. Too bad :(

I could show you a screen shot if necessary, but if you have any idea I will be very happy :)

Thanks.
B
5
S
1
Posts: 3
Reputation: 331

Post » Wed Apr 05, 2017 7:34 am

What would be most useful here is an isolated example capx of your issue.

From your general description, it seems like you just have picking problems in your conditions. Unfortunately without seeing your existing approach, it will be difficult to pin down the issue.

Going to put this here ahead of time - If your project is fairly large and advanced already (which it sounds like it is), it could also be difficult to help even if we see the whole thing, which is why an isolated example would be best as I mentioned above.
Mistakes were made.
B
54
S
28
G
115
Posts: 1,705
Reputation: 65,083

Post » Wed Apr 05, 2017 9:13 am

What oosyrag stated is true. A .capx will be better to get accurate help.

In the mean while, may i suggest you look up 'containers', if you want to tackle those things yourself.
https://www.scirra.com/manual/150/containers

And ImagePoints
https://www.scirra.com/manual/63/image-points

Bring the 'marks' in a container with the enemy, and it will pick the right 'mark' when you do a 'for each enemy'.
Use 'imagepoints' to set a 'mark' to the position of an enemy, in that action you will see that you can choose an imagepoint.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Apr 05, 2017 7:30 pm

Hello,

Of course. I created a clean exemple especialy for you :), my project is too big unfortunatly: drive.google.com/file/d/0Bx5piAZ0fLB_ckU2QVMxaVJ0REk/view?usp=sharing
I already tried the container solution but it not work.

You can see that all my enemies have a skin but the mirroring is depending of only on enemy.

But it's funny because when I made my example, the alert icon is working :D

Thank you.

Sorry, I can not add URL because I am too newbee here :) I broke my Google doc link, I hope it's not a problem...
B
5
S
1
Posts: 3
Reputation: 331

Post » Wed Apr 05, 2017 9:29 pm

B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Apr 05, 2017 10:59 pm

99Instances2Go you are a genius! :)
You played with the UID so the for each condition is able to link all objects to an specific enemy.
I tried with the IID but without success.

Thans you very much, you save my night. :)
I will try to adapt it with weapons, other parts of the body and with objects which my player is able to carry.

++
B
5
S
1
Posts: 3
Reputation: 331


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests