Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Slower speed, faster walk speed

I think this is quite simple. I'm trying to make it so that when the player climbs up a set of stairs, he is slowed down and moves up a few tiles. The problem is that I want to sustain (and perhaps speed up) his walking speed, and purely reducing speed reduces walking speed as well. Any help is appreciated, so...

Post away! :D
 
Go into Game_Character 1

Below class Game_Character, add
Code:
attr_accessor :move_speed

Now, to change the players move speed, use:
Code:
$game_player.move_speed = n

To change events move speed, use:
Code:
$game_map.events[event_id].move_speed = n
 
I know I have done this for Kraft before...

If you don't use the SDK:

Insert this above Main, below Game_Character
Code:
class Game_Character
  attr_accessor :animation_change_count
  alias_method :seph_animationchangecounter_gmchr_init, :initialize
  def initialize
    @animation_change_count = 18
    seph_animationchangecounter_gmchr_init
  end
end

Then, go into Game_Character 2, find:
Code:
    if @anime_count > 18 - @move_speed * 2

Change to:
Code:
    if @anime_count > @animation_change_count - @move_speed * 2

If you use the SDK, place this below the SDK and above Main (Suggest above all other scripts because it overwrites a method).

Code:
SDK.log('Character Sprite Animation Frame Change', 'SephirothSpawn', 0.1, '2007-07-18')
SDK.overwrite_log(:Game_Character, :update_animation)
class Game_Character
  attr_accessor :animation_change_count
  alias_method :seph_animationchangecounter_gmchr_init, :initialize
  def initialize
    @animation_change_count = 18
    seph_animationchangecounter_gmchr_init
  end
  #--------------------------------------------------------------------------
  # * Frame Update : Animation Counters
  #--------------------------------------------------------------------------
  def update_animation
    # If animation count exceeds maximum value
    # * Maximum value is move speed * 1 taken from basic value 18
    if @anime_count > @animation_change_count - @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
  end
end

Instructions for both:

To change players animation counter :
Code:
$game_player.animation_change_count = n

To change events animation counter:
Code:
$game_map.events[event_id].animation_change_count = n

Just change n to a number. The smaller it is, the more the sprite proceeds in frames. The bigger it is, the long it takes.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top