#=============================================================================== # # Yanfly Engine RD - Swap Dummy Animation # Last Date Updated: 2009.05.19 # Level: Hard # # It's pretty inefficient making new animations each time only to because you # need to make multiple copies for each and every actor. Well, now with the Swap # Dummy Animation script, you no longer need to create multiple copies of the # same skill and multiple copies of the same animation for each actor. # #=============================================================================== # Updates: # ---------------------------------------------------------------------------- # o 2009.05.19 - Started script and finished. #=============================================================================== # Instructions #=============================================================================== # # To use this script, you must first have the -swapdummy file saved inside your # Animations folder. When you create an animation with the -swapdummy file, it # will exchange the animation ingame to match the actor's respective animation # file in the hash below. # #=============================================================================== # # Compatibility # - Alias: Sprite_Base, load_animation_bitmap # #=============================================================================== $imported = {} if $imported == nil $imported["SwapDummyAnimation"] = true module YE module SWAP # This is the dummy animation's name. DUMMY_ANIMATION = "-swapdummy" # In order to determine which swap dummy animation is used, input the # character sprite name and the index number to indicate which swap dummy # file to exchange it with. ANIMATION_HASH ={ # [ Char.Name, Ind] => Animation File Name [ "Actor1", 0] => "Ralph", [ "Actor1", 3] => "Ulrika", [ "Actor2", 2] => "Bennett", [ "Actor2", 5] => "Ylva", } # Do not remove this. end # SWAP end # YE #=============================================================================== # Editting anything past this point may potentially result in causing computer # damage, incontinence, explosion of user's head, coma, death, and/or halitosis. # Therefore, edit at your own risk. #=============================================================================== #============================================================================== # Sprite_Base #============================================================================== class Sprite_Base < Sprite #-------------------------------------------------------------------------- # alias load_animation_bitmap #-------------------------------------------------------------------------- alias load_animation_bitmap_sda load_animation_bitmap unless $@ def load_animation_bitmap #--- if perform_swap_dummy? load_swap_dummy_animation else load_animation_bitmap_sda end #--- end #-------------------------------------------------------------------------- # perform swap dummy? #-------------------------------------------------------------------------- def perform_swap_dummy? return false unless $scene.is_a?(Scene_Battle) dummy = YE::SWAP::DUMMY_ANIMATION if @animation.animation1_name or @animation.animation2_name == dummy return true end return false end #-------------------------------------------------------------------------- # load_swap_dummy_animation #-------------------------------------------------------------------------- def load_swap_dummy_animation dummy = YE::SWAP::DUMMY_ANIMATION ani1_name = @animation.animation1_name ani1_hue = @animation.animation1_hue ani2_name = @animation.animation2_name ani2_hue = @animation.animation2_hue if $scene.active_battler != nil and $scene.active_battler.actor? battler = $scene.active_battler charname = battler.character_name charindex = battler.character_index dummy_ani = YE::SWAP::ANIMATION_HASH[[charname, charindex]] else dummy_ani = "" end #--- ani1_name = dummy_ani if @animation.animation1_name == dummy ani2_name = dummy_ani if @animation.animation2_name == dummy #--- @animation_bitmap1 = Cache.animation(ani1_name, ani1_hue) @animation_bitmap2 = Cache.animation(ani2_name, ani2_hue) if @@_reference_count.include?(@animation_bitmap1) @@_reference_count[@animation_bitmap1] += 1 else @@_reference_count[@animation_bitmap1] = 1 end if @@_reference_count.include?(@animation_bitmap2) @@_reference_count[@animation_bitmap2] += 1 else @@_reference_count[@animation_bitmap2] = 1 end Graphics.frame_reset end end #=============================================================================== # Scene_Battle #=============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # return active battler #-------------------------------------------------------------------------- def active_battler return @active_battler end end #Scene_Battle #=============================================================================== # # END OF FILE # #===============================================================================