Rhyme 14 Posted December 22, 2011 (edited) Animate Enemies! Download examples Recommended. Really. (Mainly because I can't explain how to use it) Animated battlers from What does it do? Animates the enemy graphics with a spritesheet. The speed of the animation and the spritesheet sizes are adjustable. It is a simple script, so don't expect much from it (it's not a side view battle system). How do I use it? Spritesheet files need to be placed within /Battlers/ folder. Every sprite requires two files - one "editor" or placement graphic, and the spritesheet itself. The editor graphic will not be used: it is only used when placing enemies in the Troops tab, and possibly other scripts may retrieve the editor image instead of the full spritesheet to display. Use the editor graphic when deciding a graphic file for enemies. The spritesheet filename has to be the same as the preview filename. Example: "bat.png" is the normal filename, "bat-spritesheet.png" is the full spritesheet filename. #============================================================================== # ■Animated Enemy Sprites # Merry Christmas and happy holidays! #============================================================================== # Notebox Tag: # Enemy: !Flip #============================================================================== # Spritesheet Data for referencing # # 0. Idle # 1. Defend # 2. Weak # 3. Damaged # 4. Attack # 5. Item # 6. Skill # 7. Magic # 8. Advance (n/a) # 9. Retreat (n/a) # 10. Victory (n/a) # 11. Enter # 12. Dead # 13. Credits and/or etc (n/a) #============================================================================== # ~rhyme #============================================================================== module Animated_Enemy_Sprites Delay = 8 FrameSize = [4, 14] DefaultBlink = false end #============================================================================== # ■Game_Battler #============================================================================== class Game_Battler < Game_BattlerBase attr_accessor :pose #-------------------------------------------------------------------------- # ◠Flip #-------------------------------------------------------------------------- def flip_sprite return false end #-------------------------------------------------------------------------- # ◠Reset Pose #-------------------------------------------------------------------------- def reset_pose @pose = 0 @pose = 2 if @hp < mhp / 4 if @states != nil @pose = 2 if @states.size > 0 end @pose = 1 if guard? @pose = 12 if dead? end #-------------------------------------------------------------------------- # ◠Use Item #-------------------------------------------------------------------------- alias use_item_ani use_item def use_item(item) if item.is_a?(RPG::Item) @pose = 4 else if item.is_a?(RPG::Skill) if item.id == attack_skill_id @pose = 4 elsif item.physical? @pose = 6 elsif item.magical? @pose = 7 end end end use_item_ani(item) end #-------------------------------------------------------------------------- # ◠Perform Damage #-------------------------------------------------------------------------- alias perform_map_damage_effect_ani perform_map_damage_effect def perform_map_damage_effect perform_map_damage_effect_ani @pose = 3 unless @guarding end #-------------------------------------------------------------------------- # ◠Upon Damage #-------------------------------------------------------------------------- alias on_damage_ani on_damage def on_damage(value) @pose = 3 unless @guarding on_damage_ani(value) end end #============================================================================== # ■Game_Enemy #============================================================================== class Game_Enemy < Game_Battler #-------------------------------------------------------------------------- # ◠Flip #-------------------------------------------------------------------------- def flip_sprite return true if Scan::string($data_enemies[@enemy_id].note, "!Flip") return super end end #============================================================================== # ■Sprite_Battler #============================================================================== class Sprite_Battler < Sprite_Base attr_accessor :battler #-------------------------------------------------------------------------- # ◠Initialize #-------------------------------------------------------------------------- def initialize(viewport, battler = nil) super(viewport) @battler = battler @battler_visible = false @effect_type = nil @effect_duration = 0 @spritesheet = true @pose = 11 @counter = 0 @delay = Animated_Enemy_Sprites::Delay @frame_size = Animated_Enemy_Sprites::FrameSize end #-------------------------------------------------------------------------- # ◠フレーム更新 #-------------------------------------------------------------------------- def update super if @battler @battler.reset_pose if @battler.pose == nil self.mirror = @battler.flip_sprite @use_sprite = @battler.use_sprite? if @spritesheet update_pose if @pose != 11 end if Graphics.frame_count % @delay == 0 @counter += 1 if @counter >= @frame_size[0] @counter = 0 if @pose == 11 update_pose else @battler.reset_pose end end end if @use_sprite update_bitmap update_origin update_position end setup_new_effect setup_new_animation update_effect else @effect_type = nil end self.opacity = 255 self.visible = true end #-------------------------------------------------------------------------- # ◠Update bitmap #-------------------------------------------------------------------------- def update_bitmap if @spritesheet @spritesheet_bitmap = Cache.battler(@battler.battler_name + "-spritesheet", @battler.battler_hue) ss_size = [@spritesheet_bitmap.width, @spritesheet_bitmap.height] new_bitmap = Bitmap.new(ss_size[0] / @frame_size[0], ss_size[1] / @frame_size[1]) cx = @counter * (ss_size[0] / @frame_size[0]) cy = @pose * (ss_size[1] / @frame_size[1]) crop_rect = Rect.new(cx, cy, ss_size[0], ss_size[1]) new_bitmap.blt(0, 0, @spritesheet_bitmap, crop_rect) else new_bitmap = Cache.battler(@battler.battler_name, @battler.battler_hue) end if bitmap != new_bitmap self.bitmap = new_bitmap init_visibility end end #-------------------------------------------------------------------------- # ◠Update Pose #-------------------------------------------------------------------------- def update_pose oldpose = @pose newpose = @battler.pose if newpose != oldpose @counter = 0 @pose = newpose end end #-------------------------------------------------------------------------- # ◠Blink #-------------------------------------------------------------------------- def update_blink self.opacity = (@effect_duration % 10 < 5) ? 255 : 0 if Animated_Enemy_Sprites::DefaultBlink end end #============================================================================ # ▼ Scan #============================================================================ module Scan #-------------------------------------------------------------------------- # ◠Scan.string(object, string) #-------------------------------------------------------------------------- def self.string(object, string) if object[/#{Regexp.quote string}/] return true end return false end end Edited December 22, 2011 by Rhyme 4 Faye V., Archeia, Holder and 1 other reacted to this Share this post Link to post Share on other sites
Rosenblack 79 Posted December 22, 2011 (edited) Added to OS-MSL Edited December 22, 2011 by Rosenblack Share this post Link to post Share on other sites
+ Archeia 160 Posted December 22, 2011 Good job rhyme~ Share this post Link to post Share on other sites
Victor Sant 273 Posted December 22, 2011 By the way it works perfectly with my Actor Battlers script, so we can have animated sideview battles already xD Although there's still no movement toward the target. Share this post Link to post Share on other sites
Rafael Sol Maker 22 Posted December 22, 2011 Good job. I remembered the Animated Battlers from my old'ays with RM2k3... Glad it will make a good pairing with the Atoa's actor battlers. Movement toward the target is as easy to implement as to breathe. Hmm, I saw something there to flip the characters, maybe a primitive notetag system, interesting. XD Share this post Link to post Share on other sites
Knightmare 170 Posted December 23, 2011 Score! Now I can make graphical slides of monsters eating my characters. 1 Rosenblack reacted to this Share this post Link to post Share on other sites
Rosenblack 79 Posted December 23, 2011 (edited) You: hey look its a cat *cat looks at you* You: It looks friendly *cat eats your face* Cat: nom nom nom You: all i can say now is "ouch" Edited December 23, 2011 by Rosenblack 2 oriceles and Knightmare reacted to this Share this post Link to post Share on other sites
Michael Ponder Jr 36 Posted December 23, 2011 (edited) Not bad, but you can't some how adjust how many frames each monster has for each pose, as well the speed in which it animates, not individually anyhow, you have one set of frames and so forth for every monsters, but what if one monster only has 4 frames for some animations, while another has 30? You're stuck with the same thing for every monster. It needs something of a mesh for each monster and each pose to have it's own frames and speed, that you either place in the main script, or maybe even in the comment box for the monster in the database. Edited December 23, 2011 by Michael Ponder Jr Share this post Link to post Share on other sites
Arjhey Agravante 0 Posted April 19, 2012 (edited) Hi guys! i follow the "How do I use it? method" Here: http://puu.sh/qmwm Its looks Fine and Great! but how do i fix the Mobs background? A little hand please? Edited April 19, 2012 by Arjhey Agravante Share this post Link to post Share on other sites
cadrius 5 Posted April 21, 2012 Hi guys! i follow the "How do I use it? method" Here: http://puu.sh/qmwm Its looks Fine and Great! but how do i fix the Mobs background? A little hand please? change the bg color of the mob bg for transparent if u cant send me the mob pallette in a pm i will set it transparent for you Share this post Link to post Share on other sites
Mike scarts 0 Posted April 27, 2012 Keeps telling me it can not locate file even after I renamed it... (>_<) Share this post Link to post Share on other sites
Blast Fury 0 Posted April 29, 2012 Is this script compatible with the Enu Sideview Battle System? Share this post Link to post Share on other sites
Dalatain 0 Posted May 31, 2012 Hey guys Im new to RPGM and I just bought VX ace, forgive me but is this script compatible with VX ace? Im running a sideview system but i dont recall the name as I implemented it a few months ago on my trial. I know it was one of the major ones that seems very well liked by a lot of people. If you absolutely need the exact script name I can find out later on today. Share this post Link to post Share on other sites
cyborgmermaid 1 Posted August 19, 2012 What exactly does the "Delay" equate to in frames per second? I'm trying to see if I can match an animation to the tempo of a song (that's at an easy 60BPM), but I'm having a bother of a time. Share this post Link to post Share on other sites
BOSSBERRY 28 Posted August 20, 2012 Hey guys Im new to RPGM and I just bought VX ace, forgive me but is this script compatible with VX ace? Im running a sideview system but i dont recall the name as I implemented it a few months ago on my trial. I know it was one of the major ones that seems very well liked by a lot of people. If you absolutely need the exact script name I can find out later on today. Victor Engine?http://victorscripts.wordpress.com/2012/03/08/ve-animated-battle-full/ Share this post Link to post Share on other sites
BMoz1 1 Posted February 15, 2013 Is there a way to make the graphic fade out like normal when it dies? I can't seem to figure it out and I would rather not go back to victor's engine (it was WAY over my head) Share this post Link to post Share on other sites
Duke742 1 Posted May 4, 2014 I love this! Its so much simpler than those other crazy battler engines. changing the frames and columns? what does that exactly do? also, is there a way to add more frames(pictures) to the animation of each pose? Can i change it per battler? Share this post Link to post Share on other sites
Wicked-River 0 Posted August 28, 2014 Keeps telling me it can not locate file even after I renamed it... (>_<) I'm having the exact same issue, this post seems kind of dead but any response would be great. Share this post Link to post Share on other sites
Akari_Tsukino 0 Posted October 28, 2015 (edited) can this be used in a commercial game with credit given? I'm going to assume that because Rhyme hasn't been on since December 2012 the answer is yes? Edited October 28, 2015 by Akari_Tsukino Share this post Link to post Share on other sites