Sign in to follow this  
Followers 0
evil_goku

nombre del mapa

14 posts in this topic

esto es para cuando cambies de mapa te diga el nombre en donde estas.


aqui va encima de main y llamenla como quieran :

[spoiler]
CODE

#################################################################
##################### ▼▲▼ XRXS2 ▼▲▼ #############################
#################################################################
#No momento em que o mapa for acessado uma janela monstrara o
#seu ID(Nome)
################################################################

module XRXS20
 EXCLUSIVE_MAPS = []#Mapas especificos( colocar o ID)
 WINDOW_FRAME     = true  
 WINDOW_SKIN      = ""    
 WINDOW_WIDTH_FIX =  120  
 WINDOW_HEIGHT    =  24  
 FONT_NAME  = "Arial"
 FONT_COLOR = Color.new(255, 255, 0, 255)
 FONT_SIZE  = 18
 POSITION = 4
 TIME_FADEIN  = 16
 TIME_STOP    = 64
 TIME_FADEOUT = 24
end
class Window_Map_Name < Window_Base
 def text_model(text)
   return "~" + text + "~"
 end
end
#==============================================================================
# □ XRXS. マップ名取得機構
#==============================================================================
class Game_Map
 #--------------------------------------------------------------------------
 # ○ マップ名を取得
 #--------------------------------------------------------------------------
 def name
   $data_mapinfos = load_data("Data/MapInfos.rxdata") if $data_mapinfos.nil?
   $data_mapinfos[@map_id].name
 end
end

#==============================================================================
# ■ Game_Temp
#==============================================================================
class Game_Temp
 #--------------------------------------------------------------------------
 # ● 公開インスタンス変数
 #--------------------------------------------------------------------------
 attr_accessor :xrxs20_fade_duration
end
#==============================================================================
# ■ Game_Map
#==============================================================================
class Game_Map
 #--------------------------------------------------------------------------
 # ● 公開インスタンス変数
 #--------------------------------------------------------------------------
 attr_reader   :map_id
end
#==============================================================================
# □ Window_Map_Name_Space
#==============================================================================
class Window_Map_Name_Space < Window_Base
 #--------------------------------------------------------------------------
 # ○ オブジェクト初期化
 #--------------------------------------------------------------------------
 def initialize(x, y, w, h)
   super(x-16, y-16, w+32, h+32)
   self.opacity = 0
   self.visible = false
       @align = 1
 end
 #--------------------------------------------------------------------------
 # ○ 文字を設定
 #--------------------------------------------------------------------------
 def set_text(text)
   # 描画幅を計算
   if XRXS20::WINDOW_WIDTH_FIX == 0
     bitmap = Bitmap.new(1,1)
     bitmap.font.name  = XRXS20::FONT_NAME
     bitmap.font.size  = XRXS20::FONT_SIZE
     width = bitmap.text_size(text).width + 10
     bitmap.dispose
   else
     width = XRXS20::WINDOW_WIDTH_FIX
   end
   # コンテンツ領域を作成
   if self.contents != nil
     self.contents.dispose
   end
   self.width = width + 32
   self.contents = Bitmap.new(width, self.height - 32)
   self.contents.font.name  = XRXS20::FONT_NAME
   self.contents.font.color = XRXS20::FONT_COLOR
   self.contents.font.size  = XRXS20::FONT_SIZE
   self.contents.font.bold  = true
   if text.nil?
     return
   end
   # 文字の描画
   x = 12
   y = 0
   width -= 6
   height = self.contents.height
   text_color = self.contents.font.color.dup
   self.contents.font.color = Color.new(  0,  0,  0, 192)
   self.contents.draw_text(x+2, y+2, width, height, text, @align)
   self.contents.font.color = Color.new( 64, 64, 64, 192)
   self.contents.draw_text(x-1, y-1, width, height, text, @align)
   self.contents.draw_text(x+1, y-1, width, height, text, @align)
   self.contents.draw_text(x-1, y+1, width, height, text, @align)
   self.contents.draw_text(x+1, y+1, width, height, text, @align)
   self.contents.font.color = text_color
   self.contents.draw_text(x,   y,   width, height, text, @align)
 end
end
#==============================================================================
# □ Window_Map_Name
#------------------------------------------------------------------------------
#  マップ名を表示するウィンドウです。
#==============================================================================
class Window_Map_Name < Window_Base
 #--------------------------------------------------------------------------
 # ○ 公開インスタンス変数
 #--------------------------------------------------------------------------
 attr_accessor :text
 #--------------------------------------------------------------------------
 # ○ オブジェクト初期
 #--------------------------------------------------------------------------
 def initialize
   y = XRXS20::POSITION >= 2 ? 440 : 8
   w = 64
   h = XRXS20::WINDOW_HEIGHT
   super(-w, y, w, h)
   self.opacity = 0
   self.visible = false
   self.windowskin = RPG::Cache.windowskin("sys01")
   if XRXS20::WINDOW_SKIN != ""
     # スキンの検索
     skin = (RPG::Cache.windowskin(XRXS20::WINDOW_SKIN) rescue nil)
     # スキンの設定 (スキンが見つかった場合)
     self.windowskin = skin unless skin.nil?
   end
   @space = Window_Map_Name_Space.new(self.x, self.y, self.width, self.height)
 end
 #--------------------------------------------------------------------------
 # ○ テキスト設定
 #     text  : ウィンドウに表示する文字列
 #--------------------------------------------------------------------------
 def set_text(text)
   if text.nil? or text.empty? or text =~ /^\./
     @showing_time = -1
     @text = ""
     @space.set_text(@text)
     $game_temp.xrxs20_fade_duration = -1
   else
     # 設定
     @text = text_model(text)
     # 描写
     @space.set_text(@text)
     if XRXS20::WINDOW_WIDTH_FIX == 0
       self.width = @space.width - 16
     else
       self.width = XRXS20::WINDOW_WIDTH_FIX
     end
     case XRXS20::POSITION % 2
     when 0
       @x_indent = 4
     when 1
       @x_indent = 632 - self.width
     end
   end
   self.visible   = false
   @space.visible = false
   # 位置の更新
   fade_relocation
 end
 #--------------------------------------------------------------------------
 # ○ フェード時間による位置の更新
 #--------------------------------------------------------------------------
 def fade_relocation
   # フェード時間の設定
   if $game_temp.xrxs20_fade_duration.nil?
     $game_temp.xrxs20_fade_duration = (XRXS20::TIME_FADEIN + XRXS20::TIME_STOP + XRXS20::TIME_FADEOUT)
   end
   #
   # フェードイン
   #
   d = $game_temp.xrxs20_fade_duration - (XRXS20::TIME_STOP + XRXS20::TIME_FADEOUT)
   if d > 0
     self.visible   = XRXS20::WINDOW_FRAME
     @space.visible = true
     amount = ((XRXS20::TIME_FADEIN - d) * 255.0 / XRXS20::TIME_FADEIN).ceil
     @space.contents_opacity =  amount
     self.opacity            = [amount*5/8, 160].min
     self.x = @x_indent - d
     @space.x = self.x - 16
     $game_temp.xrxs20_fade_duration -= 1
   #
   # 通常表示
   #
   elsif ($game_temp.xrxs20_fade_duration > XRXS20::TIME_FADEOUT) or
         ($game_temp.xrxs20_fade_duration == 0 and XRXS20::TIME_FADEOUT == 0)
     self.visible   = XRXS20::WINDOW_FRAME
     @space.visible = true
     @space.contents_opacity = 255
     self.opacity            = 160
     self.x = @x_indent
     @space.x = self.x - 16
     if $game_temp.xrxs20_fade_duration > 0
       $game_temp.xrxs20_fade_duration -= 1
     end
   #
   # フェードアウト
   #
   elsif $game_temp.xrxs20_fade_duration > 0
     self.visible   = XRXS20::WINDOW_FRAME
     @space.visible = true
     amount = ($game_temp.xrxs20_fade_duration * 255.0 / XRXS20::TIME_FADEOUT).ceil
     @space.contents_opacity = amount
     self.opacity            = amount * 5/8
     self.x = (@x_indent + XRXS20::TIME_FADEOUT) - $game_temp.xrxs20_fade_duration
     @space.x = self.x - 16
     $game_temp.xrxs20_fade_duration -= 1
     if $game_temp.xrxs20_fade_duration == 0
       self.visible   = false
       @space.visible = false
     end
   end
 end
 #--------------------------------------------------------------------------
 # ○ フレーム更新 [オーバーライド]
 #--------------------------------------------------------------------------
 def update
   fade_relocation
   super
 end
 #--------------------------------------------------------------------------
 # ○ 解放 [オーバーライド]
 #--------------------------------------------------------------------------
 def dispose
   @space.dispose
   super
 end
 #--------------------------------------------------------------------------
 # ○ 可視状態 [オーバーライド]
 #--------------------------------------------------------------------------
 def visible=(B)
   @space.visible = b unless @space.nil?
   super
 end
end
#==============================================================================
# ■ Scene_Map
#==============================================================================
class Scene_Map
 #--------------------------------------------------------------------------
 # ● メイン処理
 #--------------------------------------------------------------------------
 alias xrxs20_main main
 def main
   # 地名ウィンドウを作成
   @map_name_window = Window_Map_Name.new
   # 地名ウィンドウの更新
   name = XRXS20::EXCLUSIVE_MAPS.include?($game_map.map_id) ? nil : $game_map.name
   @map_name_window.set_text(name)
   # 戻す
   xrxs20_main
   # 地名ウィンドウを解放
   @map_name_window.dispose
 end
 #--------------------------------------------------------------------------
 # ● フレーム更新
 #--------------------------------------------------------------------------
 alias xrxs20_update update
 def update
   # 地名ウィンドウの更新
   @map_name_window.update
   # 呼び戻す
   xrxs20_update
 end
 #--------------------------------------------------------------------------
 # ● プレイヤーの場所移動
 #--------------------------------------------------------------------------
 alias xrxs20_transfer_player transfer_player
 def transfer_player
   # 地名ウィンドウの不可視化
   @map_name_window.visible = false
   # 呼び戻す
   xrxs20_transfer_player
   # フェード時間のクリア
   $game_temp.xrxs20_fade_duration = nil
   # 地名ウィンドウの更新
   name = XRXS20::EXCLUSIVE_MAPS.include?($game_map.map_id) ? nil : $game_map.name
   @map_name_window.set_text(name)
 end
end
[/spoiler] Edited by xXDarkDragonXx
0

Share this post


Link to post
Share on other sites
con este scrip se jode el juego no se os abrira mas no lo probeis
0

Share this post


Link to post
Share on other sites
¿Como? blink.gif blink.gif
Veo que necesitas un Windowskin definido, pero no creo que haya más problema...
0

Share this post


Link to post
Share on other sites
Es que evil_goku postie sin poner [/CODE] y pos salia emoticon. Todo arreglado. icon13.gif
0

Share this post


Link to post
Share on other sites
a mi no me funciona
en el def:visible=b me da un error
cabreado.gif cabreado.gif

Ayudenme!!!
Edited by pepepalo
0

Share this post


Link to post
Share on other sites
a mi me da fallo aqui.

CODE
246 def visible=(B)
0

Share this post


Link to post
Share on other sites
Creo que esta es una solucion, a tu windowskin tienes que ponerle de nombre Sefia - B
y creo que con eso estara listo porque el script nesecita de ese nombre en el windowsskins para que funcione happy.gif

Espero haberles ayudado...
0

Share this post


Link to post
Share on other sites
Bueno yo soy un integrante de la antigua versión del foro... bueno no me gusta salir mucho pero quieros darles la respuesta del error... cambien la B mayuscula por b minuscula, luego ponganle el nombre a uno de sus skin este: Sefia - B, si no funciona usen este sys01, espero averles ayudado, un saludo.

Edito: si se pasan de los 13 caracteres no cabrá en el cuadro en el que sale. Edited by Faryon
0

Share this post


Link to post
Share on other sites
Eso ya lo habia dicho dry.gif pero bueno como se bien hecho happy.gif
0

Share this post


Link to post
Share on other sites
Sorry iori, lo puse por ti, pero ya lo probé resultó ser que tienes que ponerle de nombre sys01 y cambiar la B mayuscula por b minuscula (eso no lo dijiste xD) weno confirmado, el name de skin: sys01 Cambiar: B mayus x b minus
0

Share this post


Link to post
Share on other sites
a mi me resulto asi:

tienen que borrar "= (B)" y poner un windowsskin con el nombre sys01 auxilio.gif
0

Share this post


Link to post
Share on other sites
Ei no Como es borro Cual "=(B)"¿? -.-
- - - - - - - - -
Nah men itnente todo y dise Script desbordado o algo asi cheesy.gif
muerte.gif cabreado.gif
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0