RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[Snippet] Auto-Repeat Animation

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 86
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



Script
Place it above main

Code: [Select]
#===============================================================
# ? [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: [Select]
   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: [Select]
   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?

*
Resident Cloud
Rep:
Level 91
:D i needed this about 2 months ago for yar :(.

Thanks for making this :D