Hello~ So last month I asked here for a correction of a dash script I was using, and A-Moonless-Night helped me by creating a new dash script.
However, what I didn't notice is that her script has a clash with another one I'm using, Galv's Move Route Extras.
The problem is, whenever I use set_char on the player, the sprite will go transparent instead of changing the graphic to the one I selected.
While I could use a dummy character instead of the player, it would be kinda troublesome since I use that command a lot.
Here's the dash script:
However, what I didn't notice is that her script has a clash with another one I'm using, Galv's Move Route Extras.
The problem is, whenever I use set_char on the player, the sprite will go transparent instead of changing the graphic to the one I selected.
While I could use a dummy character instead of the player, it would be kinda troublesome since I use that command a lot.
Here's the dash script:
Ruby:
# By A-Moonless-Night
class Game_CharacterBase
attr_reader :og_character_index, :dash_character_index
alias amn_dash_gamecharabase_initpubmems init_public_members
def init_public_members
amn_dash_gamecharabase_initpubmems
@og_character_index = @character_index
@dash_character_index = [@character_index + 2, 7].min
end
alias amn_dash_gamecharabase_setgraphic set_graphic
def set_graphic(character_name, character_index)
amn_dash_gamecharabase_setgraphic(character_name, character_index)
@og_character_index = character_index
@dash_character_index = [character_index + 2, 7].min
end
def update_chara_index(index)
@character_index = index
end
end
class Game_Player < Game_Character
alias amn_dash_gameplayer_refresh refresh
def refresh
if actor && !dash?
@og_character_index = actor.character_index
@dash_character_index = [actor.character_index + 2, 7].min
end
amn_dash_gameplayer_refresh
end
end
class Game_Follower < Game_Character
alias amn_dash_gamefollower_refresh refresh
def refresh
if visible? && !$game_player.dash?
@og_character_index = actor.character_index
@dash_character_index = [actor.character_index + 2, 7].min
end
amn_dash_gamefollower_refresh
end
end
class Sprite_Character < Sprite_Base
alias amn_dash_spritechara_update update
def update
amn_dash_spritechara_update
if @character.is_a?(Game_Player) || @character.is_a?(Game_Follower)
update_dash_anim if $game_player.moving? && $game_player.dash?
update_nondash_anim if !$game_player.moving? && !$game_player.dash?
end
end
def update_nondash_anim
if @character.character_index != @character.og_character_index
@character.update_chara_index(@character.og_character_index)
end
end
def update_dash_anim
if @character.character_index != @character.dash_character_index
@character.update_chara_index(@character.dash_character_index)
end
end
end