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.

Saying what area you'r in when you walk into a new one

I know there is a way to make it say what area you are in based on the map ID but i can't figuer out how to use the script
Code:
class Game_Map    

  def name

     $map_infos[@map_id]

  end   

end
And make it say the name of the map when you enter a new area. No i do not just want to make a text box open up and say VILLIAGE so dont suggest doing that. Or should i make it so a picture pop's up at the top corner saying what area.The problum with that is you have to wait till it goes away to walk so if there is a way around that please let me know.

Thank's
 
No need for a scirpt. Put in every map a paraler event that either shows a picture or text. use the delete event command. W/E you want.
Although if you want something special you can just use the search function.
 
Possible with a location variable as well in case the person means areas and not maps. For instance, Quiremirk Swamp is ten maps, you may not want the picture to come up every map transition, but only when you enter the area from either the beginning or the end. So an X/Y variable on the par. process event would make sure that only when entering from a single point would trigger the area name.
 
Mog's scripts are pretty good. ^^
Here's one that does what you want to do.

Code:
#_______________________________________________________________________________

# MOG_MPW Map_Name V1.2            

#_______________________________________________________________________________

# By Moghunter       

# [url=http://www.atelier-rgss.com]http://www.atelier-rgss.com[/url]

#_______________________________________________________________________________

module MOG

#Font Name.

MPFONT = "Bailey MF"

#Fade ON/OFF(True - False).

MPNMFD = true

#Fade Time(in seconds).

MPNMTM = 10

#Window Position.

# 0 = Upper Left.

# 1 = Lower Left.

# 2 = Upper Right.

# 3 = Lower Right.

MPNMPS = 0

# Disable Window Switch(ID).

WM_SWITCH_VIS_DISABLE = 65

end

#_________________________________________________

$mogscript = {} if $mogscript == nil

$mogscript["mpmapname"] = true

###############

# Game_System #

###############

class Game_System

attr_accessor :fdtm

attr_accessor :mpnm_x

attr_accessor :mpnm_y

alias mog24_initialize initialize

def initialize

mog24_initialize

@fdtm = 255 + 40 * MOG::MPNMTM

if MOG::MPNMPS == 0 

@mpnm_x = -300

@mpnm_y = 0

elsif MOG::MPNMPS == 1

@mpnm_x = -300

@mpnm_y = 380

elsif MOG::MPNMPS == 2

@mpnm_x = 640

@mpnm_y = 0

else 

@mpnm_x = 640

@mpnm_y = 380

end  

end

def mpnm_x

return @mpnm_x

end

def mpnm_y

return @mpnm_y

end

def fdtm

if @fdtm <= 0

@fdtm = 0 

end

return @fdtm

end

end 

############

# Game_Map #

############

class Game_Map

attr_reader   :map_id  

def mpname

$mpname = load_data("Data/MapInfos.rxdata") 

$mpname[@map_id].name

end

end

###############

# Window Base #

###############

class Window_Base < Window

def nd_mapic 

mapic = RPG::Cache.picture("")     

end  

def draw_mpname(x,y)

mapic = RPG::Cache.picture("Mpname") rescue nd_mapic   

cw = mapic.width  

ch = mapic.height 

src_rect = Rect.new(0, 0, cw, ch)

self.contents.blt(x , y - ch + 65, mapic, src_rect)

self.contents.font.name = MOG::MPFONT

self.contents.font.size = 22

self.contents.font.color = Color.new(0,0,0,255)

self.contents.draw_text(x + 76, y + 27, 110, 32, $game_map.mpname.to_s,1)

self.contents.font.color = Color.new(255,255,255,255)

self.contents.draw_text(x + 75, y + 26, 110, 32, $game_map.mpname.to_s,1)

end

end

##########

# Mpname #

##########

class Mpname < Window_Base

def initialize

super($game_system.mpnm_x, $game_system.mpnm_y, 250, 100)

self.contents = Bitmap.new(width - 32, height - 32)

self.opacity = 0

refresh

end

def refresh

self.contents.clear

draw_mpname(10,0)    

end

end

#############

# Scene_Map #

#############

class Scene_Map

alias mog24_main main

def main

@mpnm = Mpname.new

@mpnm.contents_opacity = $game_system.fdtm

if $game_switches[MOG::WM_SWITCH_VIS_DISABLE] == false

@mpnm.visible = true

else

@mpnm.visible = false  

end  

mog24_main

@mpnm.dispose

end

alias mog24_update update

def update

mog24_update  

$game_system.mpnm_x = @mpnm.x

$game_system.mpnm_y = @mpnm.y

if $game_switches[MOG::WM_SWITCH_VIS_DISABLE] == false

if $game_system.fdtm <= 0

@mpnm.visible = false  

else

@mpnm.visible = true  

end 

else

@mpnm.visible = false  

end 

if MOG::MPNMPS == 0 or MOG::MPNMPS == 1 

if @mpnm.x < 0

   @mpnm.x += 8

elsif @mpnm.x >= 0

   @mpnm.x = 0

end   

else

if @mpnm.x > 400

   @mpnm.x -= 8

elsif @mpnm.x <= 400

   @mpnm.x = 400

end     

end 

@mpnm.contents_opacity = $game_system.fdtm

if MOG::MPNMFD == true

$game_system.fdtm -= 3

end

end

alias mog24_transfer_player transfer_player

def transfer_player

mog24_transfer_player

if MOG::MPNMPS == 0 

$game_system.mpnm_x = -300

$game_system.mpnm_y = 0

elsif MOG::MPNMPS == 1

$game_system.mpnm_x = -300

$game_system.mpnm_y = 380

elsif MOG::MPNMPS == 2

$game_system.mpnm_x = 640

$game_system.mpnm_y = 0

else 

$game_system.mpnm_x = 640

$game_system.mpnm_y = 380

end  

@mpnm.y = $game_system.mpnm_y

@mpnm.x = $game_system.mpnm_x

$game_system.fdtm = 255 + 40 * MOG::MPNMTM

@mpnm.refresh

end

end
 

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