Party members Run Animation (SOLVED)

Hello there, i'm new with RGSS3 so i have a problem 😛

In my project i have decide some features:
 

8 Direction Movement

Run Animation

For 8 dir movement i use:

8 Dir Move JV Master Script

Spoiler
#==============================================================================

# 8 Dir Move                                                  JV Master Script

#------------------------------------------------------------------------------

# Make player move in 8 dir, supports diagonal pattern.

#==============================================================================

 

module JvScripts

  module Dirs8

    

    Switch = 0               # Switch id for toggle 4/8 dir, 0 if always 8 dir

    DiagonalSuffix = "_8d"   # Suffix for 8 dir charsets

                             # 8 dir charsets include in the first char

                             # the orthogonal and in the second the diagonal

  end

end

 

#==============================================================================

# Game CharacterBase

#==============================================================================

class Game_CharacterBase

  

  def move_diagonal(horz, vert)

    @move_succeed = diagonal_passable?(x, y, horz, vert)

    if @move_succeed

      @x = $game_map.round_x_with_direction(@x, horz)

      @y = $game_map.round_y_with_direction(@y, vert)

      @real_x = $game_map.x_with_direction(@x, reverse_dir(horz))

      @real_y = $game_map.y_with_direction(@y, reverse_dir(vert))

      increase_steps

    end

    if diagonal_charset?

      set_direction_diagonal(horz, vert)

    else

      set_direction(horz) if @direction == reverse_dir(horz)

      set_direction(vert) if @direction == reverse_dir(vert)

    end

  end

  

  def set_direction(d)

    if !@direction_fix && d != 0

      @direction = d

      @character_index = 0 if diagonal_charset?

    end

    @stop_count = 0

  end

  

  def set_direction_diagonal(horz, vert)

    if !@direction_fix && horz != 0 && vert != 0

      if horz == 4 && vert == 2

        @direction = 2

      elsif horz == 4 && vert == 8

        @direction = 4

      elsif horz == 6 && vert == 2

        @direction = 6

      elsif horz == 6 && vert == 8

        @direction = 8

      end

      

      @character_index = 1

    end

    @stop_count = 0

  end

  

  def diagonal_charset?

    true if @character_name.include?(JvScripts:😀irs8:😀iagonalSuffix)

  end

end

 

#==============================================================================

# Game Player

#==============================================================================

class Game_Player < Game_Character

  def move_by_input

    return if !movable? || $game_map.interpreter.running?

    if JvScripts:😀irs8::Switch > 0

      if $game_switches[JvScripts:😀irs8::Switch] == true

        case Input.dir8

        when 2, 4, 6, 8

          move_straight(Input.dir4)

        when 1

          move_diagonal(4, 2)

        when 3

          move_diagonal(6, 2)

        when 7

          move_diagonal(4, 8)

        when 9

          move_diagonal(6, 8)

        end

      else

        move_straight(Input.dir4) if Input.dir4 > 0

      end

    else

      if Input.dir8 > 0

        case Input.dir8

        when 2, 4, 6, 8

          move_straight(Input.dir4)

        when 1

          move_diagonal(4, 2)

        when 3

          move_diagonal(6, 2)

        when 7

          move_diagonal(4, 8)

        when 9

          move_diagonal(6, 8)

        end

      end

    end

  end

end

#==============================================================================

 
For run animation i use:

Dont know the name is this:

Spoiler
#==============================================================================

# ** Sprite_Character

#------------------------------------------------------------------------------

#  This sprite is used to display characters. It observes an instance of the

# Game_Character class and automatically changes sprite state.

#==============================================================================

 

class Sprite_Character < Sprite_Base

  #--------------------------------------------------------------------------

  # * OVERWRITE Update Transfer Origin Bitmap

  # Still "works" if this was aliased instead but the sprite graphic

  # would flash, since it would change to the default/non prefixed graphic

  # then back to the the one with the prefix.

  #--------------------------------------------------------------------------

  def update_bitmap

    update_dash

    if graphic_changed?

      @tile_id = @character.tile_id

      @character_name = @character.character_name if [email protected]?

      @character_index = @character.character_index

      if @tile_id > 0

        set_tile_bitmap

      else

        set_character_bitmap

      end

    end

  end

  #--------------------------------------------------------------------------

  # * Adds "_dash" prefix to sprite if dashing

  #--------------------------------------------------------------------------

  def update_dash

    return unless @character.moving?

    return unless @character.dash?

    @character_name = @character.character_name + "_run"

  end

end
 

Everything is perfect the only thing who don't work is the Party Members, they follow hero, in diagonal and the sprite change correctly, BUT when the Hero Run, they don't change graphic like him with the RUN animation.

 

How can i fix it?

I have also try others script who include "sprite" change during RUN but it works only in 4 directions.

 

Thank you!
Best
Lakaroth
Try adding this below those scripts:

class Game_Follower < Game_Character def dash? $game_player.dash? endendNot tested. It may need to be changed to compare speed instead, but give it a try. 🙂
He got me an error:

Unable to find file:

Graphics/Character/_run

I think we are close enaugh to the solution, on the other script he add a suffix:

def update_dash return unless @character.moving? return unless @character.dash? @character_name = @character.character_name + "_run" endendI'm not able to code, but i think the problem is that!

Thanks for now!
Oh, you are right:

class Game_Follower < Game_Character def dash? visible? && $game_player.dash? endendUse that instead. And be sure the correct Graphic is available. Let me know how that goes 🙂
Thank you again for your support... This is the error that i got:

error.jpg
There was a little typo with the previous code, it should be:

class Game_Follower < Game_Character def dash? visible? && $game_player.dash? endendThe ? sign slipped before. 😀
Oh thanks! S0rry i cant understand even the simple syntax for me it's impossible.

Now it works, there's no error, BUT the followers are more fast than the hero, so the effect is not good, it seems de hit him!

We are almost at the end to solve, thanks for your support and patience.

(You will be in my credits)
class Game_Follower < Game_Character def dash? visible? && $game_player.dash? end def real_move_speed @move_speed endendThat should fix that. Try that and let me know what happens. 🙂
Now that's PERFECT!!!
You are really amazing... thank you so much, i'm ready to do everything and start to make my game.
And you will be in credits!

I will not take advantage of your availability, but i have only One problem left for my project, then i can really start.

I have post here, maybe you know the solution 😛

Anyway, thank you so much, you will be in credits!
And well... i'm a good designer so if you need an help with graphics or pixel art let me know 🙂

All the best!
Now that's PERFECT!!!

You are really amazing... thank you so much, i'm ready to do everything and start to make my game.

And you will be in credits!

I will not take advantage of your availability, but i have only One problem left for my project, then i can really start.

I have post here, maybe you know the solution 😛

Anyway, thank you so much, you will be in credits!

And well... i'm a good designer so if you need an help with graphics or pixel art let me know 🙂

All the best!
Thanks for the kind words and the offer! You're welcome. 🙂

I'll take a look at that topic.

Original thread: https://forums.rpgmakerweb.com/threads/party-members-run-animation-solved.35357/