LOS and picking trouble

This forum is currently in read-only mode.
  • 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:

    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?

  • 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.

  • Which version are you using? 0.99.4 is having problems with LOS

  • 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.

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

    Which version are you using? 0.99.4 is having problems with LOS

    I'm using 0.99.3.

  • 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

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Yeah you could use a dummy sprite. Oh David..... any way we could turn on/off the custom collision masks during runtime.

  • Edit:

    Is this the sort of thing you're looking for?

    LOL I forgot the link

    http://files.getdropbox.com/u/529356/loslight.cap

  • 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.

    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..

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

    Yeah my walls are solid but I'm using different sprites inside them to block LOS with a custom obstacle list.

  • 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..

    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.

  • This is what I've got working so far.. As you can see it's very buggy and there's probably a lot I could've done in a better way. You can just ignore the map generation and other stuff, they're just experiments under work.

    http://files.getdropbox.com/u/1496418/crawl.cap

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)