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.

[RMXP] Meph's Location Window

Location Window
MephistoX
Version 2.5

Introduction

I'm Back, now I learn a few things about scripting (At least God!!).. Not so much, but something is somethings..I guess.
Well, this script allow you to view a little window in a scene, and show the current map name. Thats all.

Features

- 2 types of Map name: 0: The original Map name (The editor map you put) and 1: Hash map name, you can custom every map and put to every map a custom name.

Ex: 1 => 'Map 1', 2=> 'Map 2'...blah blah...That.

- Map Item: You need a item (a map) to view the map name in the menu.
- Party Level: If the party reach a level of 'Average' you can see the map. if not...no..
- Icon, color: Each map, has it's own name_color and icon.
- Unknow Maps: Some maps will be secret maps, for example, so, there is no name for thats maps, or you can select a special name. (Hashed ;))

And other things..well you know if you need a switch or another requirement Ask for me :).


Requirements

- Trickster's Map Info
- SDK 2.x
- MACL 2.1

Screenshots

Please, forget the menu, see only the red circled window  :grin:

http://img258.imageshack.us/img258/2953/dibujocx1.png[/img]

DEMO

Useless...

Script

Map_Info

=begin
=============================================================================
â–  Map Info
=============================================================================
Trickster
Version 1.2
3.21.07
=============================================================================
=end

#--------------------------------------------------------------------------
# * Begin SDK Log
#--------------------------------------------------------------------------
SDK.log('Map Info', 'Trickster', 1.2, '3.21.07')
#--------------------------------------------------------------------------
# Begin SDK Requirement Check
#--------------------------------------------------------------------------
SDK.check_requirements(2.0, [1, 2, 3])
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.enabled?('Map Info')
 
#--------------------------------------------------------------------------
# * Save RPG::MapInfo Data
#   Set to To True to Save MapInfo Data this moves the RPG::Map stuff to
#   RPG::MapInfo so maps will not be loaded frequently to get the map info.
#   Set it to True run project at least once then set to false, set to
#   true again if you changed any of your maps
#--------------------------------------------------------------------------
Save_MapInfoData = false

#--------------------------------------------------------------------------
# * Update RPG::MapInfo Data
#   Set this to true if you changed any of your maps
#--------------------------------------------------------------------------
Update_MapInfoData = false

 
class RPG::MapInfo
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :tileset_id
  attr_accessor :width
  attr_accessor :height
  attr_accessor :autoplay_bgm
  attr_accessor :bgm
  attr_accessor :autoplay_bgs
  attr_accessor :bgs
  attr_accessor :encounter_list
  attr_accessor :encounter_step
end

class Scene_Title
  #--------------------------------------------------------------------------
  # * Main Database
  #--------------------------------------------------------------------------
  alias_method :trick_mapinfo_title_main_database, :main_database
  def main_database
    # The Usual
    trick_mapinfo_title_main_database
    # Create $data_mapinfos object
    $data_mapinfos = load_data("Data/MapInfos.rxdata")
    # Setup encounter info
    setup_map_info
  end
  #--------------------------------------------------------------------------
  # * Battle Test Database
  #--------------------------------------------------------------------------
  alias_method :trick_mapinfo_title_battletest_database, :battletest_database
  def battletest_database
    # The Usual
    trick_mapinfo_title_battletest_database
    # Create $data_mapinfos object
    $data_mapinfos = load_data("Data/MapInfos.rxdata")
    # Setup encounter info
    setup_map_info
  end
  #--------------------------------------------------------------------------
  # * Setup Map Info
  #--------------------------------------------------------------------------
  def setup_map_info
    # Return if test value is not nil or updating info
    return if $data_mapinfos[1].width != nil and !Update_MapInfoData
    # Begin
    begin
      # Do from 1 to 999 (Maximum number of maps)
      1.upto(999) do |map_id|
        # Load Map
        map = load_data(sprintf("Data/Map%03d.rxdata", map_id))
        # Set Map Info Object
        $data_mapinfos[map_id].tileset_id = map.tileset_id
        $data_mapinfos[map_id].width = map.width
        $data_mapinfos[map_id].height = map.height
        $data_mapinfos[map_id].autoplay_bgm = map.autoplay_bgm
        $data_mapinfos[map_id].bgm = map.bgm
        $data_mapinfos[map_id].autoplay_bgs = map.autoplay_bgs
        $data_mapinfos[map_id].bgs = map.bgs
        $data_mapinfos[map_id].encounter_list = map.encounter_list
        $data_mapinfos[map_id].encounter_step = map.encounter_step
      end
    rescue Errno::ENOENT
      # If Save Map Info Data Save Data
      save_data($data_mapinfos, "Data/MapInfos.rxdata") if Save_MapInfoData
    end
  end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end

The script.

#==============================================================================
# ** Location Window (little based on Tibuda Work)
#------------------------------------------------------------------------------
# MephistoX
# Version 2.5
# 2008-06-21
# SDK : Version 2.0+, Part I
#------------------------------------------------------------------------------
# * Version History :
#
#  Version 1 ---------------------------------------------------- (2007-05-07)
#    Version 2.0 ------------------------------------------------ (2008-06-10)
#    - Update : Update to SDK 2.x
#    Version 2.5 ------------------------------------------------- (2008-06-21)
#    - Update : Enhanced system and add MACL requirements (+Features)
#------------------------------------------------------------------------------
# * Requirements :
#
#  Method & Class Library 2.1
#  Trickster'S Map Info Script.
#------------------------------------------------------------------------------
# * Description :
#
#  Este script muestra una ventana de ubicacion(Nombre del mapa) que puede ser
#  adherida a cualquier $scene.
#------------------------------------------------------------------------------
# * Instructions :
#
#  Place The Script Below the SDK and Above Main.
#------------------------------------------------------------------------------
# * Custom the Window :
#
#  Refer to the module to make the changes and view all the features of the
#  window.
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Location Window', 'MephistoX', 2.5, '2008-06-21')
SDK.check_requirements(2.0, [], {'Method & Class Library' => 2.1, 'Map Info' => 1.2})

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.enabled?('Location Window')
 
#==============================================================================
# ** Module Map_System
#==============================================================================

module Map_System
  #--------------------------------------------------------------------------
  # * Map_Item for $game_party.items.
  #--------------------------------------------------------------------------
  Map_Item = 1
  #--------------------------------------------------------------------------
  # * Map_Icon
  #--------------------------------------------------------------------------
  Map_Icon = {}
  Map_Icon.default = 'MP_001-Map01'
  #--------------------------------------------------------------------------
  # * Party_Average_Level for Game_Party Average level to use the map.
  #--------------------------------------------------------------------------
  Party_Level = 0
  #--------------------------------------------------------------------------
  # * Map_Switch for Switch on to view the map name.
  #--------------------------------------------------------------------------
  Map_Switch = nil
  #--------------------------------------------------------------------------
  # * No_Map_String for No Map in inventory.
  #--------------------------------------------------------------------------
  No_Map_String = 'No tienes Mapa'
  #--------------------------------------------------------------------------
  # * No_Map_Icon.
  #--------------------------------------------------------------------------
  No_Map_Icon = ''
  #--------------------------------------------------------------------------
  # * Unknow_Maps for maps that will not be display.
  #--------------------------------------------------------------------------
  Unknow_Maps = []
  #--------------------------------------------------------------------------
  # * Unknow_Name for Unknow Map's Names.
  #--------------------------------------------------------------------------
  Unknow_Name = {}
  Unknow_Name.default = 'Este mapa esta oculto'
  #--------------------------------------------------------------------------
  # * Unknow_Color for Unknow Map's Name color.
  #--------------------------------------------------------------------------
  Unknow_Color = Color.knockout
  #--------------------------------------------------------------------------
  # * Name_Color for Map_Name_Color.
  #--------------------------------------------------------------------------
  Map_Name_Color = {}
  Map_Name_Color.default = Color.white
  #--------------------------------------------------------------------------
  # * Unknow_Maps for maps that will not be display.
  #--------------------------------------------------------------------------
  Map_Names = {5 => 'Tienda de Abarrotes'}
  Map_Names.default = 'Sin Nombre'
  #--------------------------------------------------------------------------
  # * Kind for Type of name - 0: Original Name, 1: Map_Names Hash.
  #--------------------------------------------------------------------------
  Kind = 1
end

#==============================================================================
# ** Game_Map
#==============================================================================

class Game_Map
  #--------------------------------------------------------------------------
  # * Map_Name
  #--------------------------------------------------------------------------
  def name
    unless Map_System::Unknow_Maps.include?(@map_id)
      if Map_System::Kind == 1
        Map_System::Map_Names[@map_id]
      else
        $data_mapinfos[@map_id].name
      end
    else
      Map_System::Unknow_Name[@map_id]
      end
    end
  #--------------------------------------------------------------------------
  # * Name_Color
  #--------------------------------------------------------------------------
  def name_color
    unless Map_System::Unknow_Maps.include?(@map_id)
    Map_System::Map_Name_Color[@map_id]
  else
    Map_System::Unknow_Color
  end
  end
  #--------------------------------------------------------------------------
  # * Map_Icon
  #--------------------------------------------------------------------------
  def icon
    unless Map_System::Unknow_Maps.include?(@map_id)
    Map_System::Map_Icon[@map_id]
  else
    Map_System::No_Map_Icon
    end
  end
end

#==============================================================================
# ** Window_MapName
#------------------------------------------------------------------------------
#  Esta ventana muestra el nombre del mapa actual en el que te encuentras.
#  Ademas de una serie de Sprites para adornar.
#==============================================================================

class Window_MapName < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 480, 59)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_icon_text(35, -3, 120, 35, 'Ubicacion:')
  #--------------------------------------------------------------------------
  # * Condition_Meets
  #--------------------------------------------------------------------------
  party_level = $game_party.average_level
  mod = Map_System
  #--------------------------------------------------------------------------
  if $game_party.item_number(mod::Map_Item) >= 1 && party_level >= mod::Party_Level
      self.contents.font.color = $game_map.name_color
      self.contents.draw_icon_text(120, -3, 320, 35, $game_map.name)
      bitmap = RPG::Cache.icon($game_map.icon)
      self.contents.blt(0 , 3, bitmap, Rect.new(0, 0, 24, 24))
    else
      self.contents.font.color = mod::Unknow_Color
      self.contents.draw_icon_text(120, -3, 320, 35, mod::No_Map_String)
      bitmap = RPG::Cache.icon(mod::No_Map_Icon)
      self.contents.blt(0 , 3, bitmap, Rect.new(0, 0, 24, 24))
      end
    end
  end
 
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end

CREDITS

Creditos go to MephistoX, and thanks to tibuda I'm based little on his Location_Window..Only a little  :lol:


Enjoy It!. (A Question?...ask for me again) =)
 

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