Pessoal sou novo aqui, eu estou criando um jogo online pelo netplay 3.0 e precisava de um scrpit que aparecesse o nome do mapa em que você está, como se fosse o local.
Se alguem puder me ajudar agradeço!!!
Se alguem puder me ajudar agradeço!!!
#_______________________________________________________________________________
# MOG_Location_Name V2.3
#_______________________________________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_______________________________________________________________________________
# Apresenta o nome do mapa.
# É preciso ter uma imagem com o nome de "Mpname" dentro
# da pasta pictures.
#_______________________________________________________________________________
module MOG
#Nome da fonte.
LOCATION_FONT_NAME = "Georgia"
#Tamanho da fonte.
LOCATION_FONT_SIZE = 20
#Fonte com contorno.
LOCATION_FONT_BOLD = true
#Fonte em italico
LOCATION_FONT_ITALIC = true
#Tempo de permanencia da janela.
LOCATION_TIME = 1
#Ativar efeito de zoom
LOCATION_ZOOM_EFFECT = true
#Posição horizontal da janela
LOCATION_X = 20
#Posição vertical da janela
LOCATION_Y = 10
#Posição do texto.
LOCATION_TEXT_X = 30
LOCATION_TEXT_Y = 10
#ID da Swicht que desativa a janela
LOCATION_SWITCH_OFF = 15
end
#==============================================================================
# Game_Temp
#==============================================================================
class Game_Temp
attr_accessor :loc_time
attr_accessor :loc_name_x
attr_accessor :loc_name_y
attr_accessor :loc_name_zoom_x
attr_accessor :loc_name_zoom_y
attr_accessor :loc_name_opa
attr_accessor :loc_layout_x
attr_accessor :loc_layout_y
attr_accessor :loc_layout_zoom_x
attr_accessor :loc_layout_zoom_y
attr_accessor :loc_layout_opa
#--------------------------------------------------------------------------
# Initialize
#--------------------------------------------------------------------------
alias mog_animapname_initialize initialize
def initialize
mog_animapname_initialize
@loc_time = 40 * MOG::LOCATION_TIME
@loc_name_x = 60
@loc_name_y = 0
@loc_name_zoom_x = 1.2
@loc_name_zoom_y = 1.2
@loc_name_opa = 255
@loc_layout_x = -60
@loc_layout_y = 0
@loc_layout_zoom_x = 1
@loc_layout_zoom_y = 1
@loc_layout_opa = 255
end
end
#==============================================================================
# Game_Map
#==============================================================================
class Game_Map
attr_reader :map_id
#--------------------------------------------------------------------------
# Mpname
#--------------------------------------------------------------------------
def mpname
$mpname = load_data("Data/MapInfos.rxdata")
$mpname[@map_id].name
end
end
#==============================================================================
# Sprite_Location
#==============================================================================
class Sprite_Location < Sprite
include MOG
#--------------------------------------------------------------------------
# Initialize
#--------------------------------------------------------------------------
def initialize
@viewport = Viewport.new(0, 0, 640, 480)
@viewport.z = 99999
super(@viewport)
@layout = Sprite.new
@layout.bitmap = RPG::Cache.picture("Mpname")
@layout.z = 9998
@layout.ox = -LOCATION_X + $game_temp.loc_layout_x
@layout.oy = -LOCATION_Y + $game_temp.loc_layout_y
@layout.opacity = $game_temp.loc_layout_opa
@location_name = Sprite.new
@location_name.bitmap = Bitmap.new(200,60)
@location_name.z = 9999
@location_name.bitmap.font.size = LOCATION_FONT_SIZE
@location_name.bitmap.font.name = LOCATION_FONT_NAME
@location_name.bitmap.font.bold = LOCATION_FONT_BOLD
@location_name.bitmap.font.italic = LOCATION_FONT_BOLD
@location_name.ox = -LOCATION_X + $game_temp.loc_name_x
@location_name.oy = -LOCATION_Y + $game_temp.loc_name_y
@location_name.opacity = $game_temp.loc_name_opa
@location_name.bitmap.draw_text(30 + LOCATION_TEXT_X, 0 + LOCATION_TEXT_Y, 130, 60, $game_map.mpname.to_s,1)
@location_anime_time = 20
if LOCATION_ZOOM_EFFECT == true
@location_name.zoom_x = $game_temp.loc_name_zoom_x
@location_name.zoom_y = $game_temp.loc_name_zoom_y
@layout.zoom_x = $game_temp.loc_layout_zoom_x
@layout.zoom_y = $game_temp.loc_layout_zoom_y
end
if $game_switches[MOG::LOCATION_SWITCH_OFF] == true
@location_name.visible = false
@layout.visible = false
else
@location_name.visible = true
@layout.visible = true
end
update
end
#--------------------------------------------------------------------------
# Dispose
#--------------------------------------------------------------------------
def dispose
if @layout != nil
@layout.bitmap.dispose
@layout.dispose
@layout = nil
end
if @location_name != nil
@location_name.bitmap.dispose
@location_name.dispose
@location_name = nil
end
if @viewport != nil
@viewport.dispose
@viewport = nil
end
end
#--------------------------------------------------------------------------
# Refresh
#--------------------------------------------------------------------------
def refresh
$game_temp.loc_time = 40 * LOCATION_TIME
$game_temp.loc_layout_opa = 255
$game_temp.loc_name_opa = 255
$game_temp.loc_layout_x = -60
$game_temp.loc_name_x = 60
$game_temp.loc_layout_opa = 0
$game_temp.loc_name_opa = 0
$game_temp.loc_layout_zoom_x = 1
$game_temp.loc_layout_zoom_y = 1
$game_temp.loc_name_zoom_x = 1.2
$game_temp.loc_name_zoom_y = 1.2
@location_name.bitmap.clear
@location_name.bitmap.draw_text(30 + LOCATION_TEXT_X, 0 + LOCATION_TEXT_Y, 130, 60, $game_map.mpname.to_s,1)
@location_anime_time = 20
end
#--------------------------------------------------------------------------
# Update
#--------------------------------------------------------------------------
def update
location_effect_update
visible_update
end
#--------------------------------------------------------------------------
# Visible Update
#--------------------------------------------------------------------------
def visible_update
if $game_switches[MOG::LOCATION_SWITCH_OFF] == true
@location_name.visible = false
@layout.visible = false
else
@location_name.visible = true
@layout.visible = true
end
end
#--------------------------------------------------------------------------
# Location Effect Update
#--------------------------------------------------------------------------
def location_effect_update
@location_anime_time -= 1 if @location_anime_time > 0
if @location_anime_time <= 0
$game_temp.loc_time -= 1 if $game_temp.loc_time > 0
end
@layout.ox = -LOCATION_X + $game_temp.loc_layout_x
@layout.oy = -LOCATION_Y + $game_temp.loc_layout_y
@layout.opacity = $game_temp.loc_layout_opa
@location_name.ox = -LOCATION_X + $game_temp.loc_name_x
@location_name.oy = -LOCATION_Y + $game_temp.loc_name_y
@location_name.opacity = $game_temp.loc_name_opa
if LOCATION_ZOOM_EFFECT == true
@location_name.zoom_x = $game_temp.loc_name_zoom_x
@location_name.zoom_y = $game_temp.loc_name_zoom_y
@layout.zoom_x = $game_temp.loc_layout_zoom_x
@layout.zoom_y = $game_temp.loc_layout_zoom_y
end
if $game_temp.loc_name_x > 0 and
$game_temp.loc_time > 0
$game_temp.loc_name_x -= 3
$game_temp.loc_layout_x += 3
$game_temp.loc_layout_opa += 7
$game_temp.loc_name_opa += 7
$game_temp.loc_name_zoom_x -= 0.01
$game_temp.loc_name_zoom_y -= 0.01
elsif $game_temp.loc_name_x <= 0 and
$game_temp.loc_time > 0
$game_temp.loc_name_x = 0
$game_temp.loc_layout_x = 0
$game_temp.loc_layout_opa = 255
$game_temp.loc_name_opa = 255
$game_temp.loc_name_zoom_x = 1
$game_temp.loc_name_zoom_y = 1
$game_temp.loc_layout_zoom_x = 1
$game_temp.loc_layout_zoom_y = 1
$game_temp.loc_name_zoom_x = 1
$game_temp.loc_name_zoom_y = 1
end
if $game_temp.loc_time <= 0 and
$game_temp.loc_layout_opa > 0
$game_temp.loc_layout_opa -= 10
$game_temp.loc_name_opa -= 10
if LOCATION_ZOOM_EFFECT == true
$game_temp.loc_layout_x -= 9
$game_temp.loc_layout_zoom_x -= 0.02
else
$game_temp.loc_layout_x += 3
end
$game_temp.loc_name_x -= 3
end
end
end
#==============================================================================
# Scene_Map
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# Main
#--------------------------------------------------------------------------
alias location_name_main main
def main
@map_name = Sprite_Location.new
location_name_main
@map_name.dispose
@map_name = nil
end
#--------------------------------------------------------------------------
# Update
#--------------------------------------------------------------------------
alias location_update update
def update
location_update
if @map_name != nil
@map_name.update
end
end
#--------------------------------------------------------------------------
# Transfer Player
#--------------------------------------------------------------------------
alias location_name_transfer_player transfer_player
def transfer_player
location_name_transfer_player
if @map_name != nil
@map_name.refresh
end
end
end
$mog_rgss_location_name = true