Main Menu
  • Welcome to The RPG Maker Resource Kit.

Auto Location Name

Started by michael95, May 13, 2011, 05:28:33 PM

0 Members and 1 Guest are viewing this topic.

michael95

I want when player enter the town or dungeon, so that show town name on up screen. But only, when player enter first part of town (first map).

hexgame

Try this. Was made by Falcao.



#=================================================================#
#=================================================================#
#  #*****************#      Display map name on map with fade     #
#  #*** By Falcao ***#      effect. Just copy and paste.          # 
#  #*****************#                 Enjoy!                     #
#         RMVX                                                    #
#=================================================================#

module Fal_map_name
#------------------------------------------------------------------ 
# Window display disable Switch
Disable_window = 50
#------------------------------------------------------------------
# Change display position, you ca choose between two display
# positions, change  1 or 2
#
# 1 = Upper frontal position
# 2 = Lower left
Change_posision = 1
#------------------------------------------------------------------
end

class Window_Nmap < Window_Base
  def initialize
    super(185, -70, 190, 50)
    self.opacity = 200
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.font.size = 20
    data = load_data("Data/MapInfos.rvdata")
    self.contents.draw_text(0, -7, 150, 32, data[$game_map.map_id].name, 2)
  end
end

class Game_System
  attr_accessor  :fade_time
  alias falcao_fading_initialize initialize
  def initialize
    @fade_time = 0
    falcao_fading_initialize
  end
end

class Scene_Map
  include Fal_map_name
  alias falcaoVX_Mname_main main
  def main
    @map_name = Window_Nmap.new
    if $game_switches[Disable_window] == false
      @map_name.visible = true
    else
      @map_name.visible = false
    end
    if Change_posision == 2
    @map_name.x = -200; @map_name.y = 300
    end
    falcaoVX_Mname_main
    @map_name.dispose
  end
  alias falcaoVX_Mname_update update
  def update
    if $game_switches[Disable_window] == false
      @map_name.visible = true
    else
      @map_name.visible = false
    end
    @map_name.y += 2 if @map_name.y < 0 and Change_posision <= 1
    @map_name.x += 5 if @map_name.x < -4 and Change_posision >= 2
    if $game_system.fade_time == 140
      @map_name.y -= 3 if @map_name.y > -90 and Change_posision <= 1
      @map_name.x -= 7 if @map_name.x < 20 and Change_posision >= 2
      @map_name.contents_opacity -= 5
      @map_name.opacity -= 5
    else
      $game_system.fade_time += 1
    end
      falcaoVX_Mname_update
    end
    alias falcao_transfer_player update_transfer_player
    def update_transfer_player
      @map_name.refresh
      return unless $game_player.transfer?
      @map_name.contents_opacity = 255; @map_name.opacity = 200
      if Change_posision <= 1
        @map_name.x = 185; @map_name.y = -70
      elsif Change_posision >= 2
         @map_name.x = -200; @map_name.y = 300
       end
       $game_system.fade_time = 0
       falcao_transfer_player
     end
   end


michael95

I forgot tell you that I using RMXP