Line of sight and else condition

Discussion and feedback on Construct 2

Post » Sat Aug 12, 2017 8:47 pm

So I'm trying to make an AI that searches around an area. I gave it the line of sight behavior and said
If Robot has LOS to Unknown: Move forward 1 pixel
- else: Rotate 90 degrees

It says that else is invalid and when I try inverting the line of sight the robot just spins around in circles.
B
22
S
8
Posts: 203
Reputation: 2,059

Post » Sat Aug 12, 2017 11:00 pm

Yes well, that it exactly what you tell it to do. I suppose you still have the Cone of View set on 360 degrees.
Then, when it has No LOS, that LOS situation is not changing when just rotating the Robot.
So it rotates like Mad Max on Ice.

You need some logic that brings a Robot with No LOS (eventually) in range of Unknown.
B
33
S
18
G
28
Posts: 2,470
Reputation: 20,904

Post » Sun Aug 13, 2017 12:02 am

No, it has a line of sight of 45 degree and a range of 40 and when it turns it has a line of sight to the unknown area next to it. For some reason if I tell it to spin when it doesn't have line of sight it spins even if it does have a line of site to it's target
B
22
S
8
Posts: 203
Reputation: 2,059

Post » Sun Aug 13, 2017 7:55 am

Plz, drop a capx.
B
33
S
18
G
28
Posts: 2,470
Reputation: 20,904


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 8 guests