Raising the frequence of character animations while running

Started by Stray, September 16, 2012, 06:11:10 pm

Previous topic - Next topic

Stray

I want to set the default speed of my hero "4: fast" to the default speed for running in Blizz ABS.
But the sequence of the sprites are not played fast enough for the running animation.

So he should have the same speed, but a faster changing of the sprite.

(I'm sorry for my weird english, I hope it's understandable)
I'm very grateful to you all for your great help.

KK20

The frequency of how quickly the character's sprite changes is based on this formula located within Game_Character 2:
if @anime_count > 18 - @move_speed * 2
@anime_count increases by 1 for each frame the character is moving. It resets to zero when it is greater than the value on the right.

You didn't really specify how fast you want the sprites to change, so I cannot provide help. My suggestion is to change the 18 in that equation until it fits perfectly with your running animation and then report back here for further help.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Stray

This was a good help. Thank you. Just between 2 and 3 frames less were enough. :]
I'm very grateful to you all for your great help.

KK20

Paste below BABS and be sure to configure it.
Spoiler: ShowHide
module CharaSprites
 
  def self.frames(filename)
    case filename
  #===========================================================================
  # - CharaSprites.frames
  #     Set the number of frames that the sprite should run through before
  #   updating to the next image frame.
  #
  #     When setting names, be sure to use the image's filename as it appears
  #   in the folder 'Graphics\Characters'
  #
  #     Also note that the old equation remains: 18 - @move_speed * 2
  #   However, with this script, it allows you to change the '18' into whatever
  #   you want it to be.
  #===========================================================================
    when 'Aluxes_run' then return 15
    #when 'name' then return x
  #===========================================================================
  #
  # E N D   C O N F I G U R A T I O N
  #
  #===========================================================================
    else
      # Returns the default 18
      return 18
    end
  end
end

class Game_Character
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Branch with jumping, moving, and stopping
    if jumping?
      update_jump
    elsif moving?
      update_move
    else
      update_stop
    end
    # If animation count exceeds maximum value
    # * Maximum value is move speed * 1 taken from basic value 18
    if @anime_count > CharaSprites.frames(@character_name) - @move_speed * 2
      # If stop animation is OFF when stopping
      if not @step_anime and @stop_count > 0
        # Return to original pattern
        @pattern = @original_pattern
      # If stop animation is ON when moving
      else
        # Update pattern
        @pattern = (@pattern + 1) % 4
      end
      # Clear animation count
      @anime_count = 0
    end
    # If waiting
    if @wait_count > 0
      # Reduce wait count
      @wait_count -= 1
      return
    end
    # If move route is forced
    if @move_route_forcing
      # Custom move
      move_type_custom
      return
    end
    # When waiting for event execution or locked
    if @starting or lock?
      # Not moving by self
      return
    end
    # If stop count exceeds a certain value (computed from move frequency)
    if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
      # Branch by move type
      case @move_type
      when 1  # Random
        move_type_random
      when 2  # Approach
        move_type_toward_player
      when 3  # Custom
        move_type_custom
      end
    end
  end
end

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Stray

Thank you very much for telling how to shorten the running animation from the BABS, too.
That will be useful for sure!
I'm very grateful to you all for your great help.