Save-Point
Character's Dash Animation - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+--- Thread: Character's Dash Animation (/thread-8939.html)



Character's Dash Animation - kyonides - 04-08-2024

Character's Dash Animation

by Kyonides

Introduction

This is pretty much a plug & play script that will allow you to change the dash animation of the whole party. You must have an extra character spritesheet and name it something like "original_sheet1_dash.png", being "original_sheet1" the actual filename of the original actor spriteset. Then the script will switch from one to another in no time depending on the Dash button and any arrow key or its equivalent.

The Script

Code:
# * Character's Dash Animation * #
#  Scripter : Kyonides Arkanthes
#  2024-04-06

# You will need some extra character spritesheets to make it work.
# Their filenames should include the _dash suffix or they will be ignored.
# It will crash if you never move them in the Graphics/Characters directory.

class Game_Character
  def actor?
    false
  end
end

class Game_Player
  def actor?
    true
  end
end

class Game_Follower
  def actor?
    true
  end
end

class Sprite_Character
  DASH_SUFFIX = "_dash"
  alias :kyon_char_dash_anime_sprt_char_up_bit :update_bitmap
  def initialize(viewport, character=nil)
    super(viewport)
    @character = character
    @party_member = character.actor?
    @balloon_duration = 0
    update
  end

  def update_bitmap
    if @party_member
      bitmap_update
    else
      kyon_char_dash_anime_sprt_char_up_bit
    end
  end

  def bitmap_update
    dashing = $game_player.dash? && Input.dir4 > 0
    if graphic_changed? or dashing != @dashing
      @dashing = dashing
      @tile_id = @character.tile_id
      @character_name = @character.character_name
      @character_name += DASH_SUFFIX if !@character_name.empty? && @dashing
      @character_index = @character.character_index
      if @tile_id > 0
        set_tile_bitmap
      else
        set_character_bitmap
      end
    end
  end
end

Terms & Conditions

Free for use in ANY Gamer game.
Due credit is mandatory.
Tell Dog Wulfo he needs to improve his typing skills. Laughing
That's it! Tongue sticking out