RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Overworld Sprite Question

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 82
Code: [Select]
# change this to any number less than one to change the size of the world map
# sprites
ZOOM = 0.5
WORLD_IND = 'World Map'

class Game_Map
  attr_reader :name
  attr_reader :isworldmap
 
  alias ccoa_setup setup
  #--------------------------------------------------------------------------
  # * Setup
  #     map_id : map ID
  #--------------------------------------------------------------------------
  def setup(map_id)
    ccoa_setup(map_id)
    @name = load_data("Data/MapInfos.rxdata")[@map_id].name
    if @name.include?(WORLD_IND)
      @isworldmap = true
      @name.sub!(WORLD_IND, '')
    else
      @isworldmap = false
    end
  end
end

class Sprite_Character < RPG::Sprite
  alias ccoa_update update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    ccoa_update
    if @character.is_a?(Game_Player) and $game_map.isworldmap
      self.zoom_x = ZOOM
      self.zoom_y = ZOOM
    else
      self.zoom_x = 1.0
      self.zoom_y = 1.0
    end
  end
end
With the above script, is there a minor rewrite that can be done to make it so that if game_switch [X,Y,Z] = true then the zoom is 1.0?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
I don't know what game_switch [X, Y, Z] is, but assuming that what you mean is that you want the zoom to be normal if in-game switches X, Y, and Z are all ON, then you could do that by changing the following line:

Code: [Select]
    if @character.is_a?(Game_Player) and $game_map.isworldmap

to:

Code: [Select]
    if @character.is_a?(Game_Player) && $game_map.isworldmap &&
      $game_switches[X] && $game_switches[Y] && $game_switches[Z]

where X, Y, and Z are the IDs of the switches. If that isn't what you meant, you will need to clarify.

**
Rep:
Level 82
That's close to it, but I want the zoom to be normal if any one of the switches are on.

*
Rep:
Level 82
If that is close enough, then it's a case of adding or into the switches:

Code: [Select]
    if @character.is_a?(Game_Player) && $game_map.isworldmap &&
      ($game_switches[X] || $game_switches[Y] || $game_switches[Z])

That'll succeed whenever one of those switches is on.
(Why do I always feel like it's the end of the world and I'm the last man standing?)