Dash script incompatibility with Galv's Move Route Extras

Status
Not open for further replies.

Ebanyle

açspasl~d~dfflass
Veteran
Joined
Sep 2, 2016
Messages
328
Reaction score
184
First Language
Portuguese
Primarily Uses
RMVXA
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:
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
 

Ebanyle

açspasl~d~dfflass
Veteran
Joined
Sep 2, 2016
Messages
328
Reaction score
184
First Language
Portuguese
Primarily Uses
RMVXA

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
1,853
Reaction score
408
First Language
English
Primarily Uses
RMVXA
whenever I use set_char on the player,
What is the set_char command you are using and what is the sprite sheet filename for the player originally before you make the change?
 

Ebanyle

açspasl~d~dfflass
Veteran
Joined
Sep 2, 2016
Messages
328
Reaction score
184
First Language
Portuguese
Primarily Uses
RMVXA
It's a command in Galv's script that goes like this: set_char(filename, index, column, direction)
So now with what you said I think I've noticed some things...
The actor original graphic is called "Kimmy" and uses the first index in the charset. Here I changed it to "Kimmy_ex":

1579017815594.png

It properly changes to it, but when I change the index to 2 (set_char("Kimmy_ex",2,2,2)), it will actually pick just the same index as the original char. Like this:

1579018652573.png

(Apparently the "going invisible" thing was because I changed the graphics to a sprite in index 4, and since it was picking the char's original index, it was going invisible because in the spriteset I was using the index 4 is blank)
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
1,853
Reaction score
408
First Language
English
Primarily Uses
RMVXA
I've noticed some things
That's kind of what I was thinking. I have not used the script so I was not sure.
But Maybe you could use a new sprite sheet for when you make changes.
(set_char("Kimmy_ex_2",1,2,2)
 

A-Moonless-Night

WINTER IS COMING
Veteran
Joined
Mar 17, 2012
Messages
544
Reaction score
382
First Language
English
Primarily Uses
RMVXA
Untested, but try this:
Code:
class Game_Character < Game_CharacterBase
  alias amn_dash_gamechara_setchar  set_char
  def set_char(*args, &block)
    amn_dash_gamechara_setchar(*args, &block)
    @og_character_index = @character_index
    @dash_character_index = [@character_index + 2, 7].min
  end
end
Galv's code overwrites the way that characters and indexes are usually set.
 

Ebanyle

açspasl~d~dfflass
Veteran
Joined
Sep 2, 2016
Messages
328
Reaction score
184
First Language
Portuguese
Primarily Uses
RMVXA
That seems to have solved the issue, thank you once again!
 

hiddenone

Lurker Extraordinaire
Global Mod
Joined
Feb 19, 2014
Messages
2,103
Reaction score
4,808
First Language
english
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Oh, stop with the Melodrama...

...Listen to it instead!

anybody else like getting baked whilst coding?

When you go to the beach watch out for coconuts. Coconuts are more dangerous than sharks. Fact.
Try to get into pixelart again, so far its a sucess.
Also finally found a useful pixeltutorial which helps a lot.
♫ Anyone knows an ant can't move a rubber tree plant, but he's got high hopes, he's got high hopes, he's got high apple pie in the sky hopes ♫

Forum statistics

Threads
93,616
Messages
913,988
Members
123,181
Latest member
eloo
Top