Line of Sight problems and spawning issues

Just started using Construct 2? Post your questions here

Post » Sun Apr 13, 2014 12:37 pm

I have an enemy with LOS represented by one icon when it does not have line of sight but spawns two additional enemies on either side of it when it does have LOS. This works fine except the enemy ignores solid objects even though I have them specifically listed in the event sheet (it just wanders wherever it wants regardless of the terrain). If I try to move the player into the bottom half of this initial layout while the enemy is in the lower half of the layout the game goes into serious lag and eventually locks. This did not happen the one time the enemy was in the top half of the layout. I almost think this is tied to the LOS somehow. I placed the initial LOS sprite off screen because it seemed to be in the way when done otherwise (like there were two LOS at run time) and the tutorial says if the events are entered as I have them that the original is destroyed and the correct one spawned per the event code. How do I stop the enemy travelling and or spawning over solid objects (I have the same settings as the player and player works fine)? What is this terrible lag from in this one instance (game does not do this in any other situations)?

Image

Image

I worked up the code here by following the tutorial nearly verbatim at "Pathfinding With Line Of Sight" by Wrangler in the tutorials section (beginners)
I do not have status icons (ie, alert, etc.) so have only used an origin point, an anchor point (los_anchor) and two spawn points to either side of the original. After finishing the tutorial I now have two enemy spawns at start up (one stays stationary and the other moves in a straight line until it gets stuck), neither of them recognize the player at all (additional spawns should only happen after LOS is active as it is) and they still do not respect impassable or solid objects, they simply move wherever they want to.

All help will be much appreciated
Thanks in advance
Last edited by Spindraft on Sun Apr 13, 2014 8:31 pm, edited 7 times in total.
B
5
Posts: 15
Reputation: 255

Post » Sun Apr 13, 2014 3:56 pm

You upload the one with the type Construct 2 Project.

Name Date Modified Type
Proj1 4/13/14 Construct 2 Project
B
8
S
1
Posts: 76
Reputation: 949


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests