Battlebackgrounds Animados

8 de junho de 2011

Segue um script feito por SephirothSpawn que ensina como animar os fundos durante as batalhas. Para instalá-lo no seu RPG Maker XP basta copiar e colar abaixo do SDK e acima do Main.

#==============================================================================
# ** Animated Battlebacks
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 1
# 2006-10-08
#------------------------------------------------------------------------------
# * Requirements :
#
#   Quick Animations
#------------------------------------------------------------------------------
# * Description :
#
#   This script was designed to animate battlebacks during battle. It uses
#   the quick animation system to do so.
#------------------------------------------------------------------------------
# * Instructions :
#
#   Place The Script Below the SDK and Above Main.
#------------------------------------------------------------------------------
# * Syntax :
#
#   Enabling/Disabling Animated Battlebacks
#    - $game_temp.animated_battleback = true or false
#
#   Setting Animation Type (Refer to Quick Animation System)
#    - $game_temp.animated_battleback_type = 'A' or 'B'
#
#   Setting Time to Pass From Frame to Frame
#    - $game_temp.animated_battleback_frameskip = n
#
#   Setting Directory (For Type A)
#    - $game_temp.animated_battleback_directory = 'Foldername'
#
#   Setting Filename (For Type B)
#    - $game_temp.animated_battleback_filename = 'filename'
#
#   Setting Number of Frames (For Type B)
#    - $game_temp.animated_battleback_frames = n
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Animated Battlebacks', 'SephirothSpawn', 1, '2006-10-08')

#------------------------------------------------------------------------------
# * Quick Animations Test
#------------------------------------------------------------------------------
unless SDK.state('Quick Animations')
  # Print Error
  p 'Quick Animations System Not Found. Animated Battlebacks Disabled.'
  # Disable Encounter Control
  SDK.disable('Animated Battlebacks')
end

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state('Animated Battlebacks')

#==============================================================================
# ** Game_Temp
#==============================================================================

class Game_Temp
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :animated_battleback
  attr_accessor :animated_battleback_type
  attr_accessor :animated_battleback_frameskip
  attr_accessor :animated_battleback_directory
  attr_accessor :animated_battleback_filename
  attr_accessor :animated_battleback_frames
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias seph_animatedbb_gtemp_init initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # Original Initialization
    seph_animatedbb_gtemp_init
    # Sets Default Animated Battleback Settings
    @animated_battleback = true
    @animated_battleback_type = 'B'
    @animated_battleback_frameskip = 10
    @animated_battleback_directory = 'Sample Battleback Type A'
    @animated_battleback_filename = 'Sample Battleback Type B'
    @animated_battleback_frames = 4
  end
end

#==============================================================================
# ** Spriteset_Battle
#==============================================================================

class Spriteset_Battle
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias seph_animatedbb_ssbtl_update update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update Battleback
    @battleback_sprite.update
    # Original Update
    seph_animatedbb_ssbtl_update
    # If Animated Battleback On
    if $game_temp.animated_battleback
      # If Animation Type A
      if $game_temp.animated_battleback_type.upcase == 'A'
        # If Not Animation Sprite
        unless @battleback_sprite.is_a?(Quick_Animation_A)
          # Dispose Animated Battleback
          unless @battleback_sprite.nil? || @battleback_sprite.disposed?
            @battleback_sprite.dispose 
          end
          # Create Battleback Sprite
          d = $game_temp.animated_battleback_directory
          f = $game_temp.animated_battleback_frameskip
          @battleback_sprite = Quick_Animation_A.new(d, true, f, @viewport1)
        end
      # If Animation Type B
      elsif $game_temp.animated_battleback_type.upcase == 'B'
        # If Not Animation Sprite
        unless @battleback_sprite.is_a?(Quick_Animation_B)
          # Dispose Animated Battleback
          unless @battleback_sprite.nil? || @battleback_sprite.disposed?
            @battleback_sprite.dispose 
          end
          # Create Battleback Sprite
          b = $game_temp.animated_battleback_filename
          f = $game_temp.animated_battleback_frames
          fs = $game_temp.animated_battleback_frameskip
          @battleback_sprite = Quick_Animation_B.new(b, f, true, fs,
            @viewport1)
        end
      end
    end
  end
end
  
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end

Deixe um comentário

  • Inscreva-se na nossa newsletter!

  • Nos siga nas redes sociais!

  • Páginas

  • Áreas especiais

  • eXTReMe Tracker
    Copyright © 2001 - 2018 Gaming Room. Todos os Direitos Reservados - É expressamente proibida a reprodução total ou parcial deste site sem o consentimento dos autores.