fourfives's Recent Forum Activity

  • I figured out the cause but I don't really know why it behaves this way. I had 2 path finding behaviors, one on 2 different families. If I remove the 2nd path-finding behavior from other family it all works as expected. I even tried adding a path-finding behavior to the 2nd family named something else, and it still breaks everything. Maybe your only ever supposed to have 1 path-finding behavior per construct 2 game? Even adding the 2nd path-finder behavior to a different family that has a different sprite named something different with no code, still breaks everything.

  • So i'm not doing pathfinding or regen obstacle map every tic (that would be nuts). I'm only doing regen and pathfinding when I deem the obstacle map 'dirty' in other words something changed in the obstacle map because the user added or deleted something.

    Again I need a guaranteed way of knowing when the obstacle map has been regenerated, exactly like the already existing event 'on path found' does.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I've struggled with this one as path-finding is asynchronous. Due to this construct 2 actually has a way of dealing with the asynchronous nature of path-finding by having an event that will fire when a path is found (because it does not complete at a strict time such as one tic or after 'x' seconds. No problem there.

    Issue comes in when I regenerate obstacle maps. How do I actually know when its completed? There is no event called 'On obstacle map regeneration complete'. I've tried using wait 0 seconds to force the code to run at the end of a tic however this does not work because it can take more than the tic to complete. I've tried using wait 3 seconds and this seemingly works but i'm simply guessing (and gambling) how long it will take to regen obstacle map and if I guess wrong for the 'longest' time it would ever take then the entire thing falls apart.

    Does anyone have a guaranteed way (strict way) to 'know' when the obstacle map has been regenerated so I can then call a new path-find event? Why is there no event called 'on obstacle map regenerated'?

    Tagged:

fourfives's avatar

fourfives

Member since 30 Aug, 2016

None one is following fourfives yet!

Trophy Case

  • 8-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

10/44
How to earn trophies