How do I spawn a sprite along pathfinding route

0 favourites
  • 4 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • Hey guys,

    I am using Pathfinding Direct Movement" project as an example for my turn-based game in order to show me the path that player is going to follow. I want to make it so the suggested route would have no range limit, but since it is a turn-based game the idea is to mark somehow the distance a player can go in 1 turn. So you guys understand me better, think on how the turn-based movement is made in Divinity games, where you can go X distance in 1 turn, rahter than X cells.

    I cant figure out how to spawn a sprite within 3000 distance range along the pathfinding route, to show the player the max distance it can go in 1 turn.

    Can you guys help me with his? Thanks in advance!

  • hello;

    You want to use the moveto behavior based on the pathfinding behavior. You can find the distance between each waypoint and add it up and create a waypoint for that turns end. I do this here in this game:

    construct.net/en/free-online-games/rpg-mage-dog-26512/play

    The manual explains it pretty well (see here below).

    This is an alternative to the Pathfinding behavior's Move along path action. It only works with a Pathfinding behavior on the same object, and like the Pathfinding action can only be used after On path found triggers. The 'Move To' behavior uses a different algorithm for moving along waypoints, and this action lets you use its approach instead of the built-in Pathfinding movement.

    yours

    winkr7

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the example, its exactly how i want it to work! Can you share a project file or a screenshot of the pathfinding - moveto loop?

  • Thanks for the example, its exactly how i want it to work! Can you share a project file or a screenshot of the pathfinding - moveto loop?

    yes I will send the loop to you. This was from a few years back so I will have to dig it up. The hard was getting the spot between moveto nodes where the movement points end. Thats where the path changes from green to yellow to red in the example. Also, it gets much more complicated if you have different movement rates over different terrains. I think I just assumed it was all the same rate. It may take me a while to find it.

    yours

    winkr7

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