Galv’s Character Animations V.2.1

Demo – Version 1.7 > (Demo uses older version)

#------------------------------------------------------------------------------#
#  Galv's Character Animations
#------------------------------------------------------------------------------#
#  For: RPGMAKER VX ACE
#  Version 2.0
#------------------------------------------------------------------------------#
#  2017-03-11 - Version 2.1 - Don't update idle time while event running
#  2013-01-24 - Version 2.0 - Significant changes for performance increase.
#  2013-01-07 - Version 1.7 - Slight tweaks
#  2012-10-06 - Version 1.6 - Updated alias names for compatibility
#  2012-10-06 - Version 1.5 - Added dash speed option. Fixed some code
#  2012-09-21 - Version 1.4 - Optimised the code significantly (to my ability)
#                           - Some bug fixes
#  2012-09-21 - Version 1.3 - Added ability to repeat common event
#                           - Added follower animations
#  2012-09-20 - Version 1.2 - fixed compatibility with Galv's Region Effects
#  2012-09-20 - Version 1.1 - added idle common event, removed unnecessary code
#  2012-09-20 - Version 1.0 - release
#------------------------------------------------------------------------------#
#  Designed to give actors additional animations such as:
#  - Idle
#  - Walking
#  - Dashing
#  - Custom (run a common event if you've been idle for a period of time)
#
#  INSTRUCTIONS:
#  1. Copy this script below materials and above main
#  2. Create your charsets to use one characterset per actor. (This is where
#     version 2 differs from version 1 greatly.
#     The first character in the charset is the Idle animation
#     The second character in the charset is the Walk animation
#     The third character in the charset is the Dash animation
#
#  (See demo if you don't understand) This change was done to reduce processing
#  significantly and prevent lag when doing too much at once)
#
#------------------------------------------------------------------------------#
#  KNOWN ISSUES:
#  - Move Route Change graphic commands only work when the switch is on.
#    Then if you turn it off again, the graphic changes back to the original.
#    Use "Set Actor Graphic" event command to change instead.
#------------------------------------------------------------------------------#
 
($imported ||= {})["Chara_Anims"] = true
module Chara_Anims
   
#------------------------------------------------------------------------------#  
#  SETUP OPTIONS
#------------------------------------------------------------------------------#
 
  ANIM_SWITCH = 1             # ID of a switch to disable this effect.
                              # Turn switch ON in order to use change graphic
                              # move route commands. Turn off to restore anims.
                               
  DASH_SPEED = 1.2            # 1 is RMVX default dash speed.
 
  COMMON_EVENT = 1            # Common event ID that plays after a certain time
  COMMON_EVENT_TIME = 100     # Frames idle before common event called.
  REPEAT_EVENT = false        # Repeat this common event if player remains idle?
                              # (restarts the common event time) true or false.
#------------------------------------------------------------------------------#  
#  END SETUP OPTIONS
#------------------------------------------------------------------------------#
 
end # Chara_Anims
 
 
class Sprite_Character < Sprite_Base
  alias galv_charanim_initialize initialize
  def initialize(viewport, character = nil)
    @idletime = 0
    galv_charanim_initialize(viewport, character)
  end
 
  alias galv_charanim_update update
  def update
    galv_charanim_update 
    return if $game_switches[Chara_Anims::ANIM_SWITCH]
    return move_anim if $game_player.moving?
    @idletime += 1 if !$game_map.interpreter.running?
    idle_anim if @idletime == 5
    idle_event if @idletime == Chara_Anims::COMMON_EVENT_TIME
  end
 
  def idle_anim
    $game_player.step_anime = true
    if $game_party.leader.character_index != 0
      $game_party.battle_members.each { |m| m.set_g(0) }
      $game_player.refresh
    end
    @idletime += 1
  end
 
  def move_anim
    if $game_player.dash?
      if $game_party.leader.character_index != 2
        $game_party.battle_members.each { |m| m.set_g(2) }
        $game_player.refresh
      end
    else
      if $game_party.leader.character_index != 1
        $game_party.battle_members.each { |m| m.set_g(1) }
        $game_player.refresh
      end
    end
    @idletime = 0
  end
 
  def idle_event
    return @idletime = 0 if $game_map.interpreter.running?
    $game_temp.reserve_common_event(Chara_Anims::COMMON_EVENT)
    @idletime = 0 if Chara_Anims::REPEAT_EVENT
  end
end # Sprite_Character < Sprite_Base
 
 
class Game_CharacterBase
  alias galv_charanim_init_public_members init_public_members
  def init_public_members
    galv_charanim_init_public_members
    @step_anime = true
  end
   
  # OVERWRITE FOR PERFORMANCE PURPOSES
  def real_move_speed
    @move_speed + (dash? ? Chara_Anims::DASH_SPEED : 0)
  end
end # Game_CharacterBase
 
 
class Game_Actor < Game_Battler
  def set_g(i)
    @character_index = i
  end
end # Game_Actor < Game_Battler
 
 
class Game_Player < Game_Character
  attr_accessor :step_anime
end # class Game_Player < Game_Character
Advertisements

53 thoughts on “Galv’s Character Animations V.2.1

  1. Goose says:

    I get the following error: “Script ‘Galv Character Animations’ line 86: NoMethodError occured.

    undefined method ‘character_index’ for nil:NilClass”

  2. Sesam says:

    This script is really easy to use and it works great! I just have one little bug? Whenever I use a switch in a map, as long as the switch is turned on, only the idle animation will display (also while moving). As soon as the switch is turned off, everything works fine again. Is this normal, or is there a way to work around it or prevent it?

    • Galv says:

      You set a switch in the settings and use that switch to enable/disable the script. Don’t use that switch or change the number in the settings to use a different one…

  3. Gety says:

    The script is awesome but I’d like to know how to change the speed of idle animation because I want to make my character breathing when he is idle and he is breathing too fast. Thanks for creating this script, keep up the good work!

    • Galv says:

      That functionality it not part of the script, I recommend you ask in rpgmaker forums

      • Gety says:

        I don’t think anyone in the forums would know more about your script than you do, would it be possible to modify it so you can change the speed of stepping animation, like you did with the dash animation?

      • Galv says:

        Yes it is possible but I just don’t have time to modify my scripts every time someone asks (which is a lot). I’m sorry. Which is why I recommended ask someone else.

  4. Gety says:

    That is true, I am sorry for asking…
    Thank you for the reply, have a nice day!

  5. Heather says:

    Hello, thank you for sharing the script. I only have to put it into Materials, right? As for the future, can I also assume that you put these scripts into materials unless said otherwise?

  6. Pinkamena666 says:

    Is there a way to make it so that it only works on certain characters? Because my main character uses the “$” symbol so the character set has only one as opposed to eight.

  7. Lakaroth says:

    Great script! It’s possible set a little distance from party members? They are so close each others…
    It must be great!
    Best

  8. Basic Leader says:

    Hi Galv! Thanks for your awesome scripts, I mostly use only yours since I’ve started working on my game. Just wanted to know if you know of any compatibility issue between the older version of this script and the character effects. I need to use the older version since I haven’t found a way to make Raizen’s multi-frames script with the new all-in-one charset of version 2. I get an error line 720 of character effects script every time I’ve got the older version of your character animation script in the game; if I take the animation script off the game, the error is gone but of course, I lose all my charset anims! Hope you can give me a hint of where to look for a tweak on your older version. Thanks a lot! (even if you can’t! hahaha)

    • Galv says:

      Unfortunately I dont have time to fix this issue – I am not sure why it would be happening, though. Try putting the character effects below this one

      • Basic Leader says:

        No problem! Thanks for offering me a solution, I’ll check it out as soon as I get back on my making computer!

      • Basic Leader says:

        I managed to get a good result for the shadows of NPC events, and I thinking I can get something for the main player, but I realized with the NPC event graphics that it doesn’t fit my charset (bigger and really 2-legged animation characters) But I keep this option on the side for now, and will come back to it later! Thanks again for your time!!! =))

  9. V. says:

    Hi! I try use it with other your script Galv’s Character Effects, but its give me error line 33. Is impossible use together? (Sorry, Im russian. My english is not so good ).

  10. V. says:

    Thank you for idea, but is will not work. Because, for example I take your demo Galv’s Character Effects, and put inside it Animations from here… Of course I was try change position of it in script list, but is not work together yet. All the time similar problem. I also was started new project (just for test), was try in mine project, and in your demo with Character Effect. Dont work together :)

  11. V. says:

    No no :) Is not work correct. I was mean its work if I delete line “Delete event”. Means as if its impossible use events… Btw maybe you can fix it? Really so good scripts, and so sad is dont work correct. I understand, you busy with your own project (I was read comments lol), but if you will have free time…

  12. alex jarvis says:

    Hello, I am using your scripts in a game I have been working on for two years now; and I just wanted to let you know that I will be going to kickstarter sometime soon.

    When that day comes I wanted to give you a free copy of the game, your name in the credits, plus any other plugs you would like in the credits, and other goodies for your scripting work, and for allowing me to use it in my game.

    Here is the list of your scripts I am using:

    Character Animations 2

    Variable Timer Functions – I am just using this for the graphic not all the other stuff

    If for some reason there is an issue with me using any of these scripts in my commercial game let me know.

  13. CielMeurtrier says:

    I found a bug. When the player becomes idle for more than a few seconds, the save menu appears. This kind of ruined my project being its save feature disabled to let the player save in certain points. I have also tried making another copy of my project and then deleting script. The bug is gone. Is there a way to fix this?

    • Galv says:

      It’s not a bug, you need to read the script settings.
      COMMON_EVENT = 1 # Common event ID that plays after a certain time
      I am guessing that your common event #1 calls the save command. Change this to a different common event or make it 0 if you dont want to use it.

  14. Globlok154 says:

    Hey, Galv, Do you Need to Name the Charater Sets a Certin Name? Cos i Just Found this Script and i REALLY wanna use it,

    • Galv says:

      Have a read of the text at the top of the script, it will explain what you need. Also check out the demo for a working example.

  15. I keep getting these errors saying:”Dispossed Sprite” any suggestions?

  16. sparklesonic says:

    I love the script! There is one thing that i dont like though. I dont like how the charcter bobs from side to side in the animations, is there any way to fix this? (btw i tried without the script and its not my sprite sheet it is the script)

    • Galv says:

      I recommend doing some more tests as it’s not the script.

      Test the demo (link is at the top above the script code). If you test your sprite sheet in the demo and it still happens, I think it is your spritesheet.

      If it only happens in your project it might be a script conflict

  17. sparklesonic says:

    Hi, its me again, and i was wondering if you know a way to make battle animations for the characters! Thanks for the help
    if you figure it out!

    • Galv says:

      Not sure what you mean. Sideview plugins usually allow using different frames for battle animations.

      • sparklesonic says:

        if its any help to answering this question im using jets side view system.

      • Galv says:

        Unfortunately no help – I’m not sure what you mean by ‘battle animations’.

        Jets side view can show a row for animation depending on skill used. Or you could use the database animations and set up animation sheets with your characters.

  18. invark says:

    Hello Galv!
    Fristly, i’m sorry for my bad english.
    I found a bug.
    When you are reading a dialog box for a long time after the Idle Common Event is activated, is there any way to avoid it without doing without it? I am interested in the Common Event function.

    Thanks! :D

    • Galv says:

      I just noticed after checking that the demo download still had version 1.7. Grab the script from the page, it is the latest version 2.0 which should fix that issue.

  19. Galv says:

    Seemed the idle timer kept ticking but reset if it was reached while an event was active. I updated to 2.1 to make the idle timer not tick during events. Hopefully that fixed it.

  20. Jak says:

    Hey Galv I hope you see this. my name is Jak I make YouTube videos mainly but I some times work on small time RPG maker vx ace games. I constantly have ideas for new projects but I have a few that I think could be something. So I would like to make these games but to be honest I’m very bad at maker tilesets, animations, graphics, ect for RPG maker. So I was wondering if you could help me out with that. I can give you more info, so if your interested contact me. Maybe we can create a great game.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s