Save-Point
Changing the walking animation - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Games Development (https://www.save-point.org/forum-4.html)
+--- Forum: Code Support (https://www.save-point.org/forum-20.html)
+--- Thread: Changing the walking animation (/thread-873.html)



Changing the walking animation - shadow040 - 01-08-2010

Hey I'm getting back into RPG maker after taking a couple of years of computing and I thought I'd try out some custom scripting, thing is I don't understand much about the language, but I'm sure over time I'll pick it up, it looks familiar.

Anyway onto my question, I've imported a character and assumed the first frame was the idle standing frame and the next three were walking frames, but this doesn't seem to be the case. Because of the way I have my character walking, by using the normal system he would have to be frozen mid-walking when he stopped.

In short: I want to make it so my characters only cycle through frames 2-4 while walking, preferably going 2-3-4-3-2-3-4-3 ect and only use frame 1 while standing.

Thanks in advance.


[Resolved] Changing the walking animation - jubhub731 - 01-08-2010

What i found out is that the walking cycle is standing right foot standing left foot and it goes through the cycle like normal .


[Resolved] Changing the walking animation - shadow040 - 01-08-2010

jubhub731 Wrote:What i found out is that the walking cycle is standing right foot standing left foot and it goes through the cycle like normal .
But I'd like to code it so it didn't work like that, I want it to be in frame 1 while idle and then cycle through like 2-3-4-3-2 when moving, I want to know where about in the code to change that


[Resolved] Changing the walking animation - Lunarea - 01-09-2010

You'll have an easier time having an "idle" script. It essentially calls for a different graphic sheet for the idle pose whenever the player isn't pushing the directional buttons. You can also have an animated idle pose with it. I'd offer the one I'm currently asking, but the author asked me to not distribute it. I can tell you that it's a fairly simple code snippet :)


[Resolved] Changing the walking animation - shadow040 - 01-09-2010

Lunarea Wrote:You'll have an easier time having an "idle" script. It essentially calls for a different graphic sheet for the idle pose whenever the player isn't pushing the directional buttons. You can also have an animated idle pose with it. I'd offer the one I'm currently asking, but the author asked me to not distribute it. I can tell you that it's a fairly simple code snippet :)

Oh that sounds great, if you cant tell me it could you tell me the person to ask about it?


[Resolved] Changing the walking animation - Lunarea - 01-09-2010

I'll see if I can get in touch with her. I talked with her on a different forum, but haven't seen her in a while.


[Resolved] Changing the walking animation - shadow040 - 01-13-2010

I'm still looking for this if anyone could provide assistance


[Resolved] Changing the walking animation - DerVVulfman - 01-20-2010

Found an old script by Yeyinde floating around my hard drive:

Code:
#==============================================================================
# ** Miniscript: Character Animation
#------------------------------------------------------------------------------
#  By Yeyinde (August 14, 2006)
#  This is just a little script that changes the way a characterset animations
#  plays.  It makes the first frame an 'idle pose', and uses the next three
#  frames as the animation (Much like in RM2K).
#
#  Insert the code above Main:
#
#==============================================================================


#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
#  This class deals with characters. It's used as a superclass for the
#  Game_Player and Game_Event classes.
#==============================================================================

class Game_Character
  alias old_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    old_initialize
    @pattern_count = 0
  end
  #--------------------------------------------------------------------------
  # * 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 > 18 - @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
        @pattern_count = 0
      # If stop animation is ON when moving
      else
        # Update pattern
        @pattern_count = (@pattern_count + 1) % 4
        case @pattern_count
        when 0
          @pattern = 2
        when 1
          @pattern = 1
        when 2
          @pattern = 2
        when 3
          @pattern = 3
        end
      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

Enjoy


[Resolved] Changing the walking animation - shadow040 - 01-30-2010

DerVVulfman Wrote:Found an old script by Yeyinde floating around my hard drive:

Code:
#==============================================================================
# ** Miniscript: Character Animation
#------------------------------------------------------------------------------
#  By Yeyinde (August 14, 2006)
#  This is just a little script that changes the way a characterset animations
#  plays.  It makes the first frame an 'idle pose', and uses the next three
#  frames as the animation (Much like in RM2K).
#
#  Insert the code above Main:
#
#==============================================================================


#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
#  This class deals with characters. It's used as a superclass for the
#  Game_Player and Game_Event classes.
#==============================================================================

class Game_Character
  alias old_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    old_initialize
    @pattern_count = 0
  end
  #--------------------------------------------------------------------------
  # * 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 > 18 - @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
        @pattern_count = 0
      # If stop animation is ON when moving
      else
        # Update pattern
        @pattern_count = (@pattern_count + 1) % 4
        case @pattern_count
        when 0
          @pattern = 2
        when 1
          @pattern = 1
        when 2
          @pattern = 2
        when 3
          @pattern = 3
        end
      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

Enjoy
Thank you so much, this really helps