Problem with LOS/family, in need of help

Get help using Construct 2

Post » Mon Aug 04, 2014 11:53 am

Hi,
I did some digging and couldn't find a clear solution to this, so I'm asking for help:)

In short, I want the enemies to behave differently (change animation, speed, attack pattern,etc.) when the player is at different range. I used the Line of Sight behavior for the enemy family and did something like this:

for each enemy
-enemy has LOS to player
--abs(player.X-enemy.X)>350 -------events
--else
---abs(player.X-enemy.X)<150 --------events
---else --------events
(and something else about enemy movement, but since it worked there's no need to put it here)

However, when there are multiple instances from the enemy family, the player has to be within every instance's range for them to behave correctly. For example, if I want the enemy to play attack animation when abs(player.X-enemy.X)<150, every enemy instance has to be this close from player for them to play the animation together.

And that's obviously not the plan. Could someone explain to me why this happened? Hope I described the situation clear enough. Thanks!
B
3
Posts: 9
Reputation: 175

Post » Mon Aug 04, 2014 12:47 pm

Bump. Still can't figure out why.
B
3
Posts: 9
Reputation: 175

Post » Mon Aug 04, 2014 1:12 pm

Well, removing that LOS line doesn't help at all, so I guess it's not about LOS behavior but the logic. Could someone tell me how to achieve that goal (a different set of events for every enemy-player distance range)?
B
3
Posts: 9
Reputation: 175

Post » Tue Aug 05, 2014 7:48 am

Alright, figured it out. I shouldn't have used function in the events.
B
3
Posts: 9
Reputation: 175


Return to How do I....?

Who is online

Users browsing this forum: lolsuperscratch, RobertMKD, tarek2 and 9 guests