The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX Ace => VXA Scripts Database => Topic started by: modern algebra on April 26, 2012, 05:09:33 PM

Title: [VXA] Stopped Actor Stepping Animation
Post by: modern algebra on April 26, 2012, 05:09:33 PM
Stopped Actor Stepping Animation
Version: 1.0
Author: modern algebra
Date: April 26, 2012

Version History



Description


This script allows you to set actors who will have a stepping animation when controlled as the player or on the map as a follower. It is useful for characters like flying actors who need to have a stepping animation even when stopped.

Features


Instructions

Paste this script into its own slot in the Script Editor, above Main but below Materials.

All that you need to do is specify which actors should have a stepping animation by placing the following code in an actor's notebox:

      \Step

Script


Code: [Select]
#==============================================================================
#    Stopped Actor Stepping Animation
#    Version: 1.0
#    Author: modern algebra (rmrk.net)
#    Date: April 26, 2012
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#   
#    This script allows you to set actors who will have a stepping animation
#   when controlled as the player or on the map as a follower. It is useful for
#   characters like flying actors who need to have a stepping animation even
#   when stopped.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#   
#    Paste this script into its own slot in the Script Editor, above Main but
#   below Materials.
#
#    All that you need to do is specify which actors should have a stepping
#   animation by placing the following code in an actor's notebox:
#
#        \Step
#==============================================================================

$imported ||= {}
$imported[:"MA_ActorStepping_1.0"] = true

#==============================================================================
# ** Game_Actor
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    new attr_writer - maas_step_anime=
#    new method - maas_step_anime
#==============================================================================

class Game_Actor
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_writer :maas_step_anime
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Step Animation?
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def maas_step_anime
    @maas_step_anime = !actor.note[/\\STEP/i].nil? if !@maas_step_anime
    @maas_step_anime
  end
end

#==============================================================================
# ** Game_Player
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - refresh
#==============================================================================

class Game_Player
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Refresh
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias maas_refresh_3jv8 refresh
  def refresh(*args, &block)
    maas_refresh_3jv8(*args, &block) # Call Original Method
    @step_anime = actor ? actor.maas_step_anime : false
  end
end

#==============================================================================
# ** Game_Follower
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - update_anime_count
#==============================================================================

class Game_Follower
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Update Animation Count
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias maas_updatanimcnt_4vx9 update_anime_count
  def update_anime_count(*args, &block)
    @step_anime = actor ? actor.maas_step_anime : false
    maas_updatanimcnt_4vx9(*args, &block) # Call Original Method
  end
end

Credit



Thanks


Support


Please post in this thread at RMRK if you have any questions or encounter any errors. Please do not PM me or start a new topic for support, no matter how old is this thread. The reason for that is that any question or problem you have is likely shared by others, and I would like whatever answer I can give to benefit as many people as possible by being both public and conveniently accessed.

Known Compatibility Issues

I am so far unaware of any compatibility issues.

Terms of Use


I adopt the Terms of Use for RMVXA Scripts Database (http://rmrk.net/index.php/topic,45481.0.html).
Title: Re: Stopped Actor Stepping Animation
Post by: Mushu on April 27, 2012, 03:53:03 AM
It works perfect, thank you MA! ;8
Title: Re: Stopped Actor Stepping Animation
Post by: oriceles on May 06, 2012, 07:48:08 PM
I was looking for this too. Thank you MA :D