Introduction
If anyone used Near Fantastica's Pathfinding system, they may have noticed that the 'Wait Till Move Completion' event had no effect. You could try to figure out some arbitrary wait time from when a character was to move from point A to point B, but you were usually just guessing.... until now.
This little add-on for Near Fantastica's original pathfinding script will obtain how many steps that was calculated by the system. Using that, you can make some sort of wait count system based on the actual steps taken!
Again, this is for Near Fantastica's version 1 pathfinding script found HERE
Script
The Script
Code:
#==============================================================================
# * GET STEPS FOR PATHFINDING
# for Near Fantastica's Pathfinding version 1.0
#==============================================================================
# By DerVVulfman
# Version 1.0
#==============================================================================
# This just obtains how many steps are calculated after you perform a pathfind
# call. If successful, it returns the number of steps it takes to get to the
# desired location (or closest viable location). But if there is no viable
# location, it returns a value of 0.
#
# NOTE: Does require at least 1 frame (40th second) delay or process to occur
# after pathfinding call was made to ensure an actual path was generated.
#
#==============================================================================
# Player :: value = $game_player.get_path_steps
# Event Script Call :: value = self.event.get_path_steps
# Event Movement Script Call :: value = self.get_path_steps
#==============================================================================
#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
# This class deals with characters. It's used as a superclass for the
# Game_Player and Game_Event classes.
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# * Get Path Steps
#--------------------------------------------------------------------------
def get_path_steps
effective = 0
effective = @map[@x,@y] unless @map.nil?
return effective
end
end
Instructions
Insert this script below Near Fantastica's original.
In an event code, you can create something like this:
Might be a little odd, but I made a loop that counted down from the recently acquired steps. Each time it looped, it waited 3 frames until the counter ran out. During that time, my character ran from wherever he was until map coordinate (4/3).
A simpler way would be if you made a WAIT method that could just input the delay as WAIT(variable in frames)
Compatibility
For RMXP and version 1 of Near's Pathfinding.
Credits and Thanks
Near Fantastica of course.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)