Help - Search - Members - Calendar
Full Version: Can I change my Unarmed animation for my characters?
RPG RPG Revolution Forums > Game Engines > RPG Maker VX Discussion
Bandito
Does the unarmed animation (for a character that does not have a weapon),always has to be the first slot in the animation tab in the database or is there a way to change it? I am using the DBS with no scripts used at all. I am using rpgmaker vx.

Like for example CharA is not using a weapon but I want his unarmed animation to be different from charB unarmed animation. That could be because charA has human hands and charB has fangs for example.
Jens of Zanicuud
You can, you just have to simply modify a couple lines in the script editor:

Add this snippet inside the Materials section:

CODE
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Invariables
  #--------------------------------------------------------------------------
  #fille the hash this way:
  #UNARMED_ANIME_ID = {
  #actor id => unarmed animation id,
  #actor id => unarmed animation id,
  #actor id => unarmed animation id,
  #[add as many actors as you want]
  #}
  #if you don't insert an actor in this hash, his/her animation will be
  #the default unarmed animation
   UNARMED_ANIME_ID = {
   1 => 7,
   2 => 12,
   }
  #--------------------------------------------------------------------------
  # * Get Normal Attack Animation ID
  #--------------------------------------------------------------------------
  def atk_animation_id
    anime_id = 1
    anime_id = UNARMED_ANIME_ID[self.id] if UNARMED_ANIME_ID.include?(self.id)
    if two_swords_style
      return weapons[0].animation_id if weapons[0] != nil
      return weapons[1] == nil ? anime_id : 0
    else
      return weapons[0] == nil ? anime_id : weapons[0].animation_id
    end
  end
end


I hope this can help,

Jens
Bandito
It works perfect thank you. I am going to include in the credits btw.
Jens of Zanicuud
I'm glad I could be of any help
Thank you, if you need some further little help, just ask smile.gif

Jens
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.