Help - Search - Members - Calendar
Full Version: [VX] Rei Actor Resize V.2.2b
RPG RPG Revolution Forums > Scripting > Script Submissions > RGSS2-Submissions
reijubv
Rei Actor Resize
v.2.2b (May 17th 2009)
by reijubv

Well, another very simple and small script that I made, this script just simply zoom your actor's size to any desired size, that can be easily turned on/off using a switch!

Changelog:
V.1.0 (25-04-09) = Initial release
V.2.0 (01-05-09) = Now resizing event's graphic is possible!
V.2.1 (04-05-09) = Compatible with Woratana's caterpillar script! (thanks to Miget man12 for this!)
V.2.1b(13-05-09) = Compatible with Trickster's caterpillar script!
V.2.1c(14-05-09) = Compatible with Originalwij's pet script!
V.2.2 (17-05-09) = Now resizing individual event's size is possible!
V.2.2b(17-05-09) = Now using array to store event's size, making it easier
for people to resize each events individually!


So now you can create a game that looks like one of Zelda series!

Download the new demo!

Demo :
V.2.0
http://www.mediafire.com/download.php?dvmyj22idxm 401Kb
V.2.2b (NEW)
http://www.mediafire.com/download.php?mzqmnjknygy403.78 Kb

See these screenshot too :
[Show/Hide] Screenshot






V.2.2b



Download script here :

[Show/Hide] Script here

CODE
#===============================================================================
# † [VX] † Rei Actor Resize † †
# † Change player's or event's graphic size †
#-------------------------------------------------------------------------------
# † by reijubv [aruyasoft@comic.com]
# † RPG RPG Revolution
# † Released on: 27/04/2009
# † Version: 2.2c (June 12th 2009)
#-------------------------------------------------------------------------------
# > Changelog:
#   V.1.0 (25-04-09) = Initial release
#   V.2.0 (01-05-09) = Now resizing event's graphic is possible!
#   V.2.1 (04-05-09) = Compatible with Woratana's caterpillar script!
#   V.2.1b(13-05-09) = Compatible with Trickster's caterpillar script!
#   V.2.1c(14-05-09) = Compatible with Originalwij's pet script!
#   V.2.2 (17-05-09) = Now resizing individual event's size is possible!
#   V.2.2b(17-05-09) = Now using array to store event's size, making it easier
#                      for people to resize each events individually!
#   V.2.2c(12-06-09) = Added a global variable used for compatibility
#-------------------------------------------------------------------------------
# † Information:
# A small script that allows you to change the size of player/event's graphic
#----------------
# V.2.0 Feature :
#----------------
# You can also change an event's graphic size now!
# To change an event's graphic size, you MUST do these things :
# (these examples are from the script's default settings)
# 1. adds this line to event's comment :
# rzoom
# 2. turn on the switch from the setting below (the one that called EFLAG)
# 3. see the effect yourself on your game!
# See the demo if you don't understand!
#----------------
# V.2.1 Feature :
#----------------
# Compatible with Woratana caterpillar script!
# For setting compatibility with it, uncomment line 226-228
#-----------------
# V.2.1b Feature :
#-----------------
# Compatible with Trickster's caterpillar script!
# For setting compatibility with it, uncomment line 232-234
#-----------------
# V.2.1c Feature :
#-----------------
# Compatible with Originalwij's pet script!
# For setting compatibility with it, uncomment line 238-240
#----------------
# V.2.2 Feature :
#----------------
# (NOT FUNCTIONAL ANYMORE, SKIP TO V.2.1b INSTEAD!) :
# You can now specify each event's size by using these comments :
# [rsx#] and [rsy#]
# Put those comments in one line or in other comment command,
# [rsx#] Will change the event's X size to #
# [rsy#] Will change the event's Y size to #
# Those feature will only works for non-decymal value.
# Decymal value will use an integer that is the closest to it, example :
# 1.2 will return 1, and 1.8 will return 2
# Example for usage :
# [rsx2][rsy3]
# Will change event's X size to 2, and Y size to 3
# ----------------
# V.2.2b Feature :
#-----------------
# Now you can use an array to store value you can use to resizing events,
# Setup it in Rei module below.
# [rsvx#] and [rsvy#];
# To use them, type those comments in 1 line, like V.2.1 feature, but never use
# both V.2.2 and V.2.1 features in 1 event, to avoid bugs.
# [rsvx#] Will change the event's X size to index #  in the ARR variable below
# [rsvy#] Will change the event's Y size to index #  in the ARR variable below
# Example for usage :
# [rsvx0][rsvy3]
# Change event's X size to a number in ARR variable from Rei module in index 0
# and Y size to a number in ARR variable from Rei module in index 3
#-------------------------------------------------------------------------------
# You can put all those comments in one line, like rzoom[rsvx#][rsvy#]
#-------------------------------------------------------------------------------
# reijubv for making this script.
# Miget man12 for making this script compatible with Woratana's caterpillar script.
#-------------------------------------------------------------------------------
# ? Installation:
# Put this script above main, setup script below
#===============================================================================

$imported = {} if $imported == nil
$imported["Rei_"+"ZoomActor"] = true

#---------------------------------------------------------------------------
# ** Rei Module
#---------------------------------------------------------------------------
module Rei
  module ZoomActor
    #---------------------------------------------------------------------------
    # * Customize script here!
    #---------------------------------------------------------------------------
    #For player
    ZOOMX = 0.6     # Change actor's horizontal size here
    ZOOMY = 0.6     # Change actor's vertical size here
    FLAG  = 3       # Switch Id to (de)activate this script effect to player  

    # (V.2.0)
    # For event
    ECOMM = "rzoom" # Write this to an event's comment to change it's size
                    # automatically.
                    # Event that doesn't have this comment won't be affected
                    # even if the switch is turned on!
    EFLAG = 4       # Switch Id to (de)activate this script effect to events            
    EZUMX = 0.6     # Change event's horizontal size here, 0.1 minimum
    EZUMY = 0.6     # Change event's vertical size here, 0.1 minimum
    
                    # To change those variables in game, call script :
                    # Rei::ZoomActor::FLAG =switchId
                    # Rei::ZoomActor::EFLAG=switchId
                    # Rei::ZoomActor::ECOMM="writesomethinghere"
                    # Rei::ZoomActor::ZOOMX=#
                    # Rei::ZoomActor::ZOOMY=#
                    # Rei::ZoomActor::EZUMX=#
                    # Rei::ZoomActor::EZUMY=#
                    # Change siwtchId with, ehm, a switch's Id..
                    # Change # with a number!
                    # Change writesomethinghere with umm, something you want
                    
   # V.2.2b  
             #0    1    2    3    4    5    6    7    8    9
     ARR  = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0,
             1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0,
             2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0,
             3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0,
             #You can add more here
             ]
             # This array is for storing predefined size value
             # to be used when using V.2.2b feature.
             # Each line after the first have it's index added by 10
             # Example : 3.1 index is 30, 1.6 index is 15
                    
    #---------------------------------------------------------------------------
    # * Stop customize script here!
    #---------------------------------------------------------------------------
  end
end

#==============================================================================
# ** Game_Event
#------------------------------------------------------------------------------
#  This class deals with events. It handles functions including event page
# switching via condition determinants, and running parallel process events.
# It's used within the Game_Map class.
#==============================================================================

class Game_Event < Game_Character
  attr_accessor :reixid
  attr_accessor :reiyid
  attr_reader :reiarr
  alias reiinit initialize unless method_defined?('reiinit')
   def initialize(map_id, event)
    @reixid = 9
    @reiyid = 9
    @reiarr  = [@reixid,@reiyid]
    reiinit(map_id, event)
  end
  
   def getsizeindex
    if !@list.nil?
    for i in 0...@list.size - 1
      next if @list[i].code != 108
        if @list[i].parameters[0].include?("[rsvx")
          list = @list[i].parameters[0].scan(/\[rsvx([0-9]+)\]/)
          @reixid = $1.to_i
        end
        if @list[i].parameters[0].include?("[rsvy")
          list = @list[i].parameters[0].scan(/\[rsvy([0-9]+)\]/)
          @reiyid = $1.to_i
        end
      end
      @reiarr = [@reixid,@reiyid]
      return @reiarr
    end
  end
    #---------------------------------------------------------------------------
    # * check if event has a specified comment
    #---------------------------------------------------------------------------
  def has_comment?(comment, return_comment = false )
    if !@list.nil?
      for i in 0...@list.size - 1
        next if @list[i].code != 108
          if @list[i].parameters[0].include?(comment)
            return @list[i].parameters[0] if return_comment
            return true
          end
      end
      return '' if return_comment
      return false
    end
  end
end

#==============================================================================
# ** Sprite_Character
#------------------------------------------------------------------------------
#  This sprite is used to display characters. It observes a instance of the
# Game_Character class and automatically changes sprite conditions.
#==============================================================================

class Sprite_Character < Sprite_Base
  #--------------------------------------------------------------------------
  # * Aliases
  #--------------------------------------------------------------------------  
  alias rei_update update unless method_defined?('rei_update')
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    if @character.is_a?(Game_Player) and $game_switches[Rei::ZoomActor::FLAG]
      self.zoom_x = Rei::ZoomActor::ZOOMX
      self.zoom_y = Rei::ZoomActor::ZOOMY
    elsif @character.is_a?(Game_Event) and $game_switches[Rei::ZoomActor::EFLAG] and @character.has_comment?(Rei::ZoomActor::ECOMM)
      if @character.has_comment?("[rsvx")
        self.zoom_x = Rei::ZoomActor::ARR[@character.getsizeindex[0]]
      else
        self.zoom_x = Rei::ZoomActor::EZUMX
      end
      if @character.has_comment?("[rsvy")
        self.zoom_y = Rei::ZoomActor::ARR[@character.getsizeindex[1]]
      else
        self.zoom_y = Rei::ZoomActor::EZUMY
      end
    
    #UNCOMMENT BELOW LINES IF YOU USE WORATANA'S CATERPILLAR SCRIPT    
    #elsif @character.is_a?(Game_WCateracter) and $game_switches[Rei::ZoomActor::FLAG]==true
    #  self.zoom_x = Rei::ZoomActor::ZOOMX
    #  self.zoom_y = Rei::ZoomActor::ZOOMY
    #UNCOMMENT ABOVE LINES IF YOU USE WORATANA'S CATERPILLAR SCRIPT
    
    #UNCOMMENT BELOW LINES IF YOU USE TRICKSTER'S CATERPILLAR SCRIPT
    #elsif @character.is_a?(Game_Follower) and $game_switches[Rei::ZoomActor::FLAG]
    #  self.zoom_x = Rei::ZoomActor::ZOOMX
    #  self.zoom_y = Rei::ZoomActor::ZOOMY
    #UNCOMMENT ABOVE LINES IF YOU USE TRICKSTER'S CATERPILLAR SCRIPT
    
    #UNCOMMENT BELOW LINES IF YOU USE ORIGINALWIJ'S PET SCRIPT
    #elsif @character.is_a?(Game_Pet) and $game_switches[Rei::ZoomActor::FLAG]
    #  self.zoom_x = Rei::ZoomActor::ZOOMX
    #  self.zoom_y = Rei::ZoomActor::ZOOMY
    #UNCOMMENT ABOVE LINES IF YOU USE TRICKSTER'S CATERPILLAR SCRIPT    
    
  else
      self.zoom_x = 1.0
      self.zoom_y = 1.0
    end
    rei_update
  end
end




Setup this script like this :


CODE
    #For player
   ZOOMX = 0.6       # Change actor's horizontal size here
   ZOOMY = 0.6       # Change actor's vertical size here
  FLAG  = 3            # Switch Id to (de)activate this script effect to player  
  
   #For event
   ECOMM = "rzoom" # Write this to an event's comment to change it's size
                           # automatically.
                           # Event that doesn't have this comment won't be affected
                           # even if the switch is turned on!
   EFLAG = 4          # Switch Id to (de)activate this script effect to events            
   EZUMX = 0.6      # Change event's horizontal size here
   EZUMY = 0.6      # Change event's vertical size here


To change setup the script's variables in game, call script :

CODE
Rei::ZoomActor::FLAG =switchId
   Rei::ZoomActor::EFLAG=switchId
   Rei::ZoomActor::ECOMM="writesomethinghere"
   Rei::ZoomActor::ZOOMX=#
   Rei::ZoomActor::ZOOMY=#
   Rei::ZoomActor::EZUMX=#
   Rei::ZoomActor::EZUMY=#
   Change switchId with, ehm, a switch's Id..
   Change # with a decymal number! (1.0 means normal size!)
   Change writesomethinghere with umm, something you want


Installation :
Put this script above main

Credits :
reijubv for making this script.
Miget man12 for making this script compatible with Woratana's caterpillar script.
Genshyu
Cool.
reijubv
SCRIPT UPDATED to V.2.00

Now you can resize an event's graphic size too!
Demo and screenshot added!

Have fun!
SuperMega
Woah, this script is awesome! I've totally been waiting for something like this for months! Thanks a lot for the awesome script.
miget man12
This is really useful! This makes things so much easier, job well done, reijubv!
Also, if anyone's using Wora's Caterpillar script, replace it with this, it'll make the followers the same size as the character:
[Show/Hide] Actor Resize w/ Wora Caterpillar Compatibility(sort of?)

CODE
#===============================================================================
# † [VX] † Rei Actor Resize † †
# † Change player's actor graphic size †
#-------------------------------------------------------------------------------
# † by reijubv [[email="aruyasoft@comic.com"]aruyasoft@comic.com[/email]]
# † RPG RPG Revolution
# † Released on: 27/04/2009
# † Version: 2.0 (May 1st 2009)
#-------------------------------------------------------------------------------
# > Changelog:
#   V.1.0 (25-04-09) = Initial release
#   V.2.0 (01-05-09) = Now resizing event's graphic is possible!
#-------------------------------------------------------------------------------
# † Information:
# A small script that allows you to change the size of player graphic by
# just using a switch.
# From V.2.0 :
# You can also change an event's graphic size now!
# To change an event's graphic size, you MUST do these things :
# (these examples are from the script's default settings)
# 1. adds this line to event's comment :
# rzoom                      
# 2. turn on the switch from the setting below (the one that called EFLAG)
# 3. see the effect yourself on your game!
# See the demo if you don't understand!
#-------------------------------------------------------------------------------
# Credit me (reijubv) if you use this script....
#-------------------------------------------------------------------------------
# ? Installation:
# Put this script above main, setup script below
#===============================================================================

#---------------------------------------------------------------------------
# ** Rei Module
#---------------------------------------------------------------------------
module Rei
    module ZoomActor
      #---------------------------------------------------------------------------
      # * Customize script here!
      #---------------------------------------------------------------------------
      #For player
      ZOOMX = 1       # Change actor's horizontal size here
      ZOOMY = 1       # Change actor's vertical size here
      FLAG  = 10      # Switch Id to (de)activate this script effect to player  

      #For event
      ECOMM = "rzoom" # Write this to an event's comment to change it's size
                      # automatically.
                      # Event that doesn't have this comment won't be affected
                      # even if the switch is turned on!
      EFLAG = 10      # Switch Id to (de)activate this script effect to events            
      EZUMX = 1       # Change event's horizontal size here
      EZUMY = 1       # Change event's vertical size here
    
    
                      # To change these variables in game, call script :
                      # Rei::ZoomActor::FLAG =switchId
                      # Rei::ZoomActor::EFLAG=switchId
                      # Rei::ZoomActor::ECOMM="writesomethinghere"
                      # Rei::ZoomActor::ZOOMX=#
                      # Rei::ZoomActor::ZOOMY=#
                      # Rei::ZoomActor::EZUMX=#
                      # Rei::ZoomActor::EZUMY=#
                      # Change switchId with, ehm, a switch's Id..
                      # Change # with a number!
                      # Change writesomethinghere with umm, something you want
    
      #---------------------------------------------------------------------------
      # * Stop customize script here!
      #---------------------------------------------------------------------------
    end
end

#==============================================================================
# ** Game_Event
#------------------------------------------------------------------------------
#  This class deals with events. It handles functions including event page
# switching via condition determinants, and running parallel process events.
# It's used within the Game_Map class.
#==============================================================================

class Game_Event < Game_Character
      #---------------------------------------------------------------------------
      # * check if event has a specified comment
      #---------------------------------------------------------------------------
    def has_comment?(comment, return_comment = false )
    
      if [email="%21@list.nil"]!@list.nil[/email]?
      
        for i in [email="0...@list.size"]0...@list.size[/email] - 1
          next if @list[i].code != 108
        
          if @list[i].parameters[0].include?(comment)
            return @list[i].parameters[0] if return_comment
            return true
          end
    
      end
      return '' if return_comment
      return false
    end
  
end
end

#==============================================================================
# ** Sprite_Character
#------------------------------------------------------------------------------
#  This sprite is used to display characters. It observes a instance of the
# Game_Character class and automatically changes sprite conditions.
#==============================================================================

class Sprite_Character < Sprite_Base
    #--------------------------------------------------------------------------
    # * Aliases
    #--------------------------------------------------------------------------  
    alias rei_update update
    #--------------------------------------------------------------------------
    # * Frame Update
    #--------------------------------------------------------------------------
  
    def update
    
      if @character.is_a?(Game_Player) and $game_switches[Rei::ZoomActor::FLAG]==true
        self.zoom_x = Rei::ZoomActor::ZOOMX
        self.zoom_y = Rei::ZoomActor::ZOOMY
      elsif @character.is_a?(Game_WCateracter) and $game_switches[Rei::ZoomActor::FLAG]==true
        self.zoom_x = Rei::ZoomActor::ZOOMX
        self.zoom_y = Rei::ZoomActor::ZOOMY
      elsif @character.is_a?(Game_Event) and $game_switches[Rei::ZoomActor::EFLAG]==true and @character.has_comment?(Rei::ZoomActor::ECOMM)==true
        self.zoom_x = Rei::ZoomActor::EZUMX
        self.zoom_y = Rei::ZoomActor::EZUMY
      else
        self.zoom_x = 1.0
        self.zoom_y = 1.0
      end
      rei_update  
    end
end
I'm using it and I found it very bothersome having the following members twice as big as the player. Hope this is helpful, not to steal your thunder or anything, Rei. Again, great script.

~Miget man12
reijubv
@Supermega
Well, I'm glad to help! happy.gif
I'm still trying to find out how to change the size of specific events, as you know, this script change all events that has the comment,
What I want to do is, for 1 event to another may have a different size...

@miget man12
Well thanks for making this script compatible with woratana's caterpillar,but I saw something weird in your version,

CODE
class Game_Event < Game_Character
      #---------------------------------------------------------------------------
      # * check if event has a specified comment
      #---------------------------------------------------------------------------
    def has_comment?(comment, return_comment = false )
    
      if [email="%21@list.nil"]!@list.nil[/email]?
      
        for i in [email="0...@list.size"]0...@list.size[/email] - 1
          next if @list[i].code != 108
        
          if @list[i].parameters[0].include?(comment)
            return @list[i].parameters[0] if return_comment
            return true
          end
      end

      return '' if return_comment
      return false
    end
  
end
end


Look, there's some [email] tags there....
I'll update the script now and of course credit you, thanks! biggrin.gif

SCRIPT UPDATED TO V.2.1!!!
n1njax 72
Cool cool Cool.... biggrin.gif
Zammoron
Yo yo!

First of all, thanks for an excellent script! I forsee many great things this can be used for... but I have a request!

Is there anyway that you could make individual Event size settings, or atleast like 3-5 different settings that could be used at the same time?

Right now, if I'd want an army of dudes to look unique, they'd either all be bigger or all be smaller (the ones with the comment when the switch is on, that is).

I would love it if I could have some smaller, some larger, some fatter and some thinner at the same time!
This would add to the feeling of individualism, I think.

Also, I would like to report a bug with version 2.1. Whenever I use it without Woratana's Catterpillar script, it crashes before it starts:

Script 'Shrink/enlarge actor' line 131: NameError occured.
uninitialized constant Sprite_Character::Game_WCateracter



I have tested this both on your own Demo and on a project of mine, both gets the same error, hopefully this will help!

Thanks
-Max
reijubv
SCRIPT UPDATED to V.2.2b!
Now you can use different size for each events!
Also compatible with Trickster's caterpillar and Originalwij's pet script!
See the new screenshot and demo!

@Zammoron
Just download the new version, also see the new Demo!


EDIT : I've mistype something in the script's header :

#----------------
# V.2.2 Feature :
#----------------
# (NOT FUNCTIONAL ANYMORE, SKIP TO V.2.1b INSTEAD!) :

It should be V.2.2b!
Zammoron
Woho!

It works perfectly! Now my fearsome warriors can be a little bit bigger than the peasants they kill smile.gif

Thanks alot man!
-Max
Epinaten
Hi reijubv

Could you please make a version compatible with the script requiem battle system?
Link: http://requiem.rodcats.com/node/3

Thanks beforehand!
sorasreincarnation
Very,Very outstanding job! I'm actually using this script for my game,in which you have to escape a destroying castle. I made my character small and he will escape through gaps in walls. But I have NO idea whatsoever to make events BIGGER. Can you help? I need a BIG cat boss to block my path. Yet when I use rzoom It only gets tinier. I hope you can help,It would be surely appreciated. happy.gif
Legacy
For some reason i can't get the downloads to work, is that just me o.o ?

EDIT:

nevermind its just my bad internet connection they work for me now.
yaden_chandra
Whoa... Nice script reijubv.. :thumbup:
But, why you delete it from RpgmakerID??
I learning all of your script.. Lol.. is too hard for me.. :swt:
Philip
Sorry for the Necro but I just want to say that this script is impressive! I'm learning to script by basically modifying other scripts (LOL) and this script is going to be a great addition for my upcoming game (credits of course).
Kread-EX
Philip... if you know it's a necro, then why are you doing it anyways? This is a verbal warn and there won't be another one.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.