The script itself works just fine, but I am requesting help to make it so that the dashing graphic only shows while the player is moving...
Super simple dash script by Brewmeister
Also, is there a way to temporarily disable a script such as this?(For availability on certain maps, and so that it doesn't mess up event move routes.)
Super simple dash script by Brewmeister
#
# Super Simple Dash - V3
#
# Hold the "Z" key to make the player run
#
# paste in a new script above main
#
# Brewmeister - 12Jan09
# Zeriab - change Filetest to Cache.character to see if file exists.
# Seph - modify the attr_reader method character name instead of
# directly changing the instance variable. (safer)
#
# ADDED: Change character set when running.
# create a running character set. Add "_dash" to the filename.
# e.g. 001-Fighter01.png & 001-Fighter01_dash.png
# checks for file, so it will work without one.
class Game_Character
alias_method :brew_dashing_gmchr_cn, :character_name
def character_name
s = brew_dashing_gmchr_cn.to_s
s += '_dash' if dashing?
return s
end
def dashing?
return @dashing
end
end
class Game_Player
attr_accessor :current_speed
alias brew_dash_init initialize
alias brew_dash_update update
def initialize
@current_speed = 4
brew_dash_init
end
def update
if Input.press?(Input::A)
@move_speed = 5 #set the fast speed here
if @move_speed != @current_speed
#check to see if dash file exists
begin
# Check that the graphics for the new character name actually exists
RPG::Cache.character(@character_name + "_dash", 0)
# Change it now that we know it exists
@dashing = true
rescue
# The dash graphics does not exist.
end
@current_speed = @move_speed
end
else
@move_speed = 4 #set the normal speed here
if @move_speed != @current_speed
#remove _dash from the graphic name if it exists
@dashing = false
@current_speed = @move_speed
end
end
brew_dash_update
end
end
# Super Simple Dash - V3
#
# Hold the "Z" key to make the player run
#
# paste in a new script above main
#
# Brewmeister - 12Jan09
# Zeriab - change Filetest to Cache.character to see if file exists.
# Seph - modify the attr_reader method character name instead of
# directly changing the instance variable. (safer)
#
# ADDED: Change character set when running.
# create a running character set. Add "_dash" to the filename.
# e.g. 001-Fighter01.png & 001-Fighter01_dash.png
# checks for file, so it will work without one.
class Game_Character
alias_method :brew_dashing_gmchr_cn, :character_name
def character_name
s = brew_dashing_gmchr_cn.to_s
s += '_dash' if dashing?
return s
end
def dashing?
return @dashing
end
end
class Game_Player
attr_accessor :current_speed
alias brew_dash_init initialize
alias brew_dash_update update
def initialize
@current_speed = 4
brew_dash_init
end
def update
if Input.press?(Input::A)
@move_speed = 5 #set the fast speed here
if @move_speed != @current_speed
#check to see if dash file exists
begin
# Check that the graphics for the new character name actually exists
RPG::Cache.character(@character_name + "_dash", 0)
# Change it now that we know it exists
@dashing = true
rescue
# The dash graphics does not exist.
end
@current_speed = @move_speed
end
else
@move_speed = 4 #set the normal speed here
if @move_speed != @current_speed
#remove _dash from the graphic name if it exists
@dashing = false
@current_speed = @move_speed
end
end
brew_dash_update
end
end
Also, is there a way to temporarily disable a script such as this?(For availability on certain maps, and so that it doesn't mess up event move routes.)