Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Script zoom char, increse or reduce chara size

Zoom char VXVersion: 0.5
By: Falcao

Introduction

Here i bring you a script that allow you to increase or reduce the characters size

Screenshots

zoooom.png


RPG Maker VX script

Code:
 

#==================================================================#

#  #*****************#         Zoom char V 0.5 , Falcao script     #

#  #*** By Falcao ***#         allow you to increse the chara size #                   

#  #*****************#         making zoom effect.                 #

#         RMVX                                                     #

# makerpalace.onlinegoo.com                                        #

#==================================================================#

 

#-------------------------------------------------------------------

# * Commands

#

# $game_player.zoom(x,y)      player zoom command,

# Example.  $game_player.zoom(2,2) increase double

#

# $game_map.events[Event ID].zoom(x,y)   event zoom command  

# Example  $game_map.events[1].zoom(2,2)  event ID 1 increase double

#

# Note: Zoom support decimals

# Default zoom for each character is "(1,1)"

#--------------------------------------------------------------------

 

class Game_Character

  attr_accessor :zoom_x

  attr_accessor :zoom_y

  alias falcaozoom_ini initialize

  def initialize

    falcaozoom_ini

    @zoom_x = 1.0

    @zoom_y = 1.0

  end

  def zoom(x,y)

    self.zoom_x = x

    self.zoom_y = y

  end

end

 

class Sprite_Character < Sprite_Base

alias character_zoom_update update

 def update 

     character_zoom_update

     if @zoom_x != @character.zoom_x or

        @zoom_y != @character.zoom_y

        @zoom_x = @character.zoom_x

        @zoom_y = @character.zoom_y       

        self.zoom_x = @character.zoom_x

        self.zoom_y = @character.zoom_y

     end   

 end 

end

 

class Game_Player < Game_Character

  def zoom(x,y)

    self.zoom_x = x

    self.zoom_y = y

  end

end

 

 

RPG Maker XP script

Code:
 

#==================================================================#

#  #*****************#         Zoom char V 0.5 , Falcao script     #

#  #*** By Falcao ***#         allow you to increse the chara size #                   

#  #*****************#         making zoom effect.                 #

#         RMXP                                                     #

# makerpalace.onlinegoo.com                                        #

#==================================================================#

 

#-------------------------------------------------------------------

# * Commands

#

# $game_player.zoom(x,y)      player zoom command,

# Example.  $game_player.zoom(2,2) increase double

#

# $game_map.events[Event ID].zoom(x,y)   event zoom command  

# Example  $game_map.events[1].zoom(2,2)  event ID 1 increase double

#

# Note: Zoom support decimals

# Default zoom for each character is "(1,1)"

#--------------------------------------------------------------------

 

class Game_Character

  attr_accessor :zoom_x

  attr_accessor :zoom_y

  alias falcaozoom_ini initialize

  def initialize

    falcaozoom_ini

    @zoom_x = 1.0

    @zoom_y = 1.0

  end

  def zoom(x,y)

    self.zoom_x = x

    self.zoom_y = y

    if self.is_a?(Game_Player)

      self.zoom_x = x

      self.zoom_y = y

    end

  end

end

 

class Sprite_Character < RPG::Sprite

alias character_zoom_update update

 def update 

     character_zoom_update

     if @zoom_x != @character.zoom_x or

        @zoom_y != @character.zoom_y

        @zoom_x = @character.zoom_x

        @zoom_y = @character.zoom_y       

        self.zoom_x = @character.zoom_x

        self.zoom_y = @character.zoom_y

     end   

 end 

end

 

Instructions

Copy and paste the script to your project and call the script using the following commands

$game_player.zoom(x,y) player zoom command,
Example. $game_player.zoom(2,2) increase double

$game_map.events[Event ID].zoom(x,y) event zoom command
Example $game_map.events[1].zoom(2,2) event ID 1 increase double

Note: Zoom support decimals
Default zoom for each character is "(1,1)"

Compatibility

Sprite_Character aliased

Credits and Thanks

By Falcao

Author's Notes

Enjoy

Terms and Conditions

This script can be posted in every forums but you have to give credits to the author
 

Jason

Awesome Bro

This could be really handy for me, however, I'm using XP sadly :sad:

Do you think there's a possibility of you making this compatible with XP too ? :angel:
 
jъГìsт":1q6plqmj said:
This could be really handy for me, however, I'm using XP sadly :sad:

Do you think there's a possibility of you making this compatible with XP too ? :angel:


Ok, i update the post and now we have both RMVX and RMXP script!!!

Enjoy
 
I hope you realize that both of these scripts have redundant code. Specifically, the repetition involving the zoom method. If you have it in Game_Character, you have no need to insert an identical method in Game_Player. Another tidbit of information is that you have no need to check to see if the character is indeed an instance of Game_Player when you set the zoom_x and zoom_y in RMXP. In fact, the two lines prior to that check will be sufficient. (Especially considering the fact that if the check proves true, all it does is repeat those two lines all over again)
 

Jason

Awesome Bro

falcao":235ckxzg said:
jъГìsт":235ckxzg said:
This could be really handy for me, however, I'm using XP sadly :sad:

Do you think there's a possibility of you making this compatible with XP too ? :angel:


Ok, i update the post and now we have both RMVX and RMXP script!!!

Enjoy

Ah thanks for that, it'll make my life alot easier.

And Glitch, care to post the scripts without the redundant code ? (Unless falcao does it first)
 
jъГìsт":2uzpxuxm said:
Ah thanks for that, it'll make my life alot easier.

And Glitch, care to post the scripts without the redundant code ? (Unless falcao does it first)

Actually, it's an easy enough fix that you can do it. In the XP version, you want to remove lines 35-38 (the if statement), while in the VX version you can remove lines 52-57. (The entire modification to Game_Player)
 

Jason

Awesome Bro

Meh, why didn't I think of just doing that myself (Now I look over it again, it looks obvious, lol)... maybe it's cause I'm tired and everything is blurry...
 
Hmm, I got "Syntax error occurred while running script" after using the script in an event to shrink the charset to (.5,.5) with the XP version.

Can we not go below (1,1)?
 
Doh! That should have been obvious!
Thanks Daniel!


This script is wonderful, and so easy to use!

Saves me from making worldmap charsets for every character, while at the same time resolving an issue I was having with my save file menu! WooHoo!
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top