Line of Sight weird behavior

For questions about using Classic.

Post » Wed Aug 12, 2009 9:35 pm

I don't quite understand how line of sight works. For example, I have a solid player sprite and a fixed line of sight object sprite. If I set the line of sight obstacles to custom then it correctly finds the player. However, if I set it to "solid" then it ignores the player. Seems like there should be an exception for the player no matter if its solid or not.

What I ended up having to do is set the obstacles to custom and then define the walls to be the obstacles in any actions. This doesn't make sense to me though. Is this a bug or the way its supposed to work?
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Thu Aug 13, 2009 7:04 pm

Posting a .cap might help (it's always a good idea IMHO). I think the issue is that you're getting confused with the 'custom' setting - it means you use an action to add the object types that cannot be seen through.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Thu Aug 13, 2009 7:50 pm

[url:2yesil7r]http://dl.getdropbox.com/u/888303/Caps/detecting.cap[/url:2yesil7r]
This is what he means, the Line of Sight plugin detects only hotspot of sprite so if he's solid it will simply not see the sprite.
B
4
S
2
G
4
Posts: 719
Reputation: 2,938

Post » Thu Aug 13, 2009 9:54 pm

Thanks Doppel!! Yes, that was what I meant. I didn't know about line of sight plugin using the hotspot for detection.

Off the top of my head, I can't think of a case where the player sprite would not be solid. It seems like it would be nice to just use the default "solid" option in the line of sprite behavior (like the example Doppel showed). That way you don't have to go adding obstacles. Another option would be to add an action to "remove obstacle". The only current actions are "add obstacle" and "remove all obstacles". That way you could keep the player sprite solid (with the hotpot in the center) and then just select the player as an obstacle to remove.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Fri Aug 14, 2009 12:48 pm

[quote="scidave":13t8v1uh]Thanks Doppel!! Yes, that was what I meant. I didn't know about line of sight plugin using the hotspot for detection.[/quote:13t8v1uh]
Yeah still weird that it wont exlude the target as not-obstacle.

Bug posted in sourceforge
http://sourceforge.net/tracker/?func=de ... id=1003219
B
4
S
2
G
4
Posts: 719
Reputation: 2,938


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests