spritesheet movement

Started by diagostimo, February 16, 2012, 10:59:15 pm

Previous topic - Next topic

diagostimo

hey, im wondering if it exists or if anyone could make a script that overrides the animation when moving, basicly i want it to loop the three movement animations and cut out the stationary pose until you stop moving like so:
Spoiler: ShowHide
.
i need this as i have a few wierd sprites that slightly bend over when moving, so when it returns to the stationary pose it seems to jerk, i also feel like this would make the movement more fluent, if anyone could direct me to a script that does this i would be very grateful and give credits, thanks :D

Taiine

So you want a default standing sprite and the rest for walking? You could use a script that will just change the char set to a standing one when your not moving. Then you could use the whole tile set for a standing animation, blinking or shifting or what not.

diagostimo

February 17, 2012, 01:23:05 pm #2 Last Edit: February 17, 2012, 01:26:05 pm by diagostimo
no what im asking for is a way to change the way a prite sheet is interpreted, say you go from standing phase to left foot then standing then right foot then repeat, i want it to go left foot stand right foot then repeat, if you get what i mean  :huh: so that it will cancel out the left standing sprite on the spritesheet while moving

edit: actually what you said will work, just means a lot of messing with sprites, do you know of a possible script?

Taiine

Well BABS I think does it. If you look around for 'idle animation' scrips you'll find them.

ah I have this one.

Spoiler: ShowHide
#==============================================================================
# ** Night_Runner's Stopped Animation Script
#------------------------------------------------------------------------------
# Created for: Kinger556
#  @> http://www.rpgrevolution.com/forums/index.php?showtopic=39216
# Date Created: 9/Feb/10
#
# Description:
#  This script is designed to give characters a stopped animation from a
#   different character set, if the character set exists.
#==============================================================================



#==============================================================================
# Start Customization
#==============================================================================

module NR_WalkingAnim
  APPEND = "_Still"       # E.g. character name is "001-Fighter01_Still.png"
  TIME_TILL_ANIMATION = 2 # frames
end

#==============================================================================
# End Customization
#==============================================================================



#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
#  Edited to make character_name and step_anime editable
#==============================================================================

class Game_Character
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :character_name           # character file name
  attr_accessor :step_anime               # character stepping
end



#==============================================================================
# ** Sprite_Character
#------------------------------------------------------------------------------
#  Edited to have a still animation.
#==============================================================================

class Sprite_Character < RPG::Sprite
  #--------------------------------------------------------------------------
  # * Alais Methods
  #--------------------------------------------------------------------------
  alias nr_walkinganim_initialize initialize
  alias nr_walkinganim_update update
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(*args)
    nr_walkinganim_initialize(*args)
    begin
      RPG::Cache.character(@character.character_name +
                              NR_WalkingAnim::APPEND.to_s, 0)
      @still_anim_exists = true
    rescue
      @still_anim_exists = false
    end
    @since_move = 0
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update(*args)
    if !@character.moving? and @still_anim_exists
        old_name = @character.character_name.dup
      @since_move += 1
      if @since_move > NR_WalkingAnim::TIME_TILL_ANIMATION
        @character.character_name += NR_WalkingAnim::APPEND.to_s
        @was_step_anim = @character.step_anime if @was_step_anim.nil?
        @character.step_anime = true
      end
    else
      @since_move = 0
      unless @was_stop_anim.nil?
        @character.step_anime = @was_step_anime
        @was_step_anime = nil
      end
    end
    nr_walkinganim_update(*args)
    @character.character_name = old_name unless old_name.nil?
  end
end



#==============================================================================
# End Of Script
#==============================================================================

diagostimo

thanks so much that is perfect :D

diagostimo

February 20, 2012, 12:26:11 am #5 Last Edit: February 20, 2012, 01:07:56 am by diagostimo
bump, i have a problem with this script, it seams to overide bush flags  :???:
edit: sorry, i realized that my image had a big gap between the bottom of my sprite and the frame, again sorry my bad :D