Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Help editing Animation Resizer
#1
I found this script that can resize animations at runtime. I want to use it to make Skill animations smaller when they are applied on Actor battlers (they are several times smaller than Enemy battlers) but I am not sure where to make the change.

Could someone more familiar with RPG Maker XP's battle/animation systems assist?

The script:
Code:
#===============================================================================
# Animation Resizer
# Author game_guy
# Version 1.0
#-------------------------------------------------------------------------------
# Intro:
# Want to reduce or increase the size of certain animations? Don't wanna go
# through all the tedious work to do it in the database? This script
# can resize any animation for you.
#
# Features:
# Increase animation size
# Decrease animation size
# Use only on specific animations
# Use custom size value
#
# Instructions:
# Note the animations also resize on events.
# Go down to config below.
# Default_Increase - This is the default amount that is used to resize an
#   animation that isn't configured.
# Configure Sizes - This is the config for setting up sizes for specific
#   animations only. If an animation isn't defined here then it uses
#   Default_Increase
#
# Don't want an animation resized on events? Simply use the following
# $game_system.anim_event = false
# Set it to true to have animations resized on events.
#
# Compatibility:
# Not tested with SDK.
# Should work where ever an animation is used.
#
# Credits:
# game_guy ~ For making it
# Jek ~ For requesting it
#===============================================================================
module GGHAN
  #==============================================
  # Config
  #==============================================
  # Default animation increase/decrease
  # Positive values = increase
  # Negative values = decrease
  Default_Increase = 0
  def self.zoom(id)
    case id
    #========================
    # Configure Sizes
    # Do:
    # when animation_id then return resize_amount_in_percent
    # Example:
    # when 67 then return 300
    # It increases the animation by 300 percent
    # Use negative values to decrease an animation.
    #
    # Note: When decreasing an animation size it can
    # only decrease it as much as possible before making
    # the animation dissappear.
    #========================
    when 67 then return 300
    when 1 then return -90
    end
    return 0
  end
  #==============================================
  # End Config
  #==============================================
end
class Game_System
  attr_accessor :anim_event
  attr_accessor :is_event
  alias gg_init_anim_resize_lat initialize
  def initialize
    @anim_event = true
    @is_event = false
    gg_init_anim_resize_lat
  end
end
module RPG
  class Sprite < ::Sprite
    def animation_set_sprites(sprites, cell_data, position)
      for i in 0..15
        sprite = sprites[i]
        pattern = cell_data[i, 0]
        if sprite == nil or pattern == nil or pattern == -1
          sprite.visible = false if sprite != nil
          next
        end
        sprite.visible = true
        sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
        if position == 3
          if self.viewport != nil
            sprite.x = self.viewport.rect.width / 2
            sprite.y = self.viewport.rect.height - 160
          else
            sprite.x = 320
            sprite.y = 240
          end
        else
          sprite.x = self.x - self.ox + self.src_rect.width / 2
          sprite.y = self.y - self.oy + self.src_rect.height / 2
          sprite.y -= self.src_rect.height / 4 if position == 0
          sprite.y += self.src_rect.height / 4 if position == 2
        end
        sprite.x += cell_data[i, 1]
        sprite.y += cell_data[i, 2]
        sprite.z = 2000
        sprite.ox = 96
        sprite.oy = 96
        if $scene.is_a?(Scene_Map) && $game_system.anim_event
          zoom = GGHAN.zoom(@_animation.id)
          if zoom < 0
            c = -zoom
            if cell_data[i, 3] <= c
              c = cell_data[i, 3] - 1
              cc = cell_data[i, 3] - c
              #p cc.to_s + " IF " + cell_data[i, 3].to_s
            else
              cc = cell_data[i, 3] - c
              #p cc.to_s + " ELSE " + cell_data[i, 3].to_s
            end
          else
            cc = cell_data[i, 3] + zoom
          end
          sprite.zoom_x = cc / 100.0
          sprite.zoom_y = cc / 100.0
        elsif $scene.is_a?(Scene_Map) && !$game_system.anim_event
          cc = cell_data[i, 3]
          sprite.zoom_x = cc / 100.0
          sprite.zoom_y = cc / 100.0
        elsif $scene.is_a?(Scene_Battle)
          zoom = GGHAN.zoom(@_animation.id)
          cc = cell_data[i, 3] + zoom
          sprite.zoom_x = cc / 100.0
          sprite.zoom_y = cc / 100.0
        end
        sprite.angle = cell_data[i, 4]
        sprite.mirror = (cell_data[i, 5] == 1)
        sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
        sprite.blend_type = cell_data[i, 7]
      end
    end
  end
end
Reply }


Messages In This Thread
Help editing Animation Resizer - by MechanicalPen - 11-02-2012, 01:47 AM
RE: Help editing Animation Resizer - by kyonides - 11-02-2012, 07:01 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Animation Action justpassingby 16 15,697 11-06-2017, 01:59 AM
Last Post: justpassingby
   Atoa Custom Battle System CTB animation while cast Noctis 6 9,513 01-04-2016, 03:05 PM
Last Post: Noctis
  Help editing a script Iqus 3 4,835 02-17-2014, 08:33 PM
Last Post: JayRay
   Auto-play Character animation Taylor 0 2,801 05-30-2012, 11:56 AM
Last Post: Taylor
   Changing the walking animation shadow040 8 9,973 01-30-2010, 04:20 PM
Last Post: shadow040



Users browsing this thread: