Auto-Repeat Animation
#1
Auto-Repeat Animation
Version 1.0
by Woratana
Release Date: 21/05/2008


Introduction
This is a little snippet that will allow you to set repeat animation on character in map.

Repeat animation will show again and again after the last animation in that character finished~

Enjoy~ :lol:


Screenshots
It's not needed, but I have if you want~ :P
[Image: 2v80ot5.jpg]


Script
Place it above main
[Image: 25thhqt.jpg]
Code:
#===============================================================
# ? [VX Snippet] ? Auto-Repeat Animation ? ?
# * Show animation again and again on character in map~ *
#--------------------------------------------------------------
# ? by Woratana [woratana@hotmail.com]
# ? Thaiware RPG Maker Community
# ? Released on: 21/05/2008
# ? Version: 1.0
#--------------------------------------------------------------

#==================================================================
# ** HOW TO USE **
#-----------------------------------------------------------------
# To set repeat animation to character, call script:
#   set_anim(character, animation_id)
#
# * character: What character you want to set repeat animation?
# ** -1 for 'Player', 0 for 'This Event', and 1 or more for Event ID
# * animation_id: ID of the animation you want to set as repeat animation
# ** use 0 to remove repeat animation~

# For example:
#   set_anim(10, 5)
# * Script above will set Animation ID 5 as repeat animation for Event ID 10
#==================================================================

class Game_Interpreter
  def set_anim(character, anim_id)
    get_character(character).repeat_anim = anim_id
  end
end

class Game_Character
  attr_accessor :repeat_anim
  alias wora_autorepani_gamcha_ini initialize
  def initialize
    @repeat_anim = 0
    wora_autorepani_gamcha_ini
  end
end

class Sprite_Character < Sprite_Base
  alias wora_autorepani_sprcha_upd update
  def update
    wora_autorepani_sprcha_upd
    unless @animation_duration > 0
      @character.animation_id = @character.repeat_anim
    end
  end
end


Instruction
To set repeat animation to character, call script:
Code:
set_anim(character, animation_id)

* character: What character you want to set repeat animation?
** -1 for 'Player', 0 for 'This Event', and 1 or more for Event ID
* animation_id: ID of the animation you want to set as repeat animation
** use 0 to remove repeat animation~

For example:
Code:
set_anim(10, 5)
* Script above will set Animation ID 5 as repeat animation for Event ID 10


Author's Notes
Free for use in your work if credit is included.

Please do not redistribute this script without permission. If you want to post it on any forum, please link to this topic.


Bug Report?
Please give me these informations:
Quote:- What is it says in error window?
- When is it get error? (Right after run game, when you choose something, etc.)
- Do you have any other scripts running in your game that may crash with this script?
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Character's Dash Animation kyonides 0 751 04-08-2024, 03:50 AM
Last Post: kyonides
   Victor Engine - State Auto Apply Victor Sant 0 4,140 06-25-2012, 12:17 AM
Last Post: Victor Sant
   Victor Engine - Loop Animation Victor Sant 0 4,665 01-01-2012, 02:23 PM
Last Post: Victor Sant
   Victor Engine - Cast Animation Victor Sant 0 4,653 12-21-2011, 07:48 AM
Last Post: Victor Sant
   Animation Bug Fixed woratana 0 4,084 01-22-2009, 01:22 PM
Last Post: woratana



Users browsing this thread: 1 Guest(s)