Dash Animation
Version: 1.0
Author: modern algebra
Date: August 11, 2008
Version History
- <Version 1.0> Original Script
Description
This script allows you to set a dash sprite to your player character, so that when the player is dashing, the graphic changes to that new sprite.
Features
- Automatically changes the graphic of the main character when dashing
- Easy to customize which graphic it changes too - just the one with the same name as the current one with the addition of '_run' at the end of the name.
Screenshots
Not necessary or relevant as it is an action script.
Instructions
See inside script header.
Script
#==============================================================================
# Dash Animation
# Version 1.0
# Author: modern algebra (rmrk.net)
# Date: August 11, 2008
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Description:
# This script allows you to set a dash sprite to your player character, so
# that when the player is dashing, the graphic changes to that new sprite.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Instructions:
# First, you will have to ensure that the character graphic you use for the
# player must have a corresponding Character Set with the same name and _run
# appended. So, if you are using the Character Set Actor1 for your main
# character, you need to have his dash sprite in the corresponding index of
# the graphic Actor1_run. It is necessary that a _run file exists for every
# character that you will use as a lead character.
#
# Simply scroll down to line 34 and set RUN_ANIM_SWITCH_ID to the ID of the
# switch that you want to use as a toggle for this script. Then, to make it
# so that your character set will change when you dash, all you need to do is
# turn on that switch.
#==============================================================================
# ** Game_Character
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Summary of Changes:
# new constant - RUN_ANIM_SWITCH_ID
# aliased method - update_animation
#==============================================================================
class Game_Character
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Constant
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RUN_ANIM_SWITCH_ID = 1 # This sets a switch as a toggle for this script.
# A run animation will only be dispayed if the switch
# that you set is ON
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Update Animation
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_run_grphc_anim_upd_dash_rasta_md73 update_animation
def update_animation
# If the Switch is ON and
if $game_switches[RUN_ANIM_SWITCH_ID]
# Set a boolean to track when graphics are switched
@chng_graf = true if @chng_graf.nil?
if dash? # If dashing
# Change Graphic once and only once
if @chng_graf
set_graphic (@character_name + "_run", @character_index)
end
@chng_graf = false
elsif !@chng_graf # Change Graphic once and only once
orig_name = @character_name[0, @character_name.size - 4]
set_graphic (orig_name, @character_index)
@chng_graf = true
end
end
# Run Original Method
modalg_run_grphc_anim_upd_dash_rasta_md73
end
end
Credit
Support
Just post here for the swiftest response
Known Compatibility Issues
Not compatible with Composite Character Graphics script
Demo
Not necessary.
This script by
modern algebra is licensed under a
Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.