How do I Detect if an object is "not on line of sight"?

Get help using Construct 2

Post » Wed Jan 18, 2017 10:00 pm

I have sprites that are 'cameras' with lineofsight in my levels, to detect the player. When there is just one camera in the layout, it's fine. The problem is when there is more instances of the camera...

The detection if the player IS in line of sight works with all instances, but how can I make just the right instance of the camera detect that the player IS NOT in line of sight anymore? just inverting the condition "has line of sight" don't to the job for the right instance.
B
20
S
4
Posts: 385
Reputation: 2,270

Post » Thu Jan 19, 2017 10:21 am

Hope this shows you 'picking'. And how to use 'else'.

https://drive.google.com/open?id=0B1SSu ... 3FDc0NYc00
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Jan 19, 2017 5:35 pm

99Instances2Go wrote:Hope this shows you 'picking'. And how to use 'else'.

https://drive.google.com/open?id=0B1SSu ... 3FDc0NYc00

Awesome! that's pretty much what I need. But how can I modify this to make the system work even if more than one camera is detecting the player?
B
20
S
4
Posts: 385
Reputation: 2,270

Post » Thu Jan 19, 2017 6:41 pm

Why not ? Just a Line-of-sight more. (rereading the question).
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Jan 19, 2017 7:40 pm

99Instances2Go wrote:Why not ? Just a Line-of-sight more. (rereading the question).

That's what i need to know :D
Have you tried to increase the cone of view of the cameras?
When there is more than one detecting you, the cameras don't work as they should. They don't act independently.
B
20
S
4
Posts: 385
Reputation: 2,270

Post » Thu Jan 19, 2017 11:00 pm

Of course the cameras work with increased cones of view.
It was just NOT designed to catch that. There is only 1 frame/situation in the player (was eye candy anyway). There is only 1 laser (also just eye candy)

You just need more lasers when more cameras are triggered at the same time.
Add a 'for each', to account for more picked camera's. Add a event for the logical 'else' and one for the inverted 'picks'.

https://www.dropbox.com/s/jp0wwfadf4f4i ... .capx?dl=0
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Jan 19, 2017 11:40 pm

Ah, I see... sorry, I think I have issues with picking '.' hehe
Thank you very much for the help, this is exactly what I was trying to achieve.
B
20
S
4
Posts: 385
Reputation: 2,270

Post » Fri Jan 20, 2017 10:36 am

There is a entry in the manual that explains how things work very well. Better then i ever can do.

https://www.scirra.com/manual/75/how-events-work

That, and kinda only that, and especially that, is the most import part of the manual.
Have fun !
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to How do I....?

Who is online

Users browsing this forum: adventurist and 25 guests