LOS and picking trouble

For questions about using Classic.

Post » Mon Jul 13, 2009 10:52 am

It seems to me that the "Has LOS to" and "On object in LOS" conditions are not picking anything. I have a sprite (Player) with the LOS behavior and multiple instances of an sprite (Wall) I want to check LOS on.

Currently I have:
[code:2pchny4n]
System: Always (every tick)
> Player: Has LOS to Wall
> > Wall: Set color filter
[/code:2pchny4n]
This simply applies the color filter to every instance of Wall. How should I go about picking the instance the LOS checks on?
B
3
G
3
Posts: 12
Reputation: 899

Post » Mon Jul 13, 2009 11:54 am

You might want to place the wall object into a family. There is already one aptly named terrain.
Then have it find los on that family.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Mon Jul 13, 2009 12:52 pm

Which version are you using? 0.99.4 is having problems with LOS
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Mon Jul 13, 2009 1:36 pm

[quote="newt":260hrz20]You might want to place the wall object into a family. There is already one aptly named terrain.
Then have it find los on that family.[/quote:260hrz20]

Yeah I'll do that but I'm still going to have this problem on my hands.

[quote="alspal":260hrz20]Which version are you using? 0.99.4 is having problems with LOS[/quote:260hrz20]

I'm using 0.99.3.
B
3
G
3
Posts: 12
Reputation: 899

Post » Mon Jul 13, 2009 1:54 pm

Yeah actually I think I could had a similar problem when trying to use LOS in 0.99.3 as well, so I just ended up not using it :?
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Mon Jul 13, 2009 4:59 pm

Are your walls solid? Do you by any chance have your LOS obstacle setting on "Solid objects?"


Edit:
Is this the sort of thing you're looking for? It uses "for each." But that might would get pretty CPU heavy if you have a lot of wall objects. If all you're doing is changing the color of walls, then you might want a different method that doesn't use LOS.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Jul 13, 2009 6:31 pm

Yeah you could use a dummy sprite. Oh David..... any way we could turn on/off the custom collision masks during runtime. :P
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Mon Jul 13, 2009 6:37 pm

[quote="deadeye":15up2vor]Edit:
Is this the sort of thing you're looking for?[/quote:15up2vor]


LOL I forgot the link :P

http://files.getdropbox.com/u/529356/loslight.cap
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Jul 13, 2009 6:56 pm

[quote="deadeye":1pttsrm7]Is this the sort of thing you're looking for? It uses "for each." But that might would get pretty CPU heavy if you have a lot of wall objects. If all you're doing is changing the color of walls, then you might want a different method that doesn't use LOS.[/quote:1pttsrm7]

That's exactly what I was looking for, thanks Deadeye. What I'm basicly after is a roguelike LOS system that reveals walls as you see them. So now there's the problem of me having possibly hundreds of Walls that I have to check LOS on. I was kind of expecting the "Has LOS to" condition would've picked the object in LOS.. :(

[quote="deadeye":1pttsrm7]Are your walls solid? Do you by any chance have your LOS obstacle setting on "Solid objects?"[/quote:1pttsrm7]

Yeah my walls are solid but I'm using different sprites inside them to block LOS with a custom obstacle list.
B
3
G
3
Posts: 12
Reputation: 899

Post » Mon Jul 13, 2009 7:08 pm

[quote="Eyeguy":ml4pk0jj]So now there's the problem of me having possibly hundreds of Walls that I have to check LOS on. I was kind of expecting the "Has LOS to" condition would've picked the object in LOS.. :( [/quote:ml4pk0jj]

Yeah, it appears that the sight-ee isn't put in the Selected Object List, only the sight-er. You need another condition to pick the sight-ee.

And if you do plan on using LOS for this, then I suggest cutting down on the number of objects to check LOS on. If you keep the Range setting on the LOS small then you should be okay.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 9 guests