03-16-2025, 04:32 AM
Simple Dashing
Version: 1.0
Version: 1.0
Introduction
This script merely adds the ability to increase the player's speed by one notch while keeping the speed-dash key depressed.
Features
- Define which maps may not permit dashing in a simple hash array
- Be able to use a script call to turn dashing off in general
- Run, Forest! Run!
Screenshots
No special graphics. No running graphics. It is merely a speed increase.
Demo
Too easy.
Script
Would you believe, I have TWO versions? I made one for those who use the RMXP SDK.
Non-SDK General Version
Code:
#==============================================================================
# ** Simple Dashing
#------------------------------------------------------------------------------
# by DerVVulfman
# version 1.0
# 03-15-2025 (mm/dd/yyyy)
# RGSS / RPGMaker XP
#------------------------------------------------------------------------------
# Based essentially on the dash mechanics from VXAce on up
#==============================================================================
#
# Introduction:
# =============
#
# This script merely adds the ability to increase the player's speed by one
# notch while keeping the speed-dash key depressed.
#
#------------------------------------------------------------------------------
#
# Usage:
# ======
#
# You can list maps within the Dashing module that disable the dash movement
# system. Or you can use the '$game_system.disable_dash = true' script call
# to make it disabled on all maps until removed.
#
# You only need to fill the DISABLED hash array with maps that do not permit
# dashing. While the example contains a Map#3 entry setting disabled false,
# it is unnecessary.
#
# As a bonus, you can configure which key binding controls the dash function
# on the keyboard/gamepad.
#
# functions. The instance of this class is referenced by $game_map.
#------------------------------------------------------------------------------
#
# Compatability:
# ==============
#
# Designed for RPGMaker XP. It does perform rewrites within the 'update' and
# the 'update_move' methods of Game_Character. But comments are present to
# show where the changes were made.
#
#------------------------------------------------------------------------------
#
# Terms and conditions:
# =====================
#
# Free for use. Just give due credit.
#
#==============================================================================
module Dashing
#----------------------------------------------------------------------------
DISABLED = {} # Do Not Touch
#----------------------------------------------------------------------------
# Defined Dash Key
DASH_KEY = Input::A # Input:: usually defines [Shift]/[X]
# List of maps
DISABLED[2] = true # Disables dashing on map 2
DISABLED[3] = false # Map 3 is not disabled
end
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
# This class handles data surrounding the system. Backround music, etc.
# is managed here as well. Refer to "$game_system" for the instance of
# this class.
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :disable_dash # timer working flag
alias booby initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
booby
@disable_dash = false
end
end
#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
# This class handles maps. It includes scrolling and passage determination
# functions. The instance of this class is referenced by $game_map.
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# * Get Whether Dash is Disabled
#--------------------------------------------------------------------------
def disable_dash?
# Return if game system dash disable is on
return true if $game_system.disable_dash
# Return map dash disabled condition if defined
return Dashing::DISABLED[@map_id] if Dashing::DISABLED.has_key?(@map_id)
# Return false if not defined
return false
#
end
end
#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
# This class deals with characters. It's used as a superclass for the
# Game_Player and Game_Event classes.
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Branch with jumping, moving, and stopping
if jumping?
update_jump
elsif moving?
update_move
else
update_stop
end
# If animation count exceeds maximum value
# * Maximum value is move speed * 1 taken from basic value 18
# - (The Edit ) ---------------------------------------------------------
if @anime_count > 18 - real_move_speed * 2
# - (The Edit ) ---------------------------------------------------------
# If stop animation is OFF when stopping
if not @step_anime and @stop_count > 0
# Return to original pattern
@pattern = @original_pattern
# If stop animation is ON when moving
else
# Update pattern
@pattern = (@pattern + 1) % 4
end
# Clear animation count
@anime_count = 0
end
# If waiting
if @wait_count > 0
# Reduce wait count
@wait_count -= 1
return
end
# If move route is forced
if @move_route_forcing
# Custom move
move_type_custom
return
end
# When waiting for event execution or locked
if @starting or lock?
# Not moving by self
return
end
# If stop count exceeds a certain value (computed from move frequency)
if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
# Branch by move type
case @move_type
when 1 # Random
move_type_random
when 2 # Approach
move_type_toward_player
when 3 # Custom
move_type_custom
end
end
end
#--------------------------------------------------------------------------
# * Update frame (move)
#--------------------------------------------------------------------------
def update_move
# Convert map coordinates from map move speed into move distance
# - (The Edit ) ---------------------------------------------------------
distance = 2 ** real_move_speed
# - (The Edit ) ---------------------------------------------------------
# If logical coordinates are further down than real coordinates
if @y * 128 > @real_y
# Move down
@real_y = [@real_y + distance, @y * 128].min
end
# If logical coordinates are more to the left than real coordinates
if @x * 128 < @real_x
# Move left
@real_x = [@real_x - distance, @x * 128].max
end
# If logical coordinates are more to the right than real coordinates
if @x * 128 > @real_x
# Move right
@real_x = [@real_x + distance, @x * 128].min
end
# If logical coordinates are further up than real coordinates
if @y * 128 < @real_y
# Move up
@real_y = [@real_y - distance, @y * 128].max
end
# If move animation is ON
if @walk_anime
# Increase animation count by 1.5
@anime_count += 1.5
# If move animation is OFF, and stop animation is ON
elsif @step_anime
# Increase animation count by 1
@anime_count += 1
end
end
#--------------------------------------------------------------------------
# * Get Move Speed (Account for Dash)
#--------------------------------------------------------------------------
def real_move_speed
@move_speed + (dash? ? 1 : 0)
end
#--------------------------------------------------------------------------
# * Determine if Dashing
#--------------------------------------------------------------------------
def dash?
return false
end
end
#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
# This class handles the player. Its functions include event starting
# determinants and map scrolling. Refer to "$game_player" for the one
# instance of this class.
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Determine if Dashing
#--------------------------------------------------------------------------
def dash?
return false if @move_route_forcing
return false if $game_map.disable_dash?
return Input.press?(Dashing::DASH_KEY)
end
end
RMXP SDK Version
Code:
#==============================================================================
# ** Simple Dashing (SDK edition)
#------------------------------------------------------------------------------
# by DerVVulfman
# version 1.0
# 03-15-2025 (mm/dd/yyyy)
# RGSS / RPGMaker XP
#------------------------------------------------------------------------------
# Based essentially on the dash mechanics from VXAce on up
#==============================================================================
#
# Introduction:
# =============
#
# This script merely adds the ability to increase the player's speed by one
# notch while keeping the speed-dash key depressed.
#
#------------------------------------------------------------------------------
#
# Usage:
# ======
#
# You can list maps within the Dashing module that disable the dash movement
# system. Or you can use the '$game_system.disable_dash = true' script call
# to make it disabled on all maps until removed.
#
# You only need to fill the DISABLED hash array with maps that do not permit
# dashing. While the example contains a Map#3 entry setting disabled false,
# it is unnecessary.
#
# As a bonus, you can configure which key binding controls the dash function
# on the keyboard/gamepad.
#
# functions. The instance of this class is referenced by $game_map.
#------------------------------------------------------------------------------
#
# Compatability:
# ==============
#
# Designed for RPGMaker XP. It does perform rewrites within the 'update_move'
# and the 'update_animation' methods of Game_Character. But there are comments
# to show where the changes were made.
#
#------------------------------------------------------------------------------
#
# Terms and conditions:
# =====================
#
# Free for use. Just give due credit.
#
#==============================================================================
module Dashing
#----------------------------------------------------------------------------
DISABLED = {} # Do Not Touch
#----------------------------------------------------------------------------
# Defined Dash Key
DASH_KEY = Input::A # Input:: usually defines [Shift]/[X]
# List of maps
DISABLED[2] = true # Disables dashing on map 2
DISABLED[3] = false # Map 3 is not disabled
end
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
# This class handles data surrounding the system. Backround music, etc.
# is managed here as well. Refer to "$game_system" for the instance of
# this class.
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :disable_dash # timer working flag
alias booby initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
booby
@disable_dash = false
end
end
#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
# This class handles maps. It includes scrolling and passage determination
# functions. The instance of this class is referenced by $game_map.
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# * Get Whether Dash is Disabled
#--------------------------------------------------------------------------
def disable_dash?
# Return if game system dash disable is on
return true if $game_system.disable_dash
# Return map dash disabled condition if defined
return Dashing::DISABLED[@map_id] if Dashing::DISABLED.has_key?(@map_id)
# Return false if not defined
return false
#
end
end
#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
# This class deals with characters. It's used as a superclass for the
# Game_Player and Game_Event classes.
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# * Frame Update : Animation Counters
#--------------------------------------------------------------------------
def update_animation
# If animation count exceeds maximum value
# * Maximum value is move speed * 1 taken from basic value 18
# - (The Edit ) ---------------------------------------------------------
if @anime_count > 18 - real_move_speed * 2
# - (The Edit ) ---------------------------------------------------------
# If stop animation is OFF when stopping
if not @step_anime and @stop_count > 0
# Return to original pattern
@pattern = @original_pattern
# If stop animation is ON when moving
else
# Update pattern
@pattern = (@pattern + 1) % 4
end
# Clear animation count
@anime_count = 0
end
end
#--------------------------------------------------------------------------
# * Update frame (move)
#--------------------------------------------------------------------------
def update_move
# Convert map coordinates from map move speed into move distance
# - (The Edit ) ---------------------------------------------------------
distance = 2 ** real_move_speed
# - (The Edit ) ---------------------------------------------------------
# If logical coordinates are further down than real coordinates
if @y * 128 > @real_y
# Move down
@real_y = [@real_y + distance, @y * 128].min
end
# If logical coordinates are more to the left than real coordinates
if @x * 128 < @real_x
# Move left
@real_x = [@real_x - distance, @x * 128].max
end
# If logical coordinates are more to the right than real coordinates
if @x * 128 > @real_x
# Move right
@real_x = [@real_x + distance, @x * 128].min
end
# If logical coordinates are further up than real coordinates
if @y * 128 < @real_y
# Move up
@real_y = [@real_y - distance, @y * 128].max
end
# If move animation is ON
if @walk_anime
# Increase animation count by 1.5
@anime_count += 1.5
# If move animation is OFF, and stop animation is ON
elsif @step_anime
# Increase animation count by 1
@anime_count += 1
end
end
#--------------------------------------------------------------------------
# * Get Move Speed (Account for Dash)
#--------------------------------------------------------------------------
def real_move_speed
@move_speed + (dash? ? 1 : 0)
end
#--------------------------------------------------------------------------
# * Determine if Dashing
#--------------------------------------------------------------------------
def dash?
return false
end
end
#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
# This class handles the player. Its functions include event starting
# determinants and map scrolling. Refer to "$game_player" for the one
# instance of this class.
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Determine if Dashing
#--------------------------------------------------------------------------
def dash?
return false if @move_route_forcing
return false if $game_map.disable_dash?
return Input.press?(Dashing::DASH_KEY)
end
end
Instructions
In the script.
FAQ
Its basically the same mechanics used within the RPGMaker line from RPGMaker VXAce on up.
Compatibility
There are edits to two methods within the Game_Character class, though there are differences between which methods for the two scripts (regular/SDK).
Terms and Conditions
Free for use. Just give due credit.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links