Sprite ignoring Pathfinding Custom Obstacles

0 favourites
  • 3 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • .CAPX: https://www.sugarsync.com/pf/D6025908_4317202_6792106

    For all of my sprites labeled with "L1" (the "Ground" layer), they have two frames of animation (settings set to speed: 0, loop: no). Frame 1 it the same block shape, but its alpha (transparency) setting is set to 50 points less, so that there is a subtle see-through, just enough to notice to the observant eye during gameplay.

    Under no circumstances does the Enemy object get to pass through any wall. At least...that's how it's supposed to be.

    When an instance is set to frame one, then I disable its Solid behavior so the Player can pass through it like a secret passage and give the Enemy chasing him the slip...hence the LOS object that tests if any walls are obstructing the direct line of sight.

    The problem is that the Enemy characters via Pathfinding treat any wall object as if it were not a Custom Obstacle when that wall is set to frame 1. Press M to create sprite instances that highlight where cells have Custom Obstacles. You'll notice where the walls with frame 1 set do not get highlighted.

    I've checked the collision polygons on all frame 1, L1 wall objects to ensure the collision nodes are set as they should be - everything checks out.

    My only theory which I haven't been able to isolate and conclude on is that the disabling of the Solid behavior is causing the relevant L1 walls to also become unrecognized as Custom Obstacles.

    My apologies if all my Event sheets and Layouts as they are broken down create some confusion. The main gist of things can be found in Event Wall Set-Up and in Event CharEnemy. In Event Level 1, I reference to both of these two Event sheets...and I'm wondering if the order that I reference them makes a difference according to traditional event flow logic (ie: reading top to bottom).

    Also, previously, in Event Wall Set-Up, I had it set so that for each wall instance, if the L1 walls were set to frame one, I would also turn them invisible as well as disable Solid. Now, this worked, and the Enemies would not chase the Player when I went through the "secret" passage. Since then, I decided I wanted all the walls to look unbroken, and only walls that had a slightly distorted look during gameplay would be able to be walked through by the Player. But, again, the Add Obstacle would apply to all L1 walls regardless of frame setting.

    I'm not sure what I'm missing by now. Much obliged for your help!

    UPDATE: I tested for frame 1 also having the Solid behavior active. That solved my dilemma partially. I now need to figure out how to allow the Player to go through sprites (no Solid) while preventing the Pathfinding behavior from mapping a path THROUGH the same sprite that, while having Solid disabled, is still an obstacle it cannot go through.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You have to set 'Obstacles' to 'Custom' in the pathfinding properties.

  • *BIGGEST FACEPALM THIS SIDE OF THE MISSISSIPPI RIVER!!!* Oh my goodness. I HAD that set to Custom before! I don't know how it got changed, but now I see what the problem was! LOL

    Man, I feel like a dunce. :P

    *sighs and laughs at myself* THANK YOU, Once again, you are my hero. .....er, don't read into that too much.

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