Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Stop Path Finding

Im using this Path Finder.
This code is in the event 1
Code:
$path_finding.setup_event(1, false)
$path_finding.add_paths_event(1, 0, 12, true)
$path_finding.start_event(1)
The event starts in position 0,0 and has to go to the position 0,12 (there are some walls in the way).
Every time you "talk" to it, I want it to move four steps surrounding the walls to reach the position.

help pls :/
 
Cange $path_finding.pf_depth to the max steps you want the path finder to make.
If you want a maximum of 4 steps, use:
Code:
$path_finding.pf_depth = 4
$path_finding.setup_event(1, false)
$path_finding.add_paths_event(1, 0, 12, true)
$path_finding.start_event(1)
 
Here's a kick.

If you're using pathfinding v1 to move the 'player', you really just need to use $game_player.clear_path to 'stop' the player abruptly.  Or use $path_finding.setup_player if you're using v2.

I wouldn't be surprised if you only needed self.event.clear_path or self.clear_path (dependent on usage) for version 1, or $path_finding.setup_event(3) for version 2... to stop events.  Assuming to stop event #3 in the v2 syntax.
 
I used
Code:
$path_finding.setup_event(1)
from event 3 to stop event 1, but it ignored it

however, to stop the event after some steps i used this little trick:
In another event i put this commands:
Wait 20 seconds
$path_finding.pf_depth = 20
$path_finding.setup_event(1, false)
$path_finding.add_paths_event(1, $game_map.events[1].x, $game_map.events[1].y, true)
$path_finding.start_event(1)


so it recommands the event, after moving a pair of steps, to move to the location it's stading, and it will stop.

thx for all the help, DerVVulfman and vgvgvgvgvgf!
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top