The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: Dark_falcao on May 09, 2009, 04:02:33 PM

Title: Script Fal-MapName, display map name on map!
Post by: Dark_falcao on May 09, 2009, 04:02:33 PM
Hello people.

Here a script that allow you to display the map name on map with a  handsome fade effect

Intructions: Just copy and paste to your project. yeah! easy like eat a peace of cake, but if you want to configure some thing like the display position you can do it in the module Fal_map_name of the script.

if you want to disable de display window you can activate the switch 50 (by deafault) you can change it.

Ok here the script. remember Just copy and paste to your project!!

Code: [Select]
#=================================================================#
#=================================================================#
#  #*****************#      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
 
Title: Re: Script Fal-MapName, display map name on map!
Post by: Charbel on May 10, 2009, 07:23:29 PM
very nice script  :D
(vc é brasileiro?)
Title: Re: Script Fal-MapName, display map name on map!
Post by: Dark_falcao on May 11, 2009, 01:43:36 PM
Thank you!  ;D

Im not brasilero im salvadorean  :D Central America
Title: Re: Script Fal-MapName, display map name on map!
Post by: kitten2021 on August 05, 2009, 12:32:05 AM
Question please, why do you have this piece in the script?

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

What does it do exactly? I am asking because I am trying to use your script and another I made to build my own window inside the Menu that will show you the name of the map you are in and possibly a small description about it for you. But, I am not sure what this part of your script is actually doing for the script itself. Please explain... Thank you.
Title: Re: Script Fal-MapName, display map name on map!
Post by: Grafikal on August 05, 2009, 12:37:02 AM
I'm no pro for scripting, but checkin out those terms in there, I would guess that it defines and initializes the fade on the map name and sets how long it fades for or something like that.
Title: Re: Script Fal-MapName, display map name on map!
Post by: kitten2021 on August 05, 2009, 12:45:44 AM
So then this would need to be removed for it to show up correctly inside my menu then, am I correct?

(Soooooo sry for all the questions I have been asking in the forums btw, but everyone has been very nice to me and answered all my questions.)  :)   <3   <3   <3
Title: Re: Script Fal-MapName, display map name on map!
Post by: Grafikal on August 05, 2009, 12:47:24 AM
I have no clue what you would need to do with this lol, I was just trying to figure out what it basically means, since that's what you asked. I'm not a scripter hah.

Cool that you're trying to script or get into scripting though. Good luck.
Title: Re: Script Fal-MapName, display map name on map!
Post by: kitten2021 on August 05, 2009, 03:59:15 AM
Thanks! :)
Title: Re: Script Fal-MapName, display map name on map!
Post by: Dark_falcao on August 12, 2009, 10:30:35 PM
Question please, why do you have this piece in the script?

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

What does it do exactly? I am asking because I am trying to use your script and another I made to build my own window inside the Menu that will show you the name of the map you are in and possibly a small description about it for you. But, I am not sure what this part of your script is actually doing for the script itself. Please explain... Thank you.

That part of the script allow you fade the display window,

That work in the map only it is not necessary if you wanna add the map name window to the menu scene