How do I make LOS-obstructing objects visible to LOS?

Get help using Construct 2

Post » Sat Sep 26, 2015 11:21 am

Hello all!

I seem to have run into a wall with the Line-of-Sight behavior.
It seems that any objects that obstruct line of sight also obstruct themselves. This means that any objects such as walls or trees that might be used to hide objects behind them are themselves invisible to the LOS behavior.

Is there any way around this little problem or alternative solutions/plugins that others have had success with?
If this is just a limitation of Construct's line of sight behavior, it's a damn pity as it greatly limits the behavior's potential.

Thanks very much in advance.
B
4
Posts: 4
Reputation: 210

Post » Sun Sep 27, 2015 5:36 am

You can add a separate distance and angle comparison check to bypass those restrictions.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614

Post » Sun Sep 27, 2015 6:25 am

Silverforce wrote:You can add a separate distance and angle comparison check to bypass those restrictions.


Thanks for the reply!

Do you mean a separate check to see if the object is in range and should be visible that bypasses Construct's Line of Sight check? How would I prevent this angle and distance check from returning objects that should be obstructed by obstacles?
The only solution I could think of was to do away with Construct's LOS system all together and use a series of of "for" loops to check for any obstacles in a ring around the player, but I was hoping there was a better way.
B
4
Posts: 4
Reputation: 210

Post » Sun Sep 27, 2015 7:32 am

The way you describe it, walls or doors that obstruct other sprites that LoS is checking for, ie. Monster or Loot.

So have the normal LOS for Monster/Loot.

Have separate distance/angle check for Walls or Doors.

Does that make sense?
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Allardje, R0J0hound, Rudi55, sublimate, Vinterstille and 1 guest