Sprite ignoring Pathfinding Custom Obstacles

Get help using Construct 2

Post » Sat Apr 20, 2013 7:57 pm

.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.Rhindon2013-04-20 20:24:20
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
112
S
20
G
8
Posts: 741
Reputation: 13,636

Post » Sat Apr 20, 2013 9:03 pm

You have to set 'Obstacles' to 'Custom' in the pathfinding properties.
B
54
S
28
G
18
Posts: 1,520
Reputation: 24,990

Post » Sun Apr 21, 2013 12:29 am

*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, @ramones. Once again, you are my hero. .....er, don't read into that too much.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
112
S
20
G
8
Posts: 741
Reputation: 13,636


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 16 guests