How do I (Convince player that he is not a ghost)

  • Have a player with path finding behaviour. Double clicking on map will tell the player to find a path to the mouse.x & mouse.y It finds the path and avoids all solids and does not travel through solids on start of layout. Will find path around said solid (obstacle)

    My game is an RTS game. New object that is placed in

    game is in fact solid. However this is not updated and the player sticks to the old obsticle map. I have tried for the solid wall that OnCreate - Player - Regenerate Obsticle map.

    This does not work, I am sad. Player and wall are on same layers. I do not know what to do, I am pathetic...

  • Oh, don't be sad..

    I'm sure the problem is with the wrong timing of events.

    "On Create" event is triggered before the object is actually added to the layout, maybe that's why it's not registered in the obstacles map. Try adding "Wait 0" before regenerating the obstacle map. And then you need another "Wait 0" before you can do "Find path".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you dop, you have cheered me up. It works, but takes a few seconds for it to regenerate..

    However instead of scanning the entire map for new obsticles each time the block is created, is there a much more efficient way and this is just silly to have to rescan every single cell in the layout each time a block is created :(

    In the mean time I'll find a way and look for answers.

    Thank you again you are my hero <3

  • Several seconds?! You must have a very big map or very small pathfinding cell size..

    Anyway, you can use "Regenerate region around object", this should work much faster.

  • No word of a lie it took several seconds. Turns out the problem never existed and it was just my eyes decieving me. However, much appreciate the regenerate region method. Thanks.

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