Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Mini Map, Map Name on Entry & character change, ALL THIS IN 1!!!
PMussulo
post Oct 18 2006, 06:32 AM
Post #1


SAKUJO MOTHERF***ERS!
Group Icon

Group: Revolutionary
Posts: 164
Type: Event Designer
RM Skill: Advanced




credits go to Squall ,XRXS (and me laugh.gif )


MAP NAME DISPLAY:

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

module XRXS20
EXCLUSIVE_MAPS = 020,[]#Mapas especificos( colocar o ID)
WINDOW_FRAME = true
WINDOW_SKIN = ""
WINDOW_WIDTH_FIX = 400
WINDOW_HEIGHT = 90
FONT_NAME = "Times New Roman"
FONT_COLOR = Color.new(255, 255, 255, 255)
FONT_SIZE = 40
POSITION = -999
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("001-Blue01")
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


MINI MAP:

CODE
#################################################################
##################### Autor Squall ##############################
#################################################################
# Para que a posição dos seus NPCs, inimigos ou teleportes apareça
# no mapa você deve adicionar comentários neste eventos,
# Entre no comando de eventos e selecione o comando comentário.
# Digite event para eventos
# Digite enemy para inimigos
# Digite teleport para teletransportes
#################################################################

class Game_Event < Game_Character
#--------------------------------------------------------------------------
# ● name
#--------------------------------------------------------------------------
def name
return @event.name
end
end

#==============================================================================
# ■ Map_Base
#------------------------------------------------------------------------------
#  Base class for mini maps
#
# made by squall // squall@loeher.zzn.com
#==============================================================================

class Map_Base
MP_VERSION = 5
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize(corner, use_windowskin)
@tileset_name = $game_map.tileset_name
@bg = Window_Base.new(0, 0, 144, 112)
@bg.z = 9000
if no_display?
@bg.windowskin = nil
else
unless use_windowskin
@bg.dispose
@bg = Window_Base.new(0, 0, 160, 128)
@bg.contents = Bitmap.new(128, 96)
@bg.windowskin = nil
bmp = RPG::Cache.picture("mapback")
@bg.contents.blt(0, 0, bmp, Rect.new(0, 0, 128, 96))
@bg.z = 9015
end
end
@map = Sprite.new
@map.bitmap = Bitmap.new(map_width, map_height)
@map.z = 9005
@event = Sprite.new
@event.bitmap = Bitmap.new(map_width, map_height)
@event.z = 9010
self.back_opacity = 180
self.opacity = 180
case corner
when 1
self.x = 16
self.y = 16
when 2
self.x = 640 - width - 16
self.y = 16
when 3
self.x = 16
self.y = 480 - height - 16
when 4
self.x = 640 - width - 16
self.y = 480 - height - 16
else
self.x = 16
self.y = 16
end
end
#--------------------------------------------------------------------------
# ● display_map?
#--------------------------------------------------------------------------
def no_map_display?
for event in $game_map.events.values
if event.name.include?("[no map]")
return true
end
end
return false
end
#--------------------------------------------------------------------------
# ● display_map?
#--------------------------------------------------------------------------
def no_event_display?
for event in $game_map.events.values
if event.name.include?("[no event]")
return true
end
end
return false
end
#--------------------------------------------------------------------------
# ● display_map?
#--------------------------------------------------------------------------
def no_display?
for event in $game_map.events.values
if event.name.include?("[no map]") and event.name.include?("[no event]")
return true
end
end
return false
end
#--------------------------------------------------------------------------
# ● dispose
#--------------------------------------------------------------------------
def dispose
@bg.dispose
@map.bitmap.dispose
@map.dispose
@event.bitmap.dispose
@event.dispose
end
#--------------------------------------------------------------------------
# ● map
#--------------------------------------------------------------------------
def map
return @map
end
#--------------------------------------------------------------------------
# ● event
#--------------------------------------------------------------------------
def event
return @event
end
#--------------------------------------------------------------------------
# ● width
#--------------------------------------------------------------------------
def width
return 128
end
#--------------------------------------------------------------------------
# ● opacity=
#--------------------------------------------------------------------------
def height
return 96
end
#--------------------------------------------------------------------------
# ● opacity=
#--------------------------------------------------------------------------
def visible=(bool)
@bg.visible = bool
@event.visible = bool
@map.visible = bool
end
#--------------------------------------------------------------------------
# ● opacity
#--------------------------------------------------------------------------
def visible
return @bg.visible
end
#--------------------------------------------------------------------------
# ● opacity=
#--------------------------------------------------------------------------
def opacity=(opacity)
@event.opacity = opacity
@map.opacity = opacity
end
#--------------------------------------------------------------------------
# ● opacity
#--------------------------------------------------------------------------
def opacity
return @event.opacity
end
#--------------------------------------------------------------------------
# ● back_opacity=
#--------------------------------------------------------------------------
def back_opacity=(opacity)
@bg.opacity = opacity
@bg.contents_opacity = opacity if @bg.contents != nil
end
#--------------------------------------------------------------------------
# ● back_opacity
#--------------------------------------------------------------------------
def back_opacity
return @bg.opacity
end
#--------------------------------------------------------------------------
# ● x=
#--------------------------------------------------------------------------
def x=(x)
@bg.x = x - (@bg.width - 128) / 2
@event.x = x + 8
@map.x = x + 8
end
#--------------------------------------------------------------------------
# ● x
#--------------------------------------------------------------------------
def x
return @bg.x
end
#--------------------------------------------------------------------------
# ● y=
#--------------------------------------------------------------------------
def y=(y)
@bg.y = y - (@bg.height - 96) / 2
@event.y = y + 8
@map.y = y + 8
end
#--------------------------------------------------------------------------
# ● y
#--------------------------------------------------------------------------
def y
return @bg.y
end
#--------------------------------------------------------------------------
# ● map_width
#--------------------------------------------------------------------------
def map_width
return $game_map.width * 112/20
end
#--------------------------------------------------------------------------
# ● map_height
#--------------------------------------------------------------------------
def map_height
return $game_map.height * 80/15
end
#--------------------------------------------------------------------------
# ● display_x
#--------------------------------------------------------------------------
def display_x
return $game_map.display_x / 128 * 112/20
end
#--------------------------------------------------------------------------
# ● map_height
#--------------------------------------------------------------------------
def display_y
return $game_map.display_y / 128 * 80/15
end
end
#==============================================================================
# ■ Map_Mini
#------------------------------------------------------------------------------
#  Base class for mini maps
#
# made by squall // squall@loeher.zzn.com
#==============================================================================

class Map_Mini < Map_Base
#--------------------------------------------------------------------------
# ● initialize
#--------------------------------------------------------------------------
def initialize(corner, use_windowskin)
super(corner, use_windowskin)
unless no_map_display?
draw_map
end
end
#--------------------------------------------------------------------------
# ● update
#--------------------------------------------------------------------------
def update
map.src_rect.set(display_x, display_y, width - 16, height - 16)
if @tileset_name != $game_map.tileset_name
@tileset_name = $game_map.tileset_name
unless no_map_display?
map.bitmap.clear
draw_map
end
end
end
#--------------------------------------------------------------------------
# ● draw_map
#--------------------------------------------------------------------------
def draw_map
bitmap = Bitmap.new($game_map.width * 32, $game_map.height * 32)
for i in 0...($game_map.width * $game_map.height)
x = i % $game_map.width
y = i / $game_map.width
for level in 0...3
tile_id = $game_map.data[x, y, level]
if tile_id >= 384
tileset_bitmap = RPG::Cache.tile($game_map.tileset_name, tile_id, 0)
src_rect = Rect.new(0, 0, 32, 32)
bitmap.blt(x * 32, y * 32, tileset_bitmap, src_rect)
end
if tile_id >= 48 and tile_id < 384
id = tile_id / 48 - 1
tileset_bitmap = RPG::Cache.autotile($game_map.autotile_names[id])
src_rect = Rect.new(32, 64, 32, 32)
bitmap.blt(x * 32, y * 32, tileset_bitmap, src_rect)
end
end
end
d_rect = Rect.new(0, 0, map_width, map_height)
s_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
map.bitmap.stretch_blt(d_rect, bitmap, s_rect)
bitmap.clear
bitmap.dispose
end
end
#==============================================================================
# ■ Map_Event
#------------------------------------------------------------------------------
#  draw the events and hero position
#==============================================================================

class Map_Event < Map_Mini
#--------------------------------------------------------------------------
# ● initialize
#--------------------------------------------------------------------------
def initialize(corner = 4, windowskin = true)
super(corner, windowskin)
@dots = []
end
#--------------------------------------------------------------------------
# ● refresh_dots
#--------------------------------------------------------------------------
def refresh_event_dots
for event in $game_map.events.values
bitmap = nil
x = event.x * map_width / $game_map.width
y = event.y * map_height / $game_map.height
next if event.list == nil
for i in 0...event.list.size
if event.list[i].parameters[0].is_a?(String)
if event.list[i].parameters[0] == "event"
bitmap = RPG::Cache.picture(event.list[i].parameters[0])
break
elsif event.list[i].parameters[0] == "enemy"
bitmap = RPG::Cache.picture(event.list[i].parameters[0])
break
elsif event.list[i].parameters[0].include?("teleport")
bitmap = RPG::Cache.picture("teleport")
break
elsif event.list[i].parameters[0] == "chest"
bitmap = RPG::Cache.picture(event.list[i].parameters[0])
break
elsif event.list[i].parameters[0] == "npc"
bitmap = RPG::Cache.picture(event.list[i].parameters[0])
break
elsif event.list[i].parameters[0] == "savepoint"
bitmap = RPG::Cache.picture(event.list[i].parameters[0])
break
else
bitmap = nil
end
end
end
@dots.push([x, y, bitmap])
end
end
#--------------------------------------------------------------------------
# ● refresh_dots
#--------------------------------------------------------------------------
def refresh_player_dot
x = $game_player.x * map_width / $game_map.width
y = $game_player.y * map_height / $game_map.height
bitmap = RPG::Cache.picture("hero")
@dots.push([x, y, bitmap])
end
#--------------------------------------------------------------------------
# ● update
#--------------------------------------------------------------------------
def update
super
@dots.clear
event.bitmap.clear
refresh_event_dots unless no_event_display?
refresh_player_dot unless no_display?
for dot in @dots
unless dot[2] == nil
event.bitmap.blt(dot[0], dot[1], dot[2], Rect.new(0, 0, 4, 4))
end
end
event.src_rect.set(display_x, display_y, width - 16, height - 16)
end
end
#==============================================================================
# ■ Map_Full
#------------------------------------------------------------------------------
# made by squall // squall@loeher.zzn.com
#==============================================================================

class Map_Full
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize
@dots = []
@teleport_sprites = []
if $game_map.width > $game_map.height
@map_width = 640
@map_height = $game_map.height * @map_width / $game_map.width
if @map_height > 480
@map_height = 480
end
else
@map_height = 480
@map_width = $game_map.width * @map_height / $game_map.height
if @map_width > 640
@map_width = 640
end
end
@map = Sprite.new
@event = Sprite.new
@map.bitmap = Bitmap.new(width, height)
@event.bitmap = Bitmap.new(width, height)
@map.x = @event.x = 320 - width / 2
@map.y = @event.y = 240 - height / 2
draw_map unless no_map_display?
draw_event_dots unless no_event_display?
draw_player_dot unless no_display?
if no_display?
@message = Window_Base.new(0, 208, 640, 64)
message = "the map is not available"
@message.contents = Bitmap.new(608, 32)
@message.contents.font.name = $fontface
@message.contents.font.size = 32
@message.contents.font.color.set(255, 255, 255, 100)
@message.contents.draw_text(-1, -1, 608, 32, message, 1)
@message.contents.draw_text(-1, 1, 608, 32, message, 1)
@message.contents.draw_text(1, -1, 608, 32, message, 1)
@message.contents.draw_text(1, 1, 608, 32, message, 1)
@message.contents.font.color.set(255, 255, 255, 50)
@message.contents.draw_text(-2, -2, 608, 32, message, 1)
@message.contents.draw_text(-2, 2, 608, 32, message, 1)
@message.contents.draw_text(2, -2, 608, 32, message, 1)
@message.contents.draw_text(2, 2, 608, 32, message, 1)
@message.contents.font.color.set(255, 255, 255)
@message.contents.draw_text(0, 0, 608, 32, message, 1)
@message.windowskin = nil
end
end
#--------------------------------------------------------------------------
# ● display_map?
#--------------------------------------------------------------------------
def no_map_display?
for event in $game_map.events.values
if event.name.include?("[full]")
return false
end
if event.name.include?("[no map]")
return true
end
end
return false
end
#--------------------------------------------------------------------------
# ● display_map?
#--------------------------------------------------------------------------
def no_event_display?
for event in $game_map.events.values
if event.name.include?("[full]")
return false
end
if event.name.include?("[no event]")
return true
end
end
return false
end
#--------------------------------------------------------------------------
# ● display_map?
#--------------------------------------------------------------------------
def no_display?
for event in $game_map.events.values
if event.name.include?("[full]")
return false
end
if event.name.include?("[no map]") and event.name.include?("[no event]")
return true
end
end
return false
end
#--------------------------------------------------------------------------
# ● dispose
#--------------------------------------------------------------------------
def dispose
for sprite in @teleport_sprites
sprite.dispose
end
@message.dispose if no_display?
@map.bitmap.dispose
@map.dispose
@event.bitmap.dispose
@event.dispose
end
#--------------------------------------------------------------------------
# ● width
#--------------------------------------------------------------------------
def width
return @map_width
end
#--------------------------------------------------------------------------
# ● opacity=
#--------------------------------------------------------------------------
def height
return @map_height
end
#--------------------------------------------------------------------------
# ● draw_map
#--------------------------------------------------------------------------
def draw_map
bitmap = Bitmap.new($game_map.width * 32, $game_map.height * 32)
for i in 0...($game_map.width * $game_map.height)
x = i % $game_map.width
y = i / $game_map.width
for level in 0...3
tile_id = $game_map.data[x, y, level]
if tile_id >= 384
tileset_bitmap = RPG::Cache.tile($game_map.tileset_name, tile_id, 0)
src_rect = Rect.new(0, 0, 32, 32)
bitmap.blt(x * 32, y * 32, tileset_bitmap, src_rect)
end
if tile_id >= 48 and tile_id < 384
id = tile_id / 48 - 1
tileset_bitmap = RPG::Cache.autotile($game_map.autotile_names[id])
src_rect = Rect.new(32, 64, 32, 32)
bitmap.blt(x * 32, y * 32, tileset_bitmap, src_rect)
end
end
end
d_rect = Rect.new(0, 0, width, height)
s_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
@map.bitmap.stretch_blt(d_rect, bitmap, s_rect)
bitmap.clear
bitmap.dispose
end
#--------------------------------------------------------------------------
# ● refresh_dots
#--------------------------------------------------------------------------
def draw_event_dots
for event in $game_map.events.values
bitmap = nil
x = event.x * width / $game_map.width
y = event.y * height / $game_map.height
next if event.list == nil
for i in 0...event.list.size
if event.list[i].parameters[0].is_a?(String)
if event.list[i].parameters[0] == "event"
bitmap = RPG::Cache.picture(event.list[i].parameters[0])
break
elsif event.list[i].parameters[0] == "enemy"
bitmap = RPG::Cache.picture(event.list[i].parameters[0])
break
elsif event.list[i].parameters[0].include?("teleport")
bitmap = RPG::Cache.picture("teleport")
name = event.list[i].parameters[0].dup
name.slice!("teleport, ")
@teleport_sprites.push(new_name_sprite(name, x, y))
break
elsif event.list[i].parameters[0] == "chest"
bitmap = RPG::Cache.picture(event.list[i].parameters[0])
break
elsif event.list[i].parameters[0] == "npc"
bitmap = RPG::Cache.picture(event.list[i].parameters[0])
break
elsif event.list[i].parameters[0] == "savepoint"
bitmap = RPG::Cache.picture(event.list[i].parameters[0])
break
else
bitmap = nil
end
end
end
@dots.push([x, y, bitmap])
end
for dot in @dots
unless dot[2] == nil
@event.bitmap.blt(dot[0], dot[1], dot[2], Rect.new(0, 0, 4, 4))
end
end
end
#--------------------------------------------------------------------------
# ● new_name_sprite
#--------------------------------------------------------------------------
def new_name_sprite(name, x, y)
sprite = Sprite.new
sprite.y = y + 240 - height / 2
x + 128 > 640 ? sprite.x = 512 : sprite.x = x + 320 - width / 2
bitmap = Bitmap.new(128, 32)
bitmap.font.name, bitmap.font.size = $fontface, 20
bitmap.font.color.set(255, 255, 255)
bitmap.draw_text(0, 0, 128, 32, name)
sprite.bitmap = bitmap
return sprite
end
#--------------------------------------------------------------------------
# ● refresh_dots
#--------------------------------------------------------------------------
def draw_player_dot
x = $game_player.x * width / $game_map.width
y = $game_player.y * height / $game_map.height
bitmap = RPG::Cache.picture("hero")
@event.bitmap.blt(x, y, bitmap, Rect.new(0, 0, 4, 4))
end
end

#==============================================================================
# ■ Scene_MiniMap
#------------------------------------------------------------------------------
#  draw the map full screen
#==============================================================================

class Scene_MiniMap
#--------------------------------------------------------------------------
# ● main
#--------------------------------------------------------------------------
def main
@map = Map_Full.new
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@map.dispose
end
#--------------------------------------------------------------------------
# ● Update the contents of all five windows on the main menu
#--------------------------------------------------------------------------
def update
if Input.trigger?(Input::B) | Input.trigger?(Input::ALT)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
end
end

#==============================================================================
# ■ Scene_Map
#------------------------------------------------------------------------------
#  draw the mini map
# @corner is the corner you want the mini map to be displayed in.
# 1 is upper left, 2 is upper right, 3 is bottom left and 4 is bottom right
#
# @use_windowskin is whether true or false. true if you want to use the
# the current windowskin for the minimap background.
# or false if you want to use the picture named mapback in your picture folder.
#==============================================================================

class Scene_Map
alias main_minimap main
alias update_minimap update
alias transfer_minimap transfer_player
#--------------------------------------------------------------------------
# ● initialize
#--------------------------------------------------------------------------
def initialize
@corner = 4 # 1 or 2 or 3 or 4
@use_windowskin = false # true or false
end
#--------------------------------------------------------------------------
# ● main
#--------------------------------------------------------------------------
def main
@event_map = Map_Event.new(@corner, @use_windowskin)
main_minimap
@event_map.dispose
end
#--------------------------------------------------------------------------
# ● update
#--------------------------------------------------------------------------
def update
@event_map.update
if $game_system.map_interpreter.running?
@event_map.visible = false
else
@event_map.visible = true
end
if Input.trigger?(Input::ALT)
$game_system.se_play($data_system.decision_se)
$scene = Scene_MiniMap.new
return
end
update_minimap
end
#--------------------------------------------------------------------------
# ● transfer_player
#--------------------------------------------------------------------------
def transfer_player
transfer_minimap
@event_map.dispose
@event_map = Map_Event.new(@corner, @use_windowskin)
end
end


CHANGE CHARACTER BY PRESSING W AND Q:

CODE
#################################################################
######################### XRXS ##################################
#################################################################
#O script permite que você possa mudar o char que está no mapa
#apenas apertanto a tecla Q ou W.
#Para entender as cofigurações de botões aperte a tecla F1
#quando estiver jogando.
#################################################################

class Scene_Map
#Definina aqui quais os botões irão mudar o char no mapa.

def lr_variable_id
return 10
end
end
class Game_Player
def controlable?
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
return true
end
return false
end
end
class Scene_Map
alias xrxs41ax_update update
def update
xrxs41ax_update
if $scene.is_a?(Scene_Map) and $game_party.actors.size > 0 and $game_player.controlable?
if Input.trigger?(Input::L) or Input.trigger?(Input::R)
index = 0
for actor in $game_party.actors
if $game_variables[lr_variable_id()] == actor.id
index = $game_party.actors.index(actor)
end
end
if Input.trigger?(Input::L)
index = (index + $game_party.actors.size - 1) % $game_party.actors.size
elsif Input.trigger?(Input::R)
index = (index + 1) % $game_party.actors.size
end
$game_variables[lr_variable_id()] = $game_party.actors[index].id
$game_player.refresh
end
end
end
end
module XRXS41
MAPCHAR_VARIABLE_ID = 10
end
class Game_Player < Game_Character
alias xrxs41_refresh refresh
def refresh
xrxs41_refresh
id = $game_variables[XRXS41::MAPCHAR_VARIABLE_ID]
if id != 0
actor = $data_actors[id]
@character_name = actor.character_name
@character_hue = actor.character_hue
end
end
end
class Interpreter
alias xrxs41_command_122 command_122
def command_122
xrxs41_command_122
if @parameters[0] == XRXS41::MAPCHAR_VARIABLE_ID
$game_player.refresh
end
end
end


WARNING: Smiley ATTACK!!! don't know if it works like that, but in any case, change the smileys for it's correspondent letter.

MAP NAME: It shows that map name. to change it, change your map name (duh). *hummm.... it feels so good to edit.....* wink.gif
MINI MAP: to show events in map, inert comment: event.
to show exits in map, insert comment: teleport
to show enemies in map, insert comment: enemy
(you have to insert comment in every page of the event.... simple, huh?

Change Character: just press Q and W to change character (while standing - not moving)

This post has been edited by RockmanNeo: Jan 20 2007, 08:34 AM


__________________________
Go to the top of the page
 
+Quote Post
   
seilake
post Jan 18 2007, 05:08 PM
Post #2



Group Icon

Group: Member
Posts: 1
Type: Event Designer
RM Skill: Skilled




hmmm...dont u know how to put a script? u did a lot of wrong things in there dude!
Go to the top of the page
 
+Quote Post
   
Blazehouse
post Jan 18 2007, 07:03 PM
Post #3


First Care-bear that doesn't try to kill their owner. Yea ri
Group Icon

Group: Member
Posts: 147
Type: Event Designer
RM Skill: Skilled




there are smiliey faces in your script....


__________________________


Behold my mighty stick killing avatars. feel free to take them.(I Did)
Go to the top of the page
 
+Quote Post
   
Guest_Black Shadow_*
post Jan 19 2007, 12:43 AM
Post #4





Guests





Post the script correctly, and take away the smiles.
Go to the top of the page
 
+Quote Post
   
Ember
post Jan 19 2007, 01:36 AM
Post #5


Level 68
Group Icon

Group: Revolutionary
Posts: 2,799
Type: Artist
RM Skill: Advanced




Wrap the script in [code][/code] things, then we'll talk. wink.gif


__________________________
Go to the top of the page
 
+Quote Post
   
Rockman
post Jan 20 2007, 08:34 AM
Post #6


welcome to the rad sunglasses zone. you will never escape
Group Icon

Group: Revolutionary
Posts: 1,240
Type: Musician
RM Skill: Advanced




Fixed. Post any code in [code][/code] tags next time.
Go to the top of the page
 
+Quote Post
   
Holder
post Jan 20 2007, 03:40 PM
Post #7


Spoilers.
Group Icon

Group: Revolutionary
Posts: 4,204
Type: Developer
RM Skill: Advanced
Rev Points: 250




The character change one is a really nice touch.
I like it, are the credits the same for this one as the first?

It's funny how the simple sounding scripts are the most effective thumbsup.gif
Great work.


__________________________

 I'm running the Great North Run in September in aid of NACC. A condition my wife has in it's severe form.
Please sponsor me with whatever you can, thank you.
If you'd like to help spread the word please share the image and link to my fundraising page.

Go to the top of the page
 
+Quote Post
   
myownfriend
post Jan 21 2007, 12:10 AM
Post #8


"Forever Love"
Group Icon

Group: Revolutionary
Posts: 375
Type: Event Designer
RM Skill: Undisclosed




I've been looking for a character changer forever!!!!

Well, now its a feature in Lambent of Life.


__________________________


If you need to contact me, contact me there. ^
Go to the top of the page
 
+Quote Post
   
PMussulo
post Jan 21 2007, 02:09 AM
Post #9


SAKUJO MOTHERF***ERS!
Group Icon

Group: Revolutionary
Posts: 164
Type: Event Designer
RM Skill: Advanced




ermm.gif

sorry, I never posted a scripot before sweat.gif

thanks for fixing it RockmanNeo, and credits just go to Squall and XRXS


__________________________
Go to the top of the page
 
+Quote Post
   
myownfriend
post Feb 20 2007, 12:23 PM
Post #10


"Forever Love"
Group Icon

Group: Revolutionary
Posts: 375
Type: Event Designer
RM Skill: Undisclosed




I'm confused as to how you change the position of the window in the Map name script.


__________________________


If you need to contact me, contact me there. ^
Go to the top of the page
 
+Quote Post
   
PMussulo
post Feb 25 2007, 09:22 AM
Post #11


SAKUJO MOTHERF***ERS!
Group Icon

Group: Revolutionary
Posts: 164
Type: Event Designer
RM Skill: Advanced




change these values to suit your ideas:

WINDOW_WIDTH_FIX = x
WINDOW_HEIGHT = x
POSITION = x

just keep experimenting until you find the position that suits you thumbsup.gif


__________________________
Go to the top of the page
 
+Quote Post
   
jedicommando
post Jun 17 2007, 01:20 PM
Post #12


Level 1
Group Icon

Group: Member
Posts: 6
Type: Developer
RM Skill: Skilled




I am getting the error 'Graphics/pictures/mapback'

how do I fix this?

EDIT: It is for the Show map name.

This post has been edited by jedicommando: Jun 18 2007, 08:24 AM


__________________________
I am a ok writer, and an awesome mapper! If you need a mapper, PM me!
Go to the top of the page
 
+Quote Post
   
Ty
post Jun 19 2007, 10:34 PM
Post #13


Level 38
Group Icon

Group: +Gold Member
Posts: 1,007
Type: Scripter
RM Skill: Undisclosed




I believe that error is caused by lacking the pictures which are needed. I posted Squalls Mini-map before and it needs pictures to function which are not posted here. Could be wrong though sad.gif


__________________________
My Script Demo link broken? Looking for old scripts? Go here:
http://synthesize.4shared.com
Go to the top of the page
 
+Quote Post
   
jedicommando
post Jun 21 2007, 11:27 AM
Post #14


Level 1
Group Icon

Group: Member
Posts: 6
Type: Developer
RM Skill: Skilled




thanks. Now to find (or make) some.


__________________________
I am a ok writer, and an awesome mapper! If you need a mapper, PM me!
Go to the top of the page
 
+Quote Post
   
PMussulo
post Jun 27 2007, 04:56 AM
Post #15


SAKUJO MOTHERF***ERS!
Group Icon

Group: Revolutionary
Posts: 164
Type: Event Designer
RM Skill: Advanced




sad.gif

sorry, sorry...

here are the missing pics:








Paste it all into the picture folder, and it's done.


__________________________
Go to the top of the page
 
+Quote Post
   
davedani
post Jul 2 2007, 02:49 PM
Post #16


Level 2
Group Icon

Group: Member
Posts: 28
Type: Musician
RM Skill: Skilled




I'm getting am error thats saying Graphics/pictures/hero. How do I fix this ?

Sorry. I figured it out biggrin.gif This is amazing. Thanks.

This post has been edited by davedani: Jul 2 2007, 02:55 PM
Go to the top of the page
 
+Quote Post
   
dummy1234
post Oct 6 2008, 08:54 AM
Post #17


Level 8
Group Icon

Group: Revolutionary
Posts: 128
Type: Developer
RM Skill: Skilled




Really nice minimap script! It's the only one I managed to get to work =)
I have a small problem with it though =/
I have a map that's 200x150 size, and when I "teleport" to it, it causes game lag (pretty noticeable)...am I doing something wrong or is that normal? Anyways to fix it? Thanks in advance.
P.S. works just fine on 20x15 and 40x30 maps for sure =D


__________________________
Given the choice - whether to rule a corrupt and failing empire, or to challenge the Fates for another throw, a better throw against one's destiny - what was a king to do?
Go to the top of the page
 
+Quote Post
   
Aniston
post Oct 6 2008, 03:38 PM
Post #18


Level 5
Group Icon

Group: Member
Posts: 68
Type: None
RM Skill: Beginner




Finally, a mini-map script that I can actually get to work.

But I was wondering, is it possible to turn the mini-map script on and off in-game?


__________________________
Go to the top of the page
 
+Quote Post
   
Lycosa
post Oct 13 2008, 12:03 PM
Post #19



Group Icon

Group: Member
Posts: 2
Type: Event Designer
RM Skill: Advanced




The mini map script is simply amazing. Never seen such a thing before. And it's the first script I use you can just paste into the script editor and it works.

I wanted to post the same question as Aniston happy.gif .

EDIT:
Probably something with that
CODE
def no_map_display?
for event in $game_map.events.values
if event.name.include?("[no map]")
return true
end
end
return false
end
, but I don't know how to use it. An event named "[no map]" doesn't work...

This post has been edited by Lycosa: Oct 13 2008, 12:13 PM
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th June 2013 - 11:55 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker