[How do I] Enemy Ai2

Get help using Construct 2

Post » Fri May 02, 2014 3:45 pm

Hello again guys, i got two problems

Image

- after the first enemy (yellow) spawns he is moving to my player and start attacking him if he is in range.. also
i can jump over him and he turns to me, so far so good..


but if the (purple) enemy is spawing, the yellow one stops looking in my direction, i can jump over him and he wont turn around.. (in the picture)
and he is also the only one who can attack me, the (purple) enemy cannot attack as long as (yellow) is not dead

if i jump over the (purple) one, both turn to me and if there would be a thrid one, ive to jump over him that both turn in my direction..


what i need is a way how i can speak to each spawned zombie individually

any idea?
B
5
S
1
Posts: 19
Reputation: 413

Post » Fri May 02, 2014 4:07 pm

It would be helpful if we could see your code snippet your are using currently.
B
100
S
32
G
11
Posts: 1,552
Reputation: 21,612

Post » Fri May 02, 2014 4:53 pm

ArcadEd wrote:It would be helpful if we could see your code snippet your are using currently.


nothing special, thats what i got so far

Image
B
5
S
1
Posts: 19
Reputation: 413

Post » Fri May 02, 2014 4:56 pm

Have you tried using a System- For Each Zombie, and then dropping in your distance check as a sub even to that?
B
100
S
32
G
11
Posts: 1,552
Reputation: 21,612

Post » Fri May 02, 2014 6:28 pm

Thanks the attacking part it is working!

Image

any solution for the other problem ?
B
5
S
1
Posts: 19
Reputation: 413

Post » Fri May 02, 2014 6:29 pm

Same thing, use the for each for your zombie moving events. I think that should fix it.
B
100
S
32
G
11
Posts: 1,552
Reputation: 21,612

Post » Fri May 02, 2014 6:35 pm

unfortunately not :/

Should i do it all in one for each loop or two?
B
5
S
1
Posts: 19
Reputation: 413


Post » Fri May 02, 2014 6:46 pm

Message: DREZO is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
ArcadEd wrote:Can you post your CAPX file (File, save as single file) or email it too me at and I can take a look.



I did
B
5
S
1
Posts: 19
Reputation: 413

Post » Fri May 02, 2014 6:53 pm

Seems to be working ok for me, or am I missing the problems?

I do get a script error at the beginning, not sure what that's about.

Here is a video of me testing it.
http://screencast.com/t/5LFZcx6huME
B
100
S
32
G
11
Posts: 1,552
Reputation: 21,612

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests