Line of Sight and families

For questions about using Classic.

Post » Fri Oct 21, 2011 7:58 am

I'm trying to use the line of sight behavior without much luck. I have a bunch of instances of the same object (Enemy1), and they're all in a family (Targets). I'm doing a test whether the player is in the line of sight of a selected enemy. The enemy is picked through its family, and I can tell the picking works because other stuff happens to the enemy that doesn't include line of sight and that all works on the specific instance of Enemy I select. However, testing for line of sight seems to have no effect (the player is always in the line of sight regardless of the angle settings or distance settings, even angle 0). If I use the instance itself instead of the family it works but that won't work in the future where there will be enemies of different instances (e.g. Enemy2, Enemy3) etc, each in the family Targets.

I read about some bugs with line of sight but it seemed like using families would make stuff work, but apparently not. I'm wondering if there's a known workaround or if I'm possibly doing something wrong.

I could upload a cap if needed but I'd rather not do that to you guys because the cap is pretty complicated at this point and would probably be a pain to work through if the error is in some part of the cap that is not directly where the LOS check happens, and even that part is annoyingly complicated using arrays and indexing in an extremely convoluted way :P
B
11
S
2
G
3
Posts: 283
Reputation: 1,968

Post » Fri Oct 21, 2011 10:53 am

There is problem with LOS and Families or if using more than one instance of an object. The behavior always picks just the first one. I've seen a workaround, using custom LOS. I'll try to find it.

here's one

another

I've tried this and it works:
+ System: For each Enemy
+ Player: Has LOS to Enemy -> do something

Noga2011-10-21 11:11:07
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Fri Oct 21, 2011 4:35 pm

Thanks for the reply and information. Looks like there will be a solution in there somewhere that's ideal for me (I'm liking the cone of view code and can use it for a few other things in addition to LOS :) )
B
11
S
2
G
3
Posts: 283
Reputation: 1,968


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 9 guests