Pathfinding doesn't activate with conditions True

0 favourites
  • 8 posts
From the Asset Store
Pathfinding AI
$2 USD
80% off
Units do not overlap each other and use different ways if there are several free ways.
  • .CAPX: https://www.sugarsync.com/pf/D6025908_4317202_6764554

    Following the comments in the "Event CharEnemy" event sheet, what follows SHOULD be the flow pattern of events:

    PreChase -->> ChasePhase <<---->> AlertPhase

    ^^-----------------------------------------

    When the VisionCone object overlaps the CharPlayer object, the CharEnemy object SHOULD start Pathfinding TO the Player...but it just sits there even though the two conditions are true to set the status from PreChase to ChasePhase. It isn't until AFTER the Player has left the range of the VisionCone that the Enemy starts chasing the player.

    Can someone help me see what I'm missing, please?

  • Maybe because the player is still moving and every move within the cone fires off the pathfinding again so maybe it is stuck starting the pathfinding over and over until the condition is no longer true?

  • I can't get the project to run (I get javascript or plugin errors), but have you tried on collision instead of overlapping? That way it only triggers once for the cone and the player? Is overlapping will keep triggering as long as it's true. Which may be causing some issue.

  • ^ try adding a trigger once while overlapping to path find, or every X seconds while overlapping

  • BluePhaze - Curiously, I did have this working just fine at one point...prior to some edits and additional features I'm trying to add next. But I'll see about doing a Trigger instead of overlapping.

    I'm also trying to work in Yann's suggestion to put the VisionCone and and LOS objects in a container with the CharEnemy object...I'm getting new problems with that given my break-down of layouts and event sheets. I have a habit of making easy stuff complicated.

    wretchedshark - I did have a timer going at one time so not to overload the CPU with the Pathfinding behavior. After making some changes to a previous set-up of my events, I decided I didn't need that wait period after all (it was only checking once every fourth of a second). Now I can't recall exactly WHAT I changed that caused the new mess...

  • Rhindon - i think BluePhaze has the right idea, if you add a System Trigger Once While True condition to event 18 in "EventChar Enemy" event sheet it correctly starts chasing the player when the player is in the vision cone.

    While the overlap condition is true it while continually recalculate a path to the player, and making it not chase while the overlap is true.

  • *adds and wretchedshark to my special "Thank you" list for my game's credits*

    Let me go test this...I'll let you guys know if it works on my end...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah, I had to add a time delay on checking for "Find path". It's working now. :)

    Thanks, guys!

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