Prevent all enemies react at once when overlap

Get help using Construct 2

Post » Mon Oct 31, 2011 1:45 pm

This time Iam the one who needs help lol

what i try to do here is a patroling platform enemy with a vision area that when the player overlaps,the enemy will start chase the player, but only inside its patroling zone.
Sofar i got nearest to what i desire by using sprites for making the distance because playing with the system distance caused too much trouble....
Now heres what I need, I got two same enemies set up in their own patrol zone whos share same events and actions.
I need the enemy to ignore chasing actions when the other one spots the player so I can use this to create a level full of enemies with their own patrol zones.



File: http://dl.dropbox.com/u/5214903/GM/PatrolNeedHelp.zip
B
43
S
9
G
5
Posts: 231
Reputation: 7,291

Post » Mon Oct 31, 2011 2:06 pm

I'm no expert. But I would suggest using instance variables to conrol that. Ex- set instance variables for each enemy indicating player spotted, either boolean or numeric with 0 and 1 (open/closed). Then set action/event sequences setting enemy 1's sight to false if enemy 2's sight is true and vice versa.
B
22
S
9
G
3
Posts: 202
Reputation: 3,645

Post » Mon Oct 31, 2011 6:27 pm

I'm working in a sample for you, maybe tonight I edit this post with it. =]
ImageImageImageImageImageImage
B
93
S
19
G
12
Posts: 1,207
Reputation: 18,353

Post » Mon Oct 31, 2011 7:03 pm

[QUOTE=droptank21] I'm no expert. But I would suggest using instance variables to conrol that. Ex- set instance variables for each enemy indicating player spotted, either boolean or numeric with 0 and 1 (open/closed). Then set action/event sequences setting enemy 1's sight to false if enemy 2's sight is true and vice versa.[/QUOTE]


Unfortunely Im not really good with variables, but thankyou for the advice :)
B
43
S
9
G
5
Posts: 231
Reputation: 7,291

Post » Mon Oct 31, 2011 7:05 pm

[QUOTE=TELLES0808] I'm working in a sample for you, maybe tonight I edit this post with it. =][/QUOTE]


I figured out that by adding event "Pick nearest" solves the problem http://www.scirra.com/forum/topic45770_post286384.html#286384
But I deffinitely will apreseate your ideas to solve it :)
Afterall,there are many ways to do the same result
B
43
S
9
G
5
Posts: 231
Reputation: 7,291

Post » Mon Oct 31, 2011 7:23 pm

Here it is.

You can make your "Detecting area" or use like I did.. =)

http://dl.dropbox.com/u/47035927/Chasing%20Sample.capx
http://dl.dropbox.com/u/47035927/Chasing%20Sample/index.html

I organized in groups and if you need comments in the code, just place another post asking for ^^TELLES08082011-10-31 19:24:27
ImageImageImageImageImageImage
B
93
S
19
G
12
Posts: 1,207
Reputation: 18,353

Post » Mon Nov 18, 2013 2:54 am

Hi TELLES0808

maybe you removed the file but your link does not work anymore :(
Would it be possible for you to link it again?

Thanks
B
14
S
5
G
2
Posts: 61
Reputation: 2,686

Post » Thu Jun 25, 2015 9:44 pm

File deleted a long time ago, sorry.
ImageImageImageImageImageImage
B
93
S
19
G
12
Posts: 1,207
Reputation: 18,353

Post » Sat Jun 27, 2015 10:39 am

i apologize for the unfortunate missing files of the examples. I cant really even remember if i deleted or moved the files from dropbox but i do plan making new ones that hopefully wont have this issue again
B
43
S
9
G
5
Posts: 231
Reputation: 7,291


Return to How do I....?

Who is online

Users browsing this forum: R0J0hound, randomly, spcsmrf and 26 guests