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.

Shrink Player Graphic by 50% on World Map

Shrink Player Graphic by 50% on World Map
For RMVX

Description:
I would like a scriptlet that shrinks the player graphic, what ever it is, by 50% when the player is on a map called "World Map", it still needs to be compatible with the general Set Move Route commands that change player graphics, transparency, etc.

Other Scripts I am using (in order):
My own custom menu system
My own "get map name" module
Dargor's map for title VX
A side-view active timer custom battle system

Just ask for more info
Thank you
 
You can open up any image program and size a graphic down by half. Then you would only have to import that graphic into the game folder and use the "Change Graphic" command when entering the world map. There is no need for scripting.
 
KRoP":1l4n92bs said:
You can open up any image program and size a graphic down by half. Then you would only have to import that graphic into the game folder and use the "Change Graphic" command when entering the world map. There is no need for scripting.

Or, a simple script could check the map name on load, and resize the image with the "zoom" command. When that is done, all you have is a smaller graphic, with no other changes. In fact, I think I'll work on that right now.

Edit: Here you go.

Code:
#==============================================================================

# ** Game_Map

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

#  This class handles maps. It includes scrolling and passage determination

# functions. The instance of this class is referenced by $game_map.

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

 

class Game_Map

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

  # * Alias Method

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

  alias glitch_game_map_setup setup

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

  # * Setup

  #     map_id : map ID

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

  def setup(map_id)

    map_data = load_data("Data/MapInfos.rvdata")

    name = map_data[map_id].name

    if name == "World Map"

      $game_player.zoom_x = 0.50

      $game_player.zoom_y = 0.50

    else

      $game_player.zoom_x = 1.00

      $game_player.zoom_y = 1.00

    end

    glitch_game_map_setup(map_id)

  end

end

 

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

# ** Game_Character

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

#  This class deals with characters. It's used as a superclass of the

# Game_Player and Game_Event classes.

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

 

class Game_Character

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

  # * Public Instance Variables

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

  attr_accessor :zoom_x                   # character horizontal zoom

  attr_accessor :zoom_y                   # character vertical zoom

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

  # * Alias Method

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

  alias glitch_game_character_init initialize

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

  # * Object Initialization

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

  def initialize

    @zoom_x = 1.00

    @zoom_y = 1.00

    glitch_game_character_init

  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

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

  # * Alias Method

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

  alias glitch_sprite_character_update update

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

  # * Frame Update

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

  def update

    glitch_sprite_character_update

    self.zoom_x = @character.zoom_x

    self.zoom_y = @character.zoom_y

  end

end
 
KRoP":3ck946oj said:
You can open up any image program and size a graphic down by half. Then you would only have to import that graphic into the game folder and use the "Change Graphic" command when entering the world map. There is no need for scripting.
That wouldn't be useful as the player is required to return to the world map countless times and there are 7 different player graphics, so there would need a few conditional branched events.

Thanks glitch I'll try that now.
 

Jason

Awesome Bro

Glitch, I got a question, would that script work for RMXP if I changed;

map_data = load_data("Data/MapInfos.rvdata")

to

map_data = load_data("Data/MapInfos.rxdata")

Cause this could come in handy with quite a lot of games, and it'd be nice to be compatible with both makers...
 
jbrist":2kj3vwm9 said:
Glitch, I got a question, would that script work for RMXP if I changed;

map_data = load_data("Data/MapInfos.rvdata")

to

map_data = load_data("Data/MapInfos.rxdata")

Cause this could come in handy with quite a lot of games, and it'd be nice to be compatible with both makers...

Actually, yeah. If you look in your RMXP data folder, you'll see a MapInfos.rxdata file. Just so you know, that line of code came from an old support thread posted here, where someone wanted to display a map's name in RMXP using scripts. (Their thread was apparently never resolved, but I got that nice fix from it)
 

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