Help witm KMS Mini map script

Hello, I found this minimap script by KMS that is really good
Spoiler: Script
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆ ミニマップ - KMS_MiniMap ◆ VX Ace ◆
#_/ ◇ Last update : 2012/02/12 (TOMY@Kamesoft) ◇
#_/----------------------------------------------------------------------------
#_/ ミニマップ表示機能を追加します。
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#==============================================================================
# ★ 設定項目 - BEGIN Setting ★
#==============================================================================

module KMS_MiniMap
# ◆ ミニマップ表示切替ボタン
# nil にするとボタン切り替え無効。
SWITCH_BUTTON = :Z

# ◆ ミニマップ表示位置・サイズ (X, Y, 幅, 高さ)
MAP_RECT = Rect.new(364, 20, 160, 120)
# ◆ ミニマップの Z 座標
# 大きくしすぎると色々なものに被ります。
MAP_Z = 0
# ◆ 1マスのサイズ
# 3 以上を推奨。
GRID_SIZE = 5

# ◆ ミニマップカラー
FOREGROUND_COLOR = Color.new(192, 192, 224, 160) # 前景色 (通行可)
BACKGROUND_COLOR = Color.new( 0, 0, 160, 160) # 背景色 (通行不可)
POSITION_COLOR = Color.new(255, 0, 0, 192) # 現在位置
MOVE_EVENT_COLOR = Color.new(255, 160, 0, 192) # マップ移動イベント
VEHICLE_COLOR = Color.new( 96, 128, 0, 192) # 乗り物

# ◆ オブジェクトの色
# 要素の先頭から順に OBJ1, OBJ2, ... に対応。
OBJECT_COLOR = [
Color.new( 0, 128, 0, 192), # OBJ 1
Color.new( 0, 160, 160, 192), # OBJ 2
Color.new(160, 0, 160, 192), # OBJ 3
] # ← この ] は消さないこと!

# ◆ アイコンの点滅の強さ
# 5 ~ 8 あたりを推奨。
BLINK_LEVEL = 7

# ◆ マップのキャッシュ数
# この数を超えると、長期間参照していないものから削除。
CACHE_NUM = 10
end

#==============================================================================
# ☆ 設定ここまで - END Setting ☆
#==============================================================================

$kms_imported = {} if $kms_imported == nil
$kms_imported["MiniMap"] = true

module KMS_MiniMap
# ミニマップ非表示
REGEX_NO_MINIMAP_NOTE = /<(?:ミニマップ|MINIMAP)\s*(?:非表示|HIDE)>/i
REGEX_NO_MINIMAP_NAME = /\[NOMAP\]/i

# 障害物
REGEX_WALL_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:壁|障害物|WALL)>/i

# 移動イベント
REGEX_MOVE_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:移動|MOVE)>/i

# オブジェクト
REGEX_OBJECT = /<(?:ミニマップ|MINIMAP)\s+OBJ(?:ECT)?\s*(\d+)>/i
end

# *****************************************************************************

#==============================================================================
# □ KMS_Commands
#==============================================================================

module KMS_Commands
module_function
#--------------------------------------------------------------------------
# ○ ミニマップを表示
#--------------------------------------------------------------------------
def show_minimap
$game_temp.minimap_manual_visible = true
$game_system.minimap_show = true
end
#--------------------------------------------------------------------------
# ○ ミニマップを隠す
#--------------------------------------------------------------------------
def hide_minimap
$game_system.minimap_show = false
end
#--------------------------------------------------------------------------
# ○ ミニマップ表示状態の取得
#--------------------------------------------------------------------------
def minimap_showing?
return $game_system.minimap_show
end
#--------------------------------------------------------------------------
# ○ ミニマップをリフレッシュ
#--------------------------------------------------------------------------
def refresh_minimap
return unless SceneManager.scene_is?(Scene_Map)

$game_map.refresh if $game_map.need_refresh
SceneManager.scene.refresh_minimap
end
#--------------------------------------------------------------------------
# ○ ミニマップのオブジェクトを更新
#--------------------------------------------------------------------------
def update_minimap_object
return unless SceneManager.scene_is?(Scene_Map)

$game_map.refresh if $game_map.need_refresh
SceneManager.scene.update_minimap_object
end
end

#==============================================================================
# ■ Game_Interpreter
#==============================================================================

class Game_Interpreter
# イベントコマンドから直接コマンドを叩けるようにする
include KMS_Commands
end

#==============================================================================
# ■ RPG::Map
#==============================================================================

class RPG::Map
#--------------------------------------------------------------------------
# ○ ミニマップのキャッシュ生成
#--------------------------------------------------------------------------
def create_minimap_cache
@__minimap_show = true

note.each_line { |line|
if line =~ KMS_MiniMap::REGEX_NO_MINIMAP_NOTE # マップ非表示
@__minimap_show = false
end
}
end
#--------------------------------------------------------------------------
# ○ ミニマップ表示
#--------------------------------------------------------------------------
def minimap_show?
create_minimap_cache if @__minimap_show.nil?
return @__minimap_show
end
end

#==============================================================================
# ■ RPG::MapInfo
#==============================================================================

class RPG::MapInfo
#--------------------------------------------------------------------------
# ● マップ名取得
#--------------------------------------------------------------------------
def name
return @name.gsub(/\[.*\]/) { "" }
end
#--------------------------------------------------------------------------
# ○ オリジナルマップ名取得
#--------------------------------------------------------------------------
def original_name
return @Name
end
#--------------------------------------------------------------------------
# ○ ミニマップのキャッシュ生成
#--------------------------------------------------------------------------
def create_minimap_cache
@__minimap_show = !(@Name =~ KMS_MiniMap::REGEX_NO_MINIMAP_NAME)
end
#--------------------------------------------------------------------------
# ○ ミニマップ表示
#--------------------------------------------------------------------------
def minimap_show?
create_minimap_cache if @__minimap_show == nil
return @__minimap_show
end
end

#==============================================================================
# ■ Game_Temp
#==============================================================================

class Game_Temp
#--------------------------------------------------------------------------
# ○ 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :minimap_manual_visible # ミニマップ手動表示切り替えフラグ
#--------------------------------------------------------------------------
# ○ オブジェクト初期化
#--------------------------------------------------------------------------
alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap

@minimap_manual_visible = true
end
end

#==============================================================================
# ■ Game_System
#==============================================================================

class Game_System
#--------------------------------------------------------------------------
# ○ 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :minimap_show # ミニマップ表示フラグ
#--------------------------------------------------------------------------
# ○ オブジェクト初期化
#--------------------------------------------------------------------------
alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap

@minimap_show = true
end
end

#==============================================================================
# ■ Game_Map
#==============================================================================

class Game_Map
#--------------------------------------------------------------------------
# ○ 定数
#--------------------------------------------------------------------------
MINIMAP_FADE_NONE = 0 # ミニマップ フェードなし
MINIMAP_FADE_IN = 1 # ミニマップ フェードイン
MINIMAP_FADE_OUT = 2 # ミニマップ フェードアウト
#--------------------------------------------------------------------------
# ○ 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :minimap_fade
#--------------------------------------------------------------------------
# ○ ミニマップを表示するか
#--------------------------------------------------------------------------
def minimap_show?
return $data_mapinfos[map_id].minimap_show? && @map.minimap_show?
end
#--------------------------------------------------------------------------
# ○ ミニマップをフェードイン
#--------------------------------------------------------------------------
def fadein_minimap
@minimap_fade = MINIMAP_FADE_IN
end
#--------------------------------------------------------------------------
# ○ ミニマップをフェードアウト
#--------------------------------------------------------------------------
def fadeout_minimap
@minimap_fade = MINIMAP_FADE_OUT
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
alias refresh_KMS_MiniMap refresh
def refresh
refresh_KMS_MiniMap

SceneManager.scene.refresh_minimap if SceneManager.scene_is?(Scene_Map)
end
end

#==============================================================================
# ■ Game_Event
#==============================================================================

class Game_Event < Game_Character
#--------------------------------------------------------------------------
# ○ ミニマップ用のキャッシュを作成
#--------------------------------------------------------------------------
def __create_minimap_cache
@__last_page = @Page
@__minimap_wall_event = false
@__minimap_move_event = false
@__minimap_object_type = -1

return if @page.nil?

@page.list.each { |cmd|
# 注釈以外に到達したら離脱
break unless [108, 408].include?(cmd.code)

# 正規表現判定
case cmd.parameters[0]
when KMS_MiniMap::REGEX_WALL_EVENT
@__minimap_wall_event = true
when KMS_MiniMap::REGEX_MOVE_EVENT
@__minimap_move_event = true
when KMS_MiniMap::REGEX_OBJECT
@__minimap_object_type = $1.to_i
end
}
end
private :__create_minimap_cache
#--------------------------------------------------------------------------
# ○ グラフィックがあるか
#--------------------------------------------------------------------------
def graphic_exist?
return (character_name != "" || tile_id > 0)
end
#--------------------------------------------------------------------------
# ○ 障害物か
#--------------------------------------------------------------------------
def is_minimap_wall_event?
if @__minimap_wall_event.nil? || @__last_page != @Page
__create_minimap_cache
end

return @__minimap_wall_event
end
#--------------------------------------------------------------------------
# ○ 移動イベントか
#--------------------------------------------------------------------------
def is_minimap_move_event?
if @__minimap_move_event.nil? || @__last_page != @Page
__create_minimap_cache
end

return @__minimap_move_event
end
#--------------------------------------------------------------------------
# ○ ミニマップオブジェクトか
#--------------------------------------------------------------------------
def is_minimap_object?
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end

return @__minimap_object_type > 0
end
#--------------------------------------------------------------------------
# ○ ミニマップオブジェクトタイプ
#--------------------------------------------------------------------------
def minimap_object_type
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end

return @__minimap_object_type
end
end

#==============================================================================
# □ Game_MiniMap
#------------------------------------------------------------------------------
# ミニマップを扱うクラスです。
#==============================================================================

class Game_MiniMap
#--------------------------------------------------------------------------
# ○ 構造体
#--------------------------------------------------------------------------
Point = Struct.new🙂x, :y)
Size = Struct.new🙂width, :height)
PassageCache = Struct.new🙂map_id, :table, :scan_table)
#--------------------------------------------------------------------------
# ○ クラス変数
#--------------------------------------------------------------------------
@@passage_cache = [] # 通行フラグテーブルキャッシュ
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(tilemap)
@map_rect = KMS_MiniMap::MAP_RECT
@grid_size = [KMS_MiniMap::GRID_SIZE, 1].max

@x = 0
@y = 0
@grid_num = Point.new(
(@map_rect.width + @grid_size - 1) / @grid_size,
(@map_rect.height + @grid_size - 1) / @grid_size
)
@draw_grid_num = Point.new(@grid_num.x + 2, @grid_num.y + 2)
@draw_range_begin = Point.new(0, 0)
@draw_range_end = Point.new(0, 0)
@tilemap = tilemap

@last_x = $game_player.x
@last_y = $game_player.y

@showing = false
@hiding = false

create_sprites
refresh

unless $game_temp.minimap_manual_visible
self.opacity = 0
end
end
#--------------------------------------------------------------------------
# ○ スプライト作成
#--------------------------------------------------------------------------
def create_sprites
@viewport = Viewport.new(@map_rect)
@viewport.z = KMS_MiniMap::MAP_Z

# ビットマップサイズ計算
@bmp_size = Size.new(
(@grid_num.x + 2) * @grid_size,
(@grid_num.y + 2) * @grid_size
)
@buf_bitmap = Bitmap.new(@bmp_size.width, @bmp_size.height)

# マップ用スプライト作成
@map_sprite = Sprite.new(@viewport)
@map_sprite.x = -@grid_size
@map_sprite.y = -@grid_size
@map_sprite.z = 0
@map_sprite.bitmap = Bitmap.new(@bmp_size.width, @bmp_size.height)

# オブジェクト用スプライト作成
@object_sprite = Sprite_MiniMapIcon.new(@viewport)
@object_sprite.x = -@grid_size
@object_sprite.y = -@grid_size
@object_sprite.z = 1
@object_sprite.bitmap = Bitmap.new(@bmp_size.width, @bmp_size.height)

# 現在位置スプライト作成
@position_sprite = Sprite_MiniMapIcon.new
@position_sprite.x = @map_rect.x + @grid_num.x / 2 * @grid_size
@position_sprite.y = @map_rect.y + @grid_num.y / 2 * @grid_size
@position_sprite.z = @viewport.z + 2
bitmap = Bitmap.new(@grid_size, @grid_size)
bitmap.fill_rect(bitmap.rect, KMS_MiniMap:😛OSITION_COLOR)
@position_sprite.bitmap = bitmap
end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
def dispose
@buf_bitmap.dispose
@map_sprite.bitmap.dispose
@map_sprite.dispose
@object_sprite.bitmap.dispose
@object_sprite.dispose
@position_sprite.bitmap.dispose
@position_sprite.dispose
@viewport.dispose
end
#--------------------------------------------------------------------------
# ○ 可視状態取得
#--------------------------------------------------------------------------
def visible
return @map_sprite.visible
end
#--------------------------------------------------------------------------
# ○ 可視状態設定
#--------------------------------------------------------------------------
def visible=(value)
@viewport.visible = value
@map_sprite.visible = value
@object_sprite.visible = value
@position_sprite.visible = value
end
#--------------------------------------------------------------------------
# ○ 不透明度取得
#--------------------------------------------------------------------------
def opacity
return @map_sprite.opacity
end
#--------------------------------------------------------------------------
# ○ 不透明度設定
#--------------------------------------------------------------------------
def opacity=(value)
@map_sprite.opacity = value
@object_sprite.opacity = value
@position_sprite.opacity = value
end
#--------------------------------------------------------------------------
# ○ リフレッシュ
#--------------------------------------------------------------------------
def refresh
update_draw_range
update_passage_table
update_object_list
update_position
draw_map
draw_object
Graphics.frame_reset
end
#--------------------------------------------------------------------------
# ○ フェードイン
#--------------------------------------------------------------------------
def fadein
@showing = true
@hiding = false
end
#--------------------------------------------------------------------------
# ○ フェードアウト
#--------------------------------------------------------------------------
def fadeout
@showing = false
@hiding = true
end
#--------------------------------------------------------------------------
# ○ キー入力更新
#--------------------------------------------------------------------------
def update_input
return if KMS_MiniMap::SWITCH_BUTTON.nil?

if Input.trigger?(KMS_MiniMap::SWITCH_BUTTON)
if opacity < 255 && !@showing
$game_temp.minimap_manual_visible = true
fadein
elsif opacity > 0 && !@hiding
$game_temp.minimap_manual_visible = false
fadeout
end
end
end
#--------------------------------------------------------------------------
# ○ 描画範囲更新
#--------------------------------------------------------------------------
def update_draw_range
range = []
(2).times { |i| range = @draw_grid_num / 2 }

@draw_range_begin.x = $game_player.x - range[0]
@draw_range_begin.y = $game_player.y - range[1]
@draw_range_end.x = $game_player.x + range[0]
@draw_range_end.y = $game_player.y + range[1]
end
#--------------------------------------------------------------------------
# ○ 通行可否テーブル更新
#--------------------------------------------------------------------------
def update_passage_table
cache = get_passage_table_cache
@passage_table = cache.table
@passage_scan_table = cache.scan_table

update_around_passage_table
end
#--------------------------------------------------------------------------
# ○ 通行可否テーブルのキャッシュを取得
#--------------------------------------------------------------------------
def get_passage_table_cache
map_id = $game_map.map_id
cache = @@passage_cache.find { |c| c.map_id == map_id }

# キャッシュミスしたら新規作成
if cache == nil
cache = PassageCache.new(map_id)
cache.table = Table.new($game_map.width, $game_map.height)
cache.scan_table = Table.new(
($game_map.width + @draw_grid_num.x - 1) / @draw_grid_num.x,
($game_map.height + @draw_grid_num.y - 1) / @draw_grid_num.y
)
end

# 直近のキャッシュは先頭に移動し、古いキャッシュは削除
@@passage_cache.unshift(cache)
@@passage_cache.delete_at(KMS_MiniMap::CACHE_NUM)

return cache
end
#--------------------------------------------------------------------------
# ○ 通行可否テーブルのキャッシュをクリア
#--------------------------------------------------------------------------
def clear_passage_table_cache
return if @passage_scan_table == nil

table = @passage_scan_table
@passage_scan_table = Table.new(table.xsize, table.ysize)
end
#--------------------------------------------------------------------------
# ○ 通行可否テーブルの探索
# x, y : 探索位置
#--------------------------------------------------------------------------
def scan_passage(x, y)
dx = x / @draw_grid_num.x
dy = y / @draw_grid_num.y

# 探索済み
return if @passage_scan_table[dx, dy] == 1

# マップ範囲外
return unless dx.between?(0, @passage_scan_table.xsize - 1)
return unless dy.between?(0, @passage_scan_table.ysize - 1)

rx = (dx * @draw_grid_num.x)...((dx + 1) * @draw_grid_num.x)
ry = (dy * @draw_grid_num.y)...((dy + 1) * @draw_grid_num.y)
mw = $game_map.width - 1
mh = $game_map.height - 1

# 探索範囲内の通行テーブルを生成
rx.each { |x|
next unless x.between?(0, mw)
ry.each { |y|
next unless y.between?(0, mh)

# 通行方向フラグ作成
# (↓、←、→、↑ の順に 1, 2, 4, 8 が対応)
flag = 0
[2, 4, 6, 8].each{ |d|
flag |= 1 << (d / 2 - 1) if $game_map.passable?(x, y, d)
}
@passage_table[x, y] = flag
}
}
@passage_scan_table[dx, dy] = 1
end
#--------------------------------------------------------------------------
# ○ 周辺の通行可否テーブル更新
#--------------------------------------------------------------------------
def update_around_passage_table
gx = @draw_grid_num.x
gy = @draw_grid_num.y
dx = $game_player.x - gx / 2
dy = $game_player.y - gy / 2
scan_passage(dx, dy)
scan_passage(dx + gx, dy)
scan_passage(dx, dy + gy)
scan_passage(dx + gx, dy + gy)
end
#--------------------------------------------------------------------------
# ○ オブジェクト一覧更新
#--------------------------------------------------------------------------
def update_object_list
events = $game_map.events.values

# WALL
@wall_events = events.find_all { |e| e.is_minimap_wall_event? }

# MOVE
@move_events = events.find_all { |e| e.is_minimap_move_event? }

# OBJ
@object_list = events.find_all { |e| e.is_minimap_object? }
end
#--------------------------------------------------------------------------
# ○ 位置更新
#--------------------------------------------------------------------------
def update_position
# 移動量算出
pt = Point.new($game_player.x, $game_player.y)
ox = ($game_player.real_x - pt.x) * @grid_size
oy = ($game_player.real_y - pt.y) * @grid_size

@viewport.ox = ox
@viewport.oy = oy

# 移動していたらマップ再描画
if pt.x != @last_x || pt.y != @last_y
draw_map
@last_x = pt.x
@last_y = pt.y
end
end
#--------------------------------------------------------------------------
# ○ 描画範囲内判定
#--------------------------------------------------------------------------
def in_draw_range?(x, y)
rb = @draw_range_begin
re = @draw_range_end
return (x.between?(rb.x, re.x) && y.between?(rb.y, re.y))
end
#--------------------------------------------------------------------------
# ○ マップ範囲内判定
#--------------------------------------------------------------------------
def in_map_range?(x, y)
mw = $game_map.width
mh = $game_map.height
return (x.between?(0, mw - 1) && y.between?(0, mh - 1))
end
#--------------------------------------------------------------------------
# ○ マップ描画
#--------------------------------------------------------------------------
def draw_map
update_around_passage_table

bitmap = @map_sprite.bitmap
bitmap.fill_rect(bitmap.rect, KMS_MiniMap::BACKGROUND_COLOR)

draw_map_foreground(bitmap)
draw_map_move_event(bitmap)
end
#--------------------------------------------------------------------------
# ○ 通行可能領域の描画
#--------------------------------------------------------------------------
def draw_map_foreground(bitmap)
range_x = (@draw_range_begin.x)..(@draw_range_end.x)
range_y = (@draw_range_begin.y)..(@draw_range_end.y)
map_w = $game_map.width - 1
map_h = $game_map.height - 1
rect = Rect.new(0, 0, @grid_size, @grid_size)

range_x.each { |x|
next unless x.between?(0, map_w)
range_y.each { |y|
next unless y.between?(0, map_h)
next if @passage_table[x, y] == 0
next if @wall_events.find { |e| e.x == x && e.y == y } # 壁

# グリッド描画サイズ算出
rect.set(0, 0, @grid_size, @grid_size)
rect.x = (x - @draw_range_begin.x) * @grid_size
rect.y = (y - @draw_range_begin.y) * @grid_size
flag = @passage_table[x, y]
if flag & 0x01 == 0 # 下通行不能
rect.height -= 1
end
if flag & 0x02 == 0 # 左通行不能
rect.x += 1
rect.width -= 1
end
if flag & 0x04 == 0 # 右通行不能
rect.width -= 1
end
if flag & 0x08 == 0 # 上通行不能
rect.y += 1
rect.height -= 1
end
bitmap.fill_rect(rect, KMS_MiniMap::FOREGROUND_COLOR)
}
}
end
#--------------------------------------------------------------------------
# ○ 移動イベントの描画
#--------------------------------------------------------------------------
def draw_map_move_event(bitmap)
rect = Rect.new(0, 0, @grid_size, @grid_size)
@move_events.each { |e|
rect.x = (e.x - @draw_range_begin.x) * @grid_size
rect.y = (e.y - @draw_range_begin.y) * @grid_size
bitmap.fill_rect(rect, KMS_MiniMap::MOVE_EVENT_COLOR)
}
end
#--------------------------------------------------------------------------
# ○ アニメーション更新
#--------------------------------------------------------------------------
def update_animation
if @showing
# フェードイン
self.opacity += 16
if opacity == 255
@showing = false
end
elsif @hiding
# フェードアウト
self.opacity -= 16
if opacity == 0
@hiding = false
end
end
end
#--------------------------------------------------------------------------
# ○ オブジェクト描画
#--------------------------------------------------------------------------
def draw_object
# 下準備
bitmap = @object_sprite.bitmap
bitmap.clear
rect = Rect.new(0, 0, @grid_size, @grid_size)

# オブジェクト描画
@object_list.each { |obj|
next unless in_draw_range?(obj.x, obj.y)

color = KMS_MiniMap:😮BJECT_COLOR[obj.minimap_object_type - 1]
next if color.nil?

rect.x = (obj.real_x - @draw_range_begin.x) * @grid_size
rect.y = (obj.real_y - @draw_range_begin.y) * @grid_size
bitmap.fill_rect(rect, color)
}

# 乗り物描画
$game_map.vehicles.each { |vehicle|
next if vehicle.transparent

rect.x = (vehicle.real_x - @draw_range_begin.x) * @grid_size
rect.y = (vehicle.real_y - @draw_range_begin.y) * @grid_size
bitmap.fill_rect(rect, KMS_MiniMap::VEHICLE_COLOR)
}
end
#--------------------------------------------------------------------------
# ○ 更新
#--------------------------------------------------------------------------
def update
update_input

return unless need_update?

update_draw_range
update_position
update_animation
draw_object

@map_sprite.update
@object_sprite.update
@position_sprite.update
end
#--------------------------------------------------------------------------
# ○ 更新判定
#--------------------------------------------------------------------------
def need_update?
return (visible && opacity > 0) || @showing || @hiding
end
end

#==============================================================================
# □ Sprite_MiniMapIcon
#------------------------------------------------------------------------------
# ミニマップ用アイコンのクラスです。
#==============================================================================

class Sprite_MiniMapIcon < Sprite
DURATION_MAX = 60
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# viewport : ビューポート
#--------------------------------------------------------------------------
def initialize(viewport = nil)
super(viewport)
@duration = DURATION_MAX / 2
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
super
@duration += 1
if @duration == DURATION_MAX
@duration = 0
end
update_effect
end
#--------------------------------------------------------------------------
# ○ エフェクトの更新
#--------------------------------------------------------------------------
def update_effect
self.color.set(255, 255, 255,
(@duration - DURATION_MAX / 2).abs * KMS_MiniMap::BLINK_LEVEL
)
end
end

#==============================================================================
# ■ Spriteset_Map
#==============================================================================

class Spriteset_Map
attr_reader :minimap
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap

create_minimap
end
#--------------------------------------------------------------------------
# ○ ミニマップの作成
#--------------------------------------------------------------------------
def create_minimap
@minimap = Game_MiniMap.new(@tilemap)
@minimap.visible = $game_system.minimap_show && $game_map.minimap_show?
end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
alias dispose_KMS_MiniMap dispose
def dispose
dispose_KMS_MiniMap

dispose_minimap
end
#--------------------------------------------------------------------------
# ○ ミニマップの解放
#--------------------------------------------------------------------------
def dispose_minimap
@minimap.dispose
@minimap = nil
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias update_KMS_MiniMap update
def update
update_KMS_MiniMap

update_minimap
end
#--------------------------------------------------------------------------
# ○ ミニマップ更新
#--------------------------------------------------------------------------
def minimap_show?
return $game_map.minimap_show? && $game_system.minimap_show
end
#--------------------------------------------------------------------------
# ○ ミニマップ更新
#--------------------------------------------------------------------------
def update_minimap
return if @minimap.nil?

# 表示切替
if minimap_show?
@minimap.visible = true
else
@minimap.visible = false
return
end

# フェード判定
case $game_map.minimap_fade
when Game_Map::MINIMAP_FADE_IN
@minimap.fadein
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
when Game_Map::MINIMAP_FADE_OUT
@minimap.fadeout
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
end

@minimap.update
end
#--------------------------------------------------------------------------
# ○ ミニマップ全体をリフレッシュ
#--------------------------------------------------------------------------
def refresh_minimap
return if @minimap.nil?

@minimap.clear_passage_table_cache
@minimap.refresh
end
#--------------------------------------------------------------------------
# ○ ミニマップのオブジェクトを更新
#--------------------------------------------------------------------------
def update_minimap_object
@minimap.update_object_list unless @minimap.nil?
end
end

#==============================================================================
# ■ Scene_Map
#==============================================================================

class Scene_Map
#--------------------------------------------------------------------------
# ● 場所移動後の処理
#--------------------------------------------------------------------------
alias post_transfer_KMS_MiniMap post_transfer
def post_transfer
refresh_minimap

post_transfer_KMS_MiniMap
end
#--------------------------------------------------------------------------
# ○ ミニマップ全体をリフレッシュ
#--------------------------------------------------------------------------
def refresh_minimap
@spriteset.refresh_minimap unless @spriteset.nil?
end
#--------------------------------------------------------------------------
# ○ ミニマップのオブジェクトを更新
#--------------------------------------------------------------------------
def update_minimap_object
@spriteset.update_minimap_object unless @spriteset.nil?
end
end

This script is really good and it would suit my game but It's got some serious issues

First of all it seems the minimaps is ALWAYS running in the background which severely slows down my game. I was wondering if there's any way to have it so the map isn't running in the background when it's hidden, which the script does allow you to hide the map

Also the map does this fade in and fade out that I don't like, i'd rather it just pop in and out without the fade

How would I go about making these changes? Im very new to coding and don't know where to start, and it seems every change I make really makes no difference
Try this, I fixed it without testing it because I don't have vx version.
Spoiler
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆ ミニマップ - KMS_MiniMap ◆ VX Ace ◆
#_/ ◇ Last update : 2012/02/12 (TOMY@Kamesoft) ◇
#_/----------------------------------------------------------------------------

module KMS_MiniMap
SWITCH_BUTTON = :Z

# ミニマップ表示位置・サイズ (X, Y, 幅, 高さ)
MAP_RECT = Rect.new(364, 20, 160, 120)
MAP_Z = 0

# 1マスのサイズ
GRID_SIZE = 5

# ミニマップカラー
FOREGROUND_COLOR = Color.new(192, 192, 224, 160) # 前景色 (通行可)
BACKGROUND_COLOR = Color.new( 0, 0, 160, 160) # 背景色 (通行不可)
POSITION_COLOR = Color.new(255, 0, 0, 192) # 現在位置
MOVE_EVENT_COLOR = Color.new(255, 160, 0, 192) # マップ移動イベント
VEHICLE_COLOR = Color.new( 96, 128, 0, 192) # 乗り物

OBJECT_COLOR = [
Color.new( 0, 128, 0, 192), # OBJ 1
Color.new( 0, 160, 160, 192), # OBJ 2
Color.new(160, 0, 160, 192), # OBJ 3
]
BLINK_LEVEL = 7
CACHE_NUM = 10
end

$kms_imported = {} if $kms_imported == nil
$kms_imported["MiniMap"] = true

module KMS_MiniMap
REGEX_NO_MINIMAP_NOTE = /<(?:ミニマップ|MINIMAP)\s*(?:非表示|HIDE)>/i
REGEX_NO_MINIMAP_NAME = /\[NOMAP\]/i
REGEX_WALL_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:壁|障害物|WALL)>/i
REGEX_MOVE_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:移動|MOVE)>/i
REGEX_OBJECT = /<(?:ミニマップ|MINIMAP)\s+OBJ(?:ECT)?\s*(\d+)>/i
end

module KMS_Commands
module_function
def show_minimap
$game_temp.minimap_manual_visible = true
$game_system.minimap_show = true
end

def hide_minimap
$game_system.minimap_show = false
end

def minimap_showing?
return $game_system.minimap_show
end

def refresh_minimap
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.refresh_minimap
end

def update_minimap_object
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.update_minimap_object
end
end

class Game_Interpreter
include KMS_Commands
end

class RPG::Map
def create_minimap_cache
@__minimap_show = true
note.each_line { |line|
if line =~ KMS_MiniMap::REGEX_NO_MINIMAP_NOTE
@__minimap_show = false
end
}
end

def minimap_show?
create_minimap_cache if @__minimap_show.nil?
return @__minimap_show
end
end

class Game_Temp
attr_accessor :minimap_manual_visible
alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
@minimap_manual_visible = true
end
end

class Game_System
attr_accessor :minimap_show
alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
@minimap_show = true
end
end

class Game_Map
MINIMAP_FADE_NONE = 0
MINIMAP_FADE_IN = 1
MINIMAP_FADE_OUT = 2
attr_accessor :minimap_fade

def minimap_show?
return $data_mapinfos[map_id].minimap_show? && @map.minimap_show?
end

def fadein_minimap
@minimap_fade = MINIMAP_FADE_IN
end

def fadeout_minimap
@minimap_fade = MINIMAP_FADE_OUT
end

alias refresh_KMS_MiniMap refresh
def refresh
refresh_KMS_MiniMap
SceneManager.scene.refresh_minimap if SceneManager.scene_is?(Scene_Map)
end
end

class Game_Event < Game_Character
def __create_minimap_cache
@__last_page = @Page
@__minimap_wall_event = false
@__minimap_move_event = false
@__minimap_object_type = -1

return if @page.nil?

@page.list.each { |cmd|
break unless [108, 408].include?(cmd.code)
case cmd.parameters[0]
when KMS_MiniMap::REGEX_WALL_EVENT
@__minimap_wall_event = true
when KMS_MiniMap::REGEX_MOVE_EVENT
@__minimap_move_event = true
when KMS_MiniMap::REGEX_OBJECT
@__minimap_object_type = $1.to_i
end
}
end
private :__create_minimap_cache

def graphic_exist?
return (character_name != "" || tile_id > 0)
end

def is_minimap_wall_event?
if @__minimap_wall_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_wall_event
end

def is_minimap_move_event?
if @__minimap_move_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_move_event
end

def is_minimap_object?
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type > 0
end

def minimap_object_type
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type
end
end

class Game_MiniMap
Point = Struct.new🙂x, :y)
Size = Struct.new🙂width, :height)
PassageCache = Struct.new🙂map_id, :table, :scan_table)

@@passage_cache = []

def initialize(tilemap)
@map_rect = KMS_MiniMap::MAP_RECT
@grid_size = [KMS_MiniMap::GRID_SIZE, 1].max
@x = 0
@y = 0
@grid_num = Point.new(
(@map_rect.width + @grid_size - 1) / @grid_size,
(@map_rect.height + @grid_size - 1) / @grid_size
)
@draw_grid_num = Point.new(@grid_num.x + 2, @grid_num.y + 2)
@draw_range_begin = Point.new(0, 0)
@draw_range_end = Point.new(0, 0)
@tilemap = tilemap
@last_x = $game_player.x
@last_y = $game_player.y
@showing = false
@hiding = false
create_sprites
refresh
unless $game_temp.minimap_manual_visible
self.opacity = 0
end
end

def create_sprites
@viewport = Viewport.new(@map_rect)
@viewport.z = KMS_MiniMap::MAP_Z

@bmp_size = Size.new(
(@grid_num.x + 2) * @grid_size,
(@grid_num.y + 2) * @grid_size
)
@buf_bitmap = Bitmap.new(@bmp_size.width, @bmp_size.height)

@map_sprite = Sprite.new(@viewport)
@map_sprite.x = -@grid_size
@map_sprite.y = -@grid_size
@map_sprite.z = 0
@map_sprite.bitmap = Bitmap.new(@bmp_size.width, @bmp_size.height)

@object_sprite = Sprite_MiniMapIcon.new(@viewport)
@object_sprite.x = -@grid_size
@object_sprite.y = -@grid_size
@object_sprite.z = 1
@object_sprite.bitmap = Bitmap.new(@bmp_size.width, @bmp_size.height)

@position_sprite = Sprite_MiniMapIcon.new
@position_sprite.x = @map_rect.x + @grid_num.x / 2 * @grid_size
@position_sprite.y = @map_rect.y + @grid_num.y / 2 * @grid_size
@position_sprite.z = @viewport.z + 2
bitmap = Bitmap.new(@grid_size, @grid_size)
bitmap.fill_rect(bitmap.rect, KMS_MiniMap:😛OSITION_COLOR)
@position_sprite.bitmap = bitmap
end

def dispose
@buf_bitmap.dispose
@map_sprite.bitmap.dispose
@map_sprite.dispose
@object_sprite.bitmap.dispose
@object_sprite.dispose
@position_sprite.bitmap.dispose
@position_sprite.dispose
@viewport.dispose
end

def visible
return @map_sprite.visible
end

def visible=(value)
@viewport.visible = value
@map_sprite.visible = value
@object_sprite.visible = value
@position_sprite.visible = value
end

def opacity
return @map_sprite.opacity
end

def opacity=(value)
@map_sprite.opacity = value
@object_sprite.opacity = value
@position_sprite.opacity = value
end

def refresh
update_draw_range
update_passage_table
update_object_list
update_position
draw_map
draw_object
Graphics.frame_reset
end

def fadein
@showing = true
@hiding = false
self.opacity = 255 # Set opacity to 255 immediately
end

def fadeout
@showing = false
@hiding = true
self.opacity = 0 # Set opacity to 0 immediately
end

def update_input
return if KMS_MiniMap::SWITCH_BUTTON.nil?

if Input.trigger?(KMS_MiniMap::SWITCH_BUTTON)
if opacity < 255 && !@showing
$game_temp.minimap_manual_visible = true
fadein
elsif opacity > 0 && !@hiding
$game_temp.minimap_manual_visible = false
fadeout
end
end
end

def update
update_input
return unless need_update?

update_draw_range
update_position
update_animation
draw_object

@map_sprite.update
@object_sprite.update
@position_sprite.update
end

def need_update?
return (visible && opacity > 0) || @showing || @hiding
end
end

class Sprite_MiniMapIcon < Sprite
DURATION_MAX = 60

def initialize(viewport = nil)
super(viewport)
@duration = DURATION_MAX / 2
end

def update
super
@duration += 1
if @duration == DURATION_MAX
@duration = 0
end
update_effect
end

def update_effect
self.color.set(255, 255, 255, (@duration - DURATION_MAX / 2).abs * KMS_MiniMap::BLINK_LEVEL)
end
end

class Spriteset_Map
attr_reader :minimap

alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
create_minimap
end

def create_minimap
@minimap = Game_MiniMap.new(@tilemap)
@minimap.visible = $game_system.minimap_show && $game_map.minimap_show?
end

alias dispose_KMS_MiniMap dispose
def dispose
dispose_KMS_MiniMap
dispose_minimap
end

def dispose_minimap
@minimap.dispose
@minimap = nil
end

alias update_KMS_MiniMap update
def update
update_KMS_MiniMap
update_minimap
end

def minimap_show?
return $game_map.minimap_show? && $game_system.minimap_show
end

def update_minimap
return if @minimap.nil?

if minimap_show?
@minimap.visible = true
else
@minimap.visible = false
return
end

case $game_map.minimap_fade
when Game_Map::MINIMAP_FADE_IN
@minimap.fadein
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
when Game_Map::MINIMAP_FADE_OUT
@minimap.fadeout
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
end

@minimap.update
end

def refresh_minimap
return if @minimap.nil?

@minimap.clear_passage_table_cache
@minimap.refresh
end

def update_minimap_object
@minimap.update_object_list unless @minimap.nil?
end
end

class Scene_Map
alias post_transfer_KMS_MiniMap post_transfer
def post_transfer
refresh_minimap
post_transfer_KMS_MiniMap
end

def refresh_minimap
@spriteset.refresh_minimap unless @spriteset.nil?
end

def update_minimap_object
@spriteset.update_minimap_object unless @spriteset.nil?
end
end
Try this, I fixed it without testing it because I don't have vx version.
Spoiler
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆ ミニマップ - KMS_MiniMap ◆ VX Ace ◆
#_/ ◇ Last update : 2012/02/12 (TOMY@Kamesoft) ◇
#_/----------------------------------------------------------------------------

module KMS_MiniMap
SWITCH_BUTTON = :Z

# ミニマップ表示位置・サイズ (X, Y, 幅, 高さ)
MAP_RECT = Rect.new(364, 20, 160, 120)
MAP_Z = 0

# 1マスのサイズ
GRID_SIZE = 5

# ミニマップカラー
FOREGROUND_COLOR = Color.new(192, 192, 224, 160) # 前景色 (通行可)
BACKGROUND_COLOR = Color.new( 0, 0, 160, 160) # 背景色 (通行不可)
POSITION_COLOR = Color.new(255, 0, 0, 192) # 現在位置
MOVE_EVENT_COLOR = Color.new(255, 160, 0, 192) # マップ移動イベント
VEHICLE_COLOR = Color.new( 96, 128, 0, 192) # 乗り物

OBJECT_COLOR = [
Color.new( 0, 128, 0, 192), # OBJ 1
Color.new( 0, 160, 160, 192), # OBJ 2
Color.new(160, 0, 160, 192), # OBJ 3
]
BLINK_LEVEL = 7
CACHE_NUM = 10
end

$kms_imported = {} if $kms_imported == nil
$kms_imported["MiniMap"] = true

module KMS_MiniMap
REGEX_NO_MINIMAP_NOTE = /<(?:ミニマップ|MINIMAP)\s*(?:非表示|HIDE)>/i
REGEX_NO_MINIMAP_NAME = /\[NOMAP\]/i
REGEX_WALL_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:壁|障害物|WALL)>/i
REGEX_MOVE_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:移動|MOVE)>/i
REGEX_OBJECT = /<(?:ミニマップ|MINIMAP)\s+OBJ(?:ECT)?\s*(\d+)>/i
end

module KMS_Commands
module_function
def show_minimap
$game_temp.minimap_manual_visible = true
$game_system.minimap_show = true
end

def hide_minimap
$game_system.minimap_show = false
end

def minimap_showing?
return $game_system.minimap_show
end

def refresh_minimap
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.refresh_minimap
end

def update_minimap_object
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.update_minimap_object
end
end

class Game_Interpreter
include KMS_Commands
end

class RPG::Map
def create_minimap_cache
@__minimap_show = true
note.each_line { |line|
if line =~ KMS_MiniMap::REGEX_NO_MINIMAP_NOTE
@__minimap_show = false
end
}
end

def minimap_show?
create_minimap_cache if @__minimap_show.nil?
return @__minimap_show
end
end

class Game_Temp
attr_accessor :minimap_manual_visible
alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
@minimap_manual_visible = true
end
end

class Game_System
attr_accessor :minimap_show
alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
@minimap_show = true
end
end

class Game_Map
MINIMAP_FADE_NONE = 0
MINIMAP_FADE_IN = 1
MINIMAP_FADE_OUT = 2
attr_accessor :minimap_fade

def minimap_show?
return $data_mapinfos[map_id].minimap_show? && @map.minimap_show?
end

def fadein_minimap
@minimap_fade = MINIMAP_FADE_IN
end

def fadeout_minimap
@minimap_fade = MINIMAP_FADE_OUT
end

alias refresh_KMS_MiniMap refresh
def refresh
refresh_KMS_MiniMap
SceneManager.scene.refresh_minimap if SceneManager.scene_is?(Scene_Map)
end
end

class Game_Event < Game_Character
def __create_minimap_cache
@__last_page = @Page
@__minimap_wall_event = false
@__minimap_move_event = false
@__minimap_object_type = -1

return if @page.nil?

@page.list.each { |cmd|
break unless [108, 408].include?(cmd.code)
case cmd.parameters[0]
when KMS_MiniMap::REGEX_WALL_EVENT
@__minimap_wall_event = true
when KMS_MiniMap::REGEX_MOVE_EVENT
@__minimap_move_event = true
when KMS_MiniMap::REGEX_OBJECT
@__minimap_object_type = $1.to_i
end
}
end
private :__create_minimap_cache

def graphic_exist?
return (character_name != "" || tile_id > 0)
end

def is_minimap_wall_event?
if @__minimap_wall_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_wall_event
end

def is_minimap_move_event?
if @__minimap_move_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_move_event
end

def is_minimap_object?
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type > 0
end

def minimap_object_type
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type
end
end

class Game_MiniMap
Point = Struct.new🙂x, :y)
Size = Struct.new🙂width, :height)
PassageCache = Struct.new🙂map_id, :table, :scan_table)

@@passage_cache = []

def initialize(tilemap)
@map_rect = KMS_MiniMap::MAP_RECT
@grid_size = [KMS_MiniMap::GRID_SIZE, 1].max
@x = 0
@y = 0
@grid_num = Point.new(
(@map_rect.width + @grid_size - 1) / @grid_size,
(@map_rect.height + @grid_size - 1) / @grid_size
)
@draw_grid_num = Point.new(@grid_num.x + 2, @grid_num.y + 2)
@draw_range_begin = Point.new(0, 0)
@draw_range_end = Point.new(0, 0)
@tilemap = tilemap
@last_x = $game_player.x
@last_y = $game_player.y
@showing = false
@hiding = false
create_sprites
refresh
unless $game_temp.minimap_manual_visible
self.opacity = 0
end
end

def create_sprites
@viewport = Viewport.new(@map_rect)
@viewport.z = KMS_MiniMap::MAP_Z

@bmp_size = Size.new(
(@grid_num.x + 2) * @grid_size,
(@grid_num.y + 2) * @grid_size
)
@buf_bitmap = Bitmap.new(@bmp_size.width, @bmp_size.height)

@map_sprite = Sprite.new(@viewport)
@map_sprite.x = -@grid_size
@map_sprite.y = -@grid_size
@map_sprite.z = 0
@map_sprite.bitmap = Bitmap.new(@bmp_size.width, @bmp_size.height)

@object_sprite = Sprite_MiniMapIcon.new(@viewport)
@object_sprite.x = -@grid_size
@object_sprite.y = -@grid_size
@object_sprite.z = 1
@object_sprite.bitmap = Bitmap.new(@bmp_size.width, @bmp_size.height)

@position_sprite = Sprite_MiniMapIcon.new
@position_sprite.x = @map_rect.x + @grid_num.x / 2 * @grid_size
@position_sprite.y = @map_rect.y + @grid_num.y / 2 * @grid_size
@position_sprite.z = @viewport.z + 2
bitmap = Bitmap.new(@grid_size, @grid_size)
bitmap.fill_rect(bitmap.rect, KMS_MiniMap:😛OSITION_COLOR)
@position_sprite.bitmap = bitmap
end

def dispose
@buf_bitmap.dispose
@map_sprite.bitmap.dispose
@map_sprite.dispose
@object_sprite.bitmap.dispose
@object_sprite.dispose
@position_sprite.bitmap.dispose
@position_sprite.dispose
@viewport.dispose
end

def visible
return @map_sprite.visible
end

def visible=(value)
@viewport.visible = value
@map_sprite.visible = value
@object_sprite.visible = value
@position_sprite.visible = value
end

def opacity
return @map_sprite.opacity
end

def opacity=(value)
@map_sprite.opacity = value
@object_sprite.opacity = value
@position_sprite.opacity = value
end

def refresh
update_draw_range
update_passage_table
update_object_list
update_position
draw_map
draw_object
Graphics.frame_reset
end

def fadein
@showing = true
@hiding = false
self.opacity = 255 # Set opacity to 255 immediately
end

def fadeout
@showing = false
@hiding = true
self.opacity = 0 # Set opacity to 0 immediately
end

def update_input
return if KMS_MiniMap::SWITCH_BUTTON.nil?

if Input.trigger?(KMS_MiniMap::SWITCH_BUTTON)
if opacity < 255 && !@showing
$game_temp.minimap_manual_visible = true
fadein
elsif opacity > 0 && !@hiding
$game_temp.minimap_manual_visible = false
fadeout
end
end
end

def update
update_input
return unless need_update?

update_draw_range
update_position
update_animation
draw_object

@map_sprite.update
@object_sprite.update
@position_sprite.update
end

def need_update?
return (visible && opacity > 0) || @showing || @hiding
end
end

class Sprite_MiniMapIcon < Sprite
DURATION_MAX = 60

def initialize(viewport = nil)
super(viewport)
@duration = DURATION_MAX / 2
end

def update
super
@duration += 1
if @duration == DURATION_MAX
@duration = 0
end
update_effect
end

def update_effect
self.color.set(255, 255, 255, (@duration - DURATION_MAX / 2).abs * KMS_MiniMap::BLINK_LEVEL)
end
end

class Spriteset_Map
attr_reader :minimap

alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
create_minimap
end

def create_minimap
@minimap = Game_MiniMap.new(@tilemap)
@minimap.visible = $game_system.minimap_show && $game_map.minimap_show?
end

alias dispose_KMS_MiniMap dispose
def dispose
dispose_KMS_MiniMap
dispose_minimap
end

def dispose_minimap
@minimap.dispose
@minimap = nil
end

alias update_KMS_MiniMap update
def update
update_KMS_MiniMap
update_minimap
end

def minimap_show?
return $game_map.minimap_show? && $game_system.minimap_show
end

def update_minimap
return if @minimap.nil?

if minimap_show?
@minimap.visible = true
else
@minimap.visible = false
return
end

case $game_map.minimap_fade
when Game_Map::MINIMAP_FADE_IN
@minimap.fadein
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
when Game_Map::MINIMAP_FADE_OUT
@minimap.fadeout
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
end

@minimap.update
end

def refresh_minimap
return if @minimap.nil?

@minimap.clear_passage_table_cache
@minimap.refresh
end

def update_minimap_object
@minimap.update_object_list unless @minimap.nil?
end
end

class Scene_Map
alias post_transfer_KMS_MiniMap post_transfer
def post_transfer
refresh_minimap
post_transfer_KMS_MiniMap
end

def refresh_minimap
@spriteset.refresh_minimap unless @spriteset.nil?
end

def update_minimap_object
@spriteset.update_minimap_object unless @spriteset.nil?
end
end
what does this mean?
Captura de ecrã 2024-11-11 205723.png
It should say:

Struct.new(:x, :y)
It should say:

Struct.new(:x, :y)
fixed but now this shows up
Captura de ecrã 2024-11-11 214318.png
Captura de ecrã 2024-11-11 214339.png
That's weird! The script does include such a method indeed. It could be a problem caused by the lack of indentation. Probably there's a missing end or an extra one that is not defining the whole Game_MiniMap class correctly.

Use this formatted version instead:

Ruby:
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆ ミニマップ - KMS_MiniMap ◆ VX Ace ◆
#_/ ◇ Last update : 2012/02/12 (TOMY@Kamesoft) ◇
#_/----------------------------------------------------------------------------
#_/ ミニマップ表示機能を追加します。
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#==============================================================================
# ★ 設定項目 - BEGIN Setting ★
#==============================================================================

module KMS_MiniMap
  # ◆ ミニマップ表示切替ボタン
  # nil にするとボタン切り替え無効。
  SWITCH_BUTTON = :Z

  # ◆ ミニマップ表示位置・サイズ (X, Y, 幅, 高さ)
  MAP_RECT = Rect.new(364, 20, 160, 120)
  # ◆ ミニマップの Z 座標
  # 大きくしすぎると色々なものに被ります。
  MAP_Z = 0
  # ◆ 1マスのサイズ
  # 3 以上を推奨。
  GRID_SIZE = 5

  # ◆ ミニマップカラー
  FOREGROUND_COLOR = Color.new(192, 192, 224, 160) # 前景色 (通行可)
  BACKGROUND_COLOR = Color.new( 0, 0, 160, 160) # 背景色 (通行不可)
  POSITION_COLOR = Color.new(255, 0, 0, 192) # 現在位置
  MOVE_EVENT_COLOR = Color.new(255, 160, 0, 192) # マップ移動イベント
  VEHICLE_COLOR = Color.new( 96, 128, 0, 192) # 乗り物

  # ◆ オブジェクトの色
  # 要素の先頭から順に OBJ1, OBJ2, ... に対応。
  OBJECT_COLOR = [
    Color.new( 0, 128, 0, 192), # OBJ 1
    Color.new( 0, 160, 160, 192), # OBJ 2
    Color.new(160, 0, 160, 192), # OBJ 3
  ] # ← この ] は消さないこと!

  # ◆ アイコンの点滅の強さ
  # 5 ~ 8 あたりを推奨。
  BLINK_LEVEL = 7

  # ◆ マップのキャッシュ数
  # この数を超えると、長期間参照していないものから削除。
  CACHE_NUM = 10
end

#==============================================================================
# ☆ 設定ここまで - END Setting ☆
#==============================================================================

$kms_imported = {} if $kms_imported == nil
$kms_imported["MiniMap"] = true

module KMS_MiniMap
  # ミニマップ非表示
  REGEX_NO_MINIMAP_NOTE = /<(?:ミニマップ|MINIMAP)\s*(?:非表示|HIDE)>/i
  REGEX_NO_MINIMAP_NAME = /\[NOMAP\]/i

  # 障害物
  REGEX_WALL_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:壁|障害物|WALL)>/i

  # 移動イベント
  REGEX_MOVE_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:移動|MOVE)>/i

  # オブジェクト
  REGEX_OBJECT = /<(?:ミニマップ|MINIMAP)\s+OBJ(?:ECT)?\s*(\d+)>/i
end

# *****************************************************************************

#==============================================================================
# □ KMS_Commands
#==============================================================================

module KMS_Commands
  module_function
  #--------------------------------------------------------------------------
  # ○ ミニマップを表示
  #--------------------------------------------------------------------------
  def show_minimap
    $game_temp.minimap_manual_visible = true
    $game_system.minimap_show = true
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップを隠す
  #--------------------------------------------------------------------------
  def hide_minimap
    $game_system.minimap_show = false
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップ表示状態の取得
  #--------------------------------------------------------------------------
  def minimap_showing?
    return $game_system.minimap_show
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップをリフレッシュ
  #--------------------------------------------------------------------------
  def refresh_minimap
    return unless SceneManager.scene_is?(Scene_Map)

    $game_map.refresh if $game_map.need_refresh
    SceneManager.scene.refresh_minimap
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップのオブジェクトを更新
  #--------------------------------------------------------------------------
  def update_minimap_object
    return unless SceneManager.scene_is?(Scene_Map)

    $game_map.refresh if $game_map.need_refresh
    SceneManager.scene.update_minimap_object
  end
end

#==============================================================================
# ■ Game_Interpreter
#==============================================================================

class Game_Interpreter
# イベントコマンドから直接コマンドを叩けるようにする
  include KMS_Commands
end

#==============================================================================
# ■ RPG::Map
#==============================================================================

class RPG::Map
#--------------------------------------------------------------------------
# ○ ミニマップのキャッシュ生成
#--------------------------------------------------------------------------
  def create_minimap_cache
    @__minimap_show = true

    note.each_line do |line|
      if line =~ KMS_MiniMap::REGEX_NO_MINIMAP_NOTE # マップ非表示
      @__minimap_show = false
      end
    end
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップ表示
  #--------------------------------------------------------------------------
  def minimap_show?
    create_minimap_cache if @__minimap_show.nil?
    return @__minimap_show
  end
end

#==============================================================================
# ■ RPG::MapInfo
#==============================================================================

class RPG::MapInfo
#--------------------------------------------------------------------------
# ● マップ名取得
#--------------------------------------------------------------------------
  def name
    return @name.gsub(/\[.*\]/) { "" }
  end
#--------------------------------------------------------------------------
# ○ オリジナルマップ名取得
#--------------------------------------------------------------------------
  def original_name
    return @Name
  end
#--------------------------------------------------------------------------
# ○ ミニマップのキャッシュ生成
#--------------------------------------------------------------------------
  def create_minimap_cache
    @__minimap_show = !(@Name =~ KMS_MiniMap::REGEX_NO_MINIMAP_NAME)
  end
#--------------------------------------------------------------------------
# ○ ミニマップ表示
#--------------------------------------------------------------------------
  def minimap_show?
    create_minimap_cache if @__minimap_show == nil
    return @__minimap_show
  end
end

#==============================================================================
# ■ Game_Temp
#==============================================================================

class Game_Temp
#--------------------------------------------------------------------------
# ○ 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :minimap_manual_visible # ミニマップ手動表示切り替えフラグ
#--------------------------------------------------------------------------
# ○ オブジェクト初期化
#--------------------------------------------------------------------------
  alias initialize_KMS_MiniMap initialize
  def initialize
    initialize_KMS_MiniMap

    @minimap_manual_visible = true
  end
end

#==============================================================================
# ■ Game_System
#==============================================================================

class Game_System
#--------------------------------------------------------------------------
# ○ 公開インスタンス変数
#--------------------------------------------------------------------------
  attr_accessor :minimap_show # ミニマップ表示フラグ
#--------------------------------------------------------------------------
# ○ オブジェクト初期化
#--------------------------------------------------------------------------
  alias initialize_KMS_MiniMap initialize
  def initialize
    initialize_KMS_MiniMap

    @minimap_show = true
  end
end

#==============================================================================
# ■ Game_Map
#==============================================================================

class Game_Map
#--------------------------------------------------------------------------
# ○ 定数
#--------------------------------------------------------------------------
  MINIMAP_FADE_NONE = 0 # ミニマップ フェードなし
  MINIMAP_FADE_IN = 1 # ミニマップ フェードイン
  MINIMAP_FADE_OUT = 2 # ミニマップ フェードアウト
#--------------------------------------------------------------------------
# ○ 公開インスタンス変数
#--------------------------------------------------------------------------
  attr_accessor :minimap_fade
#--------------------------------------------------------------------------
# ○ ミニマップを表示するか
#--------------------------------------------------------------------------
  def minimap_show?
    return $data_mapinfos[map_id].minimap_show? && @map.minimap_show?
  end
#--------------------------------------------------------------------------
# ○ ミニマップをフェードイン
#--------------------------------------------------------------------------
  def fadein_minimap
    @minimap_fade = MINIMAP_FADE_IN
  end
#--------------------------------------------------------------------------
# ○ ミニマップをフェードアウト
#--------------------------------------------------------------------------
  def fadeout_minimap
    @minimap_fade = MINIMAP_FADE_OUT
  end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
  alias refresh_KMS_MiniMap refresh
  def refresh
    refresh_KMS_MiniMap

    SceneManager.scene.refresh_minimap if SceneManager.scene_is?(Scene_Map)
  end
end

#==============================================================================
# ■ Game_Event
#==============================================================================

class Game_Event < Game_Character
#--------------------------------------------------------------------------
# ○ ミニマップ用のキャッシュを作成
#--------------------------------------------------------------------------
  def __create_minimap_cache
    @__last_page = @Page
    @__minimap_wall_event = false
    @__minimap_move_event = false
    @__minimap_object_type = -1

    return if @page.nil?

    @page.list.each do |cmd|
    # 注釈以外に到達したら離脱
    break unless [108, 408].include?(cmd.code)

    # 正規表現判定
    case cmd.parameters[0]
    when KMS_MiniMap::REGEX_WALL_EVENT
      @__minimap_wall_event = true
    when KMS_MiniMap::REGEX_MOVE_EVENT
      @__minimap_move_event = true
    when KMS_MiniMap::REGEX_OBJECT
      @__minimap_object_type = $1.to_i
    end
  end

  private :__create_minimap_cache
#--------------------------------------------------------------------------
# ○ グラフィックがあるか
#--------------------------------------------------------------------------
  def graphic_exist?
    return (character_name != "" || tile_id > 0)
  end
#--------------------------------------------------------------------------
# ○ 障害物か
#--------------------------------------------------------------------------
  def is_minimap_wall_event?
    if @__minimap_wall_event.nil? || @__last_page != @Page
      __create_minimap_cache
    end

    return @__minimap_wall_event
  end
#--------------------------------------------------------------------------
# ○ 移動イベントか
#--------------------------------------------------------------------------
  def is_minimap_move_event?
    if @__minimap_move_event.nil? || @__last_page != @Page
      __create_minimap_cache
    end

    return @__minimap_move_event
  end
#--------------------------------------------------------------------------
# ○ ミニマップオブジェクトか
#--------------------------------------------------------------------------
  def is_minimap_object?
    if @__minimap_object_type.nil? || @__last_page != @Page
      __create_minimap_cache
    end

    return @__minimap_object_type > 0
  end
#--------------------------------------------------------------------------
# ○ ミニマップオブジェクトタイプ
#--------------------------------------------------------------------------
  def minimap_object_type
    if @__minimap_object_type.nil? || @__last_page != @Page
      __create_minimap_cache
    end

    return @__minimap_object_type
  end
end

#==============================================================================
# □ Game_MiniMap
#------------------------------------------------------------------------------
# ミニマップを扱うクラスです。
#==============================================================================

class Game_MiniMap
#--------------------------------------------------------------------------
# ○ 構造体
#--------------------------------------------------------------------------
  Point = Struct.new(:x, :y)
  Size = Struct.new(:width, :height)
  PassageCache = Struct.new(:map_id, :table, :scan_table)
#--------------------------------------------------------------------------
# ○ クラス変数
#--------------------------------------------------------------------------
  @@passage_cache = [] # 通行フラグテーブルキャッシュ
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
  def initialize(tilemap)
    @map_rect = KMS_MiniMap::MAP_RECT
    @grid_size = [KMS_MiniMap::GRID_SIZE, 1].max

    @x = 0
    @y = 0
    @grid_num = Point.new(
      (@map_rect.width + @grid_size - 1) / @grid_size,
      (@map_rect.height + @grid_size - 1) / @grid_size
    )
    @draw_grid_num = Point.new(@grid_num.x + 2, @grid_num.y + 2)
    @draw_range_begin = Point.new(0, 0)
    @draw_range_end = Point.new(0, 0)
    @tilemap = tilemap

    @last_x = $game_player.x
    @last_y = $game_player.y

    @showing = false
    @hiding = false

    create_sprites
    refresh

    unless $game_temp.minimap_manual_visible
      self.opacity = 0
    end
  end
#--------------------------------------------------------------------------
# ○ スプライト作成
#--------------------------------------------------------------------------
  def create_sprites
    @viewport = Viewport.new(@map_rect)
    @viewport.z = KMS_MiniMap::MAP_Z

    # ビットマップサイズ計算
    @bmp_size = Size.new(
    (@grid_num.x + 2) * @grid_size,
    (@grid_num.y + 2) * @grid_size
    )
    @buf_bitmap = Bitmap.new(@bmp_size.width, @bmp_size.height)

    # マップ用スプライト作成
    @map_sprite = Sprite.new(@viewport)
    @map_sprite.x = -@grid_size
    @map_sprite.y = -@grid_size
    @map_sprite.z = 0
    @map_sprite.bitmap = Bitmap.new(@bmp_size.width, @bmp_size.height)

    # オブジェクト用スプライト作成
    @object_sprite = Sprite_MiniMapIcon.new(@viewport)
    @object_sprite.x = -@grid_size
    @object_sprite.y = -@grid_size
    @object_sprite.z = 1
    @object_sprite.bitmap = Bitmap.new(@bmp_size.width, @bmp_size.height)

    # 現在位置スプライト作成
    @position_sprite = Sprite_MiniMapIcon.new
    @position_sprite.x = @map_rect.x + @grid_num.x / 2 * @grid_size
    @position_sprite.y = @map_rect.y + @grid_num.y / 2 * @grid_size
    @position_sprite.z = @viewport.z + 2
    bitmap = Bitmap.new(@grid_size, @grid_size)
    bitmap.fill_rect(bitmap.rect, KMS_MiniMap::pOSITION_COLOR)
    @position_sprite.bitmap = bitmap
  end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
  def dispose
    @buf_bitmap.dispose
    @map_sprite.bitmap.dispose
    @map_sprite.dispose
    @object_sprite.bitmap.dispose
    @object_sprite.dispose
    @position_sprite.bitmap.dispose
    @position_sprite.dispose
    @viewport.dispose
  end
#--------------------------------------------------------------------------
# ○ 可視状態取得
#--------------------------------------------------------------------------
  def visible
    return @map_sprite.visible
  end
#--------------------------------------------------------------------------
# ○ 可視状態設定
#--------------------------------------------------------------------------
  def visible=(value)
    @viewport.visible = value
    @map_sprite.visible = value
    @object_sprite.visible = value
    @position_sprite.visible = value
  end
#--------------------------------------------------------------------------
# ○ 不透明度取得
#--------------------------------------------------------------------------
  def opacity
    return @map_sprite.opacity
  end
#--------------------------------------------------------------------------
# ○ 不透明度設定
#--------------------------------------------------------------------------
  def opacity=(value)
    @map_sprite.opacity = value
    @object_sprite.opacity = value
    @position_sprite.opacity = value
  end
#--------------------------------------------------------------------------
# ○ リフレッシュ
#--------------------------------------------------------------------------
  def refresh
    update_draw_range
    update_passage_table
    update_object_list
    update_position
    draw_map
    draw_object
    Graphics.frame_reset
  end
#--------------------------------------------------------------------------
# ○ フェードイン
#--------------------------------------------------------------------------
  def fadein
    @showing = true
    @hiding = false
  end
#--------------------------------------------------------------------------
# ○ フェードアウト
#--------------------------------------------------------------------------
  def fadeout
    @showing = false
    @hiding = true
  end
#--------------------------------------------------------------------------
# ○ キー入力更新
#--------------------------------------------------------------------------
  def update_input
    return if KMS_MiniMap::SWITCH_BUTTON.nil?

    if Input.trigger?(KMS_MiniMap::SWITCH_BUTTON)
      if opacity < 255 && !@showing
        $game_temp.minimap_manual_visible = true
        fadein
      elsif opacity > 0 && !@hiding
        $game_temp.minimap_manual_visible = false
        fadeout
      end
    end
  end
#--------------------------------------------------------------------------
# ○ 描画範囲更新
#--------------------------------------------------------------------------
  def update_draw_range
    range = []
    (2).times { |i| range = @draw_grid_num / 2 }

    @draw_range_begin.x = $game_player.x - range[0]
    @draw_range_begin.y = $game_player.y - range[1]
    @draw_range_end.x = $game_player.x + range[0]
    @draw_range_end.y = $game_player.y + range[1]
  end
#--------------------------------------------------------------------------
# ○ 通行可否テーブル更新
#--------------------------------------------------------------------------
  def update_passage_table
    cache = get_passage_table_cache
    @passage_table = cache.table
    @passage_scan_table = cache.scan_table

    update_around_passage_table
  end
#--------------------------------------------------------------------------
# ○ 通行可否テーブルのキャッシュを取得
#--------------------------------------------------------------------------
  def get_passage_table_cache
    map_id = $game_map.map_id
    cache = @@passage_cache.find { |c| c.map_id == map_id }

    # キャッシュミスしたら新規作成
    if cache == nil
      cache = PassageCache.new(map_id)
      cache.table = Table.new($game_map.width, $game_map.height)
      cache.scan_table = Table.new(
        ($game_map.width + @draw_grid_num.x - 1) / @draw_grid_num.x,
        ($game_map.height + @draw_grid_num.y - 1) / @draw_grid_num.y
      )
    end

  # 直近のキャッシュは先頭に移動し、古いキャッシュは削除
    @@passage_cache.unshift(cache)
    @@passage_cache.delete_at(KMS_MiniMap::CACHE_NUM)

    return cache
  end
#--------------------------------------------------------------------------
# ○ 通行可否テーブルのキャッシュをクリア
#--------------------------------------------------------------------------
  def clear_passage_table_cache
    return if @passage_scan_table == nil

    table = @passage_scan_table
    @passage_scan_table = Table.new(table.xsize, table.ysize)
  end
#--------------------------------------------------------------------------
# ○ 通行可否テーブルの探索
# x, y : 探索位置
#--------------------------------------------------------------------------
  def scan_passage(x, y)
    dx = x / @draw_grid_num.x
    dy = y / @draw_grid_num.y

    # 探索済み
    return if @passage_scan_table[dx, dy] == 1

    # マップ範囲外
    return unless dx.between?(0, @passage_scan_table.xsize - 1)
    return unless dy.between?(0, @passage_scan_table.ysize - 1)

    rx = (dx * @draw_grid_num.x)...((dx + 1) * @draw_grid_num.x)
    ry = (dy * @draw_grid_num.y)...((dy + 1) * @draw_grid_num.y)
    mw = $game_map.width - 1
    mh = $game_map.height - 1

    # 探索範囲内の通行テーブルを生成
    rx.each do |x|
      next unless x.between?(0, mw)
      ry.each do |y|
        next unless y.between?(0, mh)

        # 通行方向フラグ作成
        # (↓、←、→、↑ の順に 1, 2, 4, 8 が対応)
        flag = 0
        [2, 4, 6, 8].each do |d|
          flag |= 1 << (d / 2 - 1) if $game_map.passable?(x, y, d)
        end
        @passage_table[x, y] = flag
      end
    end
    @passage_scan_table[dx, dy] = 1
  end
#--------------------------------------------------------------------------
# ○ 周辺の通行可否テーブル更新
#--------------------------------------------------------------------------
  def update_around_passage_table
    gx = @draw_grid_num.x
    gy = @draw_grid_num.y
    dx = $game_player.x - gx / 2
    dy = $game_player.y - gy / 2
    scan_passage(dx, dy)
    scan_passage(dx + gx, dy)
    scan_passage(dx, dy + gy)
    scan_passage(dx + gx, dy + gy)
  end
#--------------------------------------------------------------------------
# ○ オブジェクト一覧更新
#--------------------------------------------------------------------------
  def update_object_list
    events = $game_map.events.values

    # WALL
    @wall_events = events.find_all { |e| e.is_minimap_wall_event? }

    # MOVE
    @move_events = events.find_all { |e| e.is_minimap_move_event? }

    # OBJ
    @object_list = events.find_all { |e| e.is_minimap_object? }
  end
#--------------------------------------------------------------------------
# ○ 位置更新
#--------------------------------------------------------------------------
  def update_position
    # 移動量算出
    pt = Point.new($game_player.x, $game_player.y)
    ox = ($game_player.real_x - pt.x) * @grid_size
    oy = ($game_player.real_y - pt.y) * @grid_size

    @viewport.ox = ox
    @viewport.oy = oy

    # 移動していたらマップ再描画
    if pt.x != @last_x || pt.y != @last_y
      draw_map
      @last_x = pt.x
      @last_y = pt.y
    end
  end
#--------------------------------------------------------------------------
# ○ 描画範囲内判定
#--------------------------------------------------------------------------
  def in_draw_range?(x, y)
    rb = @draw_range_begin
    re = @draw_range_end
    return (x.between?(rb.x, re.x) && y.between?(rb.y, re.y))
  end
#--------------------------------------------------------------------------
# ○ マップ範囲内判定
#--------------------------------------------------------------------------
  def in_map_range?(x, y)
    mw = $game_map.width
    mh = $game_map.height
    return (x.between?(0, mw - 1) && y.between?(0, mh - 1))
  end
#--------------------------------------------------------------------------
# ○ マップ描画
#--------------------------------------------------------------------------
  def draw_map
    update_around_passage_table

    bitmap = @map_sprite.bitmap
    bitmap.fill_rect(bitmap.rect, KMS_MiniMap::BACKGROUND_COLOR)

    draw_map_foreground(bitmap)
    draw_map_move_event(bitmap)
  end
#--------------------------------------------------------------------------
# ○ 通行可能領域の描画
#--------------------------------------------------------------------------
  def draw_map_foreground(bitmap)
    range_x = (@draw_range_begin.x)..(@draw_range_end.x)
    range_y = (@draw_range_begin.y)..(@draw_range_end.y)
    map_w = $game_map.width - 1
    map_h = $game_map.height - 1
    rect = Rect.new(0, 0, @grid_size, @grid_size)

    range_x.each do |x|
      next unless x.between?(0, map_w)
      range_y.each do |y|
        next unless y.between?(0, map_h)
        next if @passage_table[x, y] == 0
        next if @wall_events.find { |e| e.x == x && e.y == y } # 壁

        # グリッド描画サイズ算出
        rect.set(0, 0, @grid_size, @grid_size)
        rect.x = (x - @draw_range_begin.x) * @grid_size
        rect.y = (y - @draw_range_begin.y) * @grid_size
        flag = @passage_table[x, y]
        if flag & 0x01 == 0 # 下通行不能
          rect.height -= 1
        end
        if flag & 0x02 == 0 # 左通行不能
          rect.x += 1
          rect.width -= 1
        end
        if flag & 0x04 == 0 # 右通行不能
          rect.width -= 1
        end
        if flag & 0x08 == 0 # 上通行不能
          rect.y += 1
          rect.height -= 1
        end
        bitmap.fill_rect(rect, KMS_MiniMap::FOREGROUND_COLOR)
      end
    end
  end
#--------------------------------------------------------------------------
# ○ 移動イベントの描画
#--------------------------------------------------------------------------
  def draw_map_move_event(bitmap)
    rect = Rect.new(0, 0, @grid_size, @grid_size)
    @move_events.each do |e|
      rect.x = (e.x - @draw_range_begin.x) * @grid_size
      rect.y = (e.y - @draw_range_begin.y) * @grid_size
      bitmap.fill_rect(rect, KMS_MiniMap::MOVE_EVENT_COLOR)
    end
  end
#--------------------------------------------------------------------------
# ○ アニメーション更新
#--------------------------------------------------------------------------
  def update_animation
    if @showing
      # フェードイン
      self.opacity += 16
      if opacity == 255
        @showing = false
      end
    elsif @hiding
      # フェードアウト
      self.opacity -= 16
      if opacity == 0
        @hiding = false
      end
    end
  end
#--------------------------------------------------------------------------
# ○ オブジェクト描画
#--------------------------------------------------------------------------
  def draw_object
    # 下準備
    bitmap = @object_sprite.bitmap
    bitmap.clear
    rect = Rect.new(0, 0, @grid_size, @grid_size)

    # オブジェクト描画
    @object_list.each do |obj|
      next unless in_draw_range?(obj.x, obj.y)

      color = KMS_MiniMap::oBJECT_COLOR[obj.minimap_object_type - 1]
      next if color.nil?

      rect.x = (obj.real_x - @draw_range_begin.x) * @grid_size
      rect.y = (obj.real_y - @draw_range_begin.y) * @grid_size
      bitmap.fill_rect(rect, color)
    end

    # 乗り物描画
    $game_map.vehicles.each do |vehicle|
      next if vehicle.transparent

      rect.x = (vehicle.real_x - @draw_range_begin.x) * @grid_size
      rect.y = (vehicle.real_y - @draw_range_begin.y) * @grid_size
      bitmap.fill_rect(rect, KMS_MiniMap::VEHICLE_COLOR)
    end
  end
#--------------------------------------------------------------------------
# ○ 更新
#--------------------------------------------------------------------------
  def update
    update_input

    return unless need_update?

    update_draw_range
    update_position
    update_animation
    draw_object

    @map_sprite.update
    @object_sprite.update
    @position_sprite.update
  end
#--------------------------------------------------------------------------
# ○ 更新判定
#--------------------------------------------------------------------------
  def need_update?
    return (visible && opacity > 0) || @showing || @hiding
  end
end

#==============================================================================
# □ Sprite_MiniMapIcon
#------------------------------------------------------------------------------
# ミニマップ用アイコンのクラスです。
#==============================================================================

class Sprite_MiniMapIcon < Sprite
  DURATION_MAX = 60
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# viewport : ビューポート
#--------------------------------------------------------------------------
  def initialize(viewport = nil)
    super(viewport)
    @duration = DURATION_MAX / 2
  end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
  def update
    super
    @duration += 1
    if @duration == DURATION_MAX
      @duration = 0
    end
    update_effect
  end
#--------------------------------------------------------------------------
# ○ エフェクトの更新
  #--------------------------------------------------------------------------
  def update_effect
    self.color.set(255, 255, 255,
      (@duration - DURATION_MAX / 2).abs * KMS_MiniMap::BLINK_LEVEL
    )
  end
end

#==============================================================================
# ■ Spriteset_Map
#==============================================================================

class Spriteset_Map
  attr_reader :minimap
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
  alias initialize_KMS_MiniMap initialize
  def initialize
    initialize_KMS_MiniMap

    create_minimap
  end
#--------------------------------------------------------------------------
# ○ ミニマップの作成
#--------------------------------------------------------------------------
  def create_minimap
    @minimap = Game_MiniMap.new(@tilemap)
    @minimap.visible = $game_system.minimap_show && $game_map.minimap_show?
  end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
  alias dispose_KMS_MiniMap dispose
  def dispose
    dispose_KMS_MiniMap

    dispose_minimap
  end
#--------------------------------------------------------------------------
# ○ ミニマップの解放
  #--------------------------------------------------------------------------
  def dispose_minimap
    @minimap.dispose
    @minimap = nil
  end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
  alias update_KMS_MiniMap update
  def update
    update_KMS_MiniMap

    update_minimap
  end
#--------------------------------------------------------------------------
# ○ ミニマップ更新
#--------------------------------------------------------------------------
  def minimap_show?
    return $game_map.minimap_show? && $game_system.minimap_show
  end
#--------------------------------------------------------------------------
# ○ ミニマップ更新
#--------------------------------------------------------------------------
  def update_minimap
    return if @minimap.nil?

    # 表示切替
    if minimap_show?
      @minimap.visible = true
    else
      @minimap.visible = false
      return
    end

    # フェード判定
    case $game_map.minimap_fade
    when Game_Map::MINIMAP_FADE_IN
      @minimap.fadein
      $game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
    when Game_Map::MINIMAP_FADE_OUT
      @minimap.fadeout
      $game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
    end

    @minimap.update
  end
#--------------------------------------------------------------------------
# ○ ミニマップ全体をリフレッシュ
#--------------------------------------------------------------------------
  def refresh_minimap
    return if @minimap.nil?

    @minimap.clear_passage_table_cache
    @minimap.refresh
  end
#--------------------------------------------------------------------------
# ○ ミニマップのオブジェクトを更新
#--------------------------------------------------------------------------
  def update_minimap_object
    @minimap.update_object_list unless @minimap.nil?
  end
end

#==============================================================================
# ■ Scene_Map
#==============================================================================

class Scene_Map
#--------------------------------------------------------------------------
# ● 場所移動後の処理
#--------------------------------------------------------------------------
  alias post_transfer_KMS_MiniMap post_transfer
  def post_transfer
    refresh_minimap

    post_transfer_KMS_MiniMap
  end
#--------------------------------------------------------------------------
# ○ ミニマップ全体をリフレッシュ
#--------------------------------------------------------------------------
  def refresh_minimap
    @spriteset.refresh_minimap unless @spriteset.nil?
  end
#--------------------------------------------------------------------------
# ○ ミニマップのオブジェクトを更新
#--------------------------------------------------------------------------
  def update_minimap_object
    @spriteset.update_minimap_object unless @spriteset.nil?
  end
end
Since it looks like Kyonides simply provided the original script without the changes Palatkorn did...

Here is my copy of the file with the changes made and a new adjustment that removes the minimap as requested. (thanks for this by the way, I never realized the map never went away. This will help my game as well)

Spoiler: KMS Minimap dispose fix
Ruby:
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/    ◆ Minimap - KMS_MiniMap ◆ VXAce ◆
#_/    ◇ Last update : 2012/02/12  (TOMY@Kamesoft) ◇
#_/    ◇ Website: http://ytomy.sakura.ne.jp/ ◇
#_/    ◇ Translated by Mr. Bubble ◇
#_/----------------------------------------------------------------------------
#_/ Createts a minimap HUD based off the passability settings of the map.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
# This script is plug-and-play, but various customization options are available.
#----------------------------------------------------------------------------
#   Map Notetags
#----------------------------------------------------------------------------
# Notetags are added to "Notes" boxes. Right-click a map and select
# Map Properties to find the "Notes" box for maps.
#
# <minimap hide>
#   Completely disables the minimap on a specific map. [NOMAP] can also be
#   added to the beginning of map names for the same effect.
#----------------------------------------------------------------------------
#   Event Comment Tags
#----------------------------------------------------------------------------
# Since events do not have noteboxes, comment tags are used instead. Open the
# event, create a new event command, go to Tab 1, and click the "Comment..."
# event command. A box will open up allowing you to enter tags.
#
# <minimap wall>
#   Add this tag to an event's comment to change its minimap color to the
#   same as an impassable tile.
#
# <minimap move>
#   Add this tag to an event's comment to have them blink in the minimap.
#
# <minimap obj n>
#   Add this tag to an event's comment to have them blink in the minimap with
#   a specified color where n is the OBJ value defined in OBJECT_COLOR which
#   is found in the customization module below.
#----------------------------------------------------------------------------
#   Script Calls
#----------------------------------------------------------------------------
# Script calls are used in "Script..." event commands located under Tab 3.
#
# hide_minimap
#   Use this script call to hide the minimap on command.
#
# show_minimap
#   Use this script call to show the minimap on command.
#
# refresh_minimap
#   Use this script call to refresh the minimap.
#
# update_minimap_object
#   Use this script call to refresh objects on the minimap such as events.
#----------------------------------------------------------------------------
#   Script Calls : Conditional Branches
#----------------------------------------------------------------------------
# The following script calls can be used in Conditional Branches.
#
# minimap_showing?
#   Determines if the minimap is currently showing/hidden.
#----------------------------------------------------------------------------
#   Usage Notes
#----------------------------------------------------------------------------
# Impassable events will not appear as the correct color in the minimap.
# This effect is intended. If you want an event to appear as impassable
# on the minimap, add the tag <minimap wall> to an event's comment.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#==============================================================================
# ★ BEGIN Setting ★
#==============================================================================
module KMS_MiniMap
  # * Minimap Display Toggle Button
  # Set to nil to disable this function
  SWITCH_BUTTON = :Z

  # * Minimap Size and Position (x, y, width, height)
  MAP_RECT = Rect.new(364, 20, 160, 120)
  # * Minimap z-layer Priority
  # Glitchy if this value is set too high
  MAP_Z = 0
  # * Minimap Grid Size
  #   A size of 3 or higher is recommended
  GRID_SIZE = 5

  # * Mini-Map Color Settings
  #                  Color.new(red, green, blue, opacity)
  FOREGROUND_COLOR = Color.new(224, 224, 255, 160)  # Foreground (passable)
  BACKGROUND_COLOR = Color.new(  0,   0, 160, 160)  # Background (not passable)
  POSITION_COLOR   = Color.new(255,   0,   0, 192)  # Current Position color
  MOVE_EVENT_COLOR = Color.new(255, 160,   0, 192)  # Moving event color
  VEHICLE_COLOR    = Color.new( 96, 128,   0, 192)  # Vehicle color

  # * Object Color Presets
  #   Create custom color presets for events tagged with the
  #   corresponding OBJ tag
  OBJECT_COLOR = [
  # Color.new(red, green, blue, opacity)
    Color.new(  0, 128,   0, 192),  # OBJ 1
    Color.new(  0, 160, 160, 192),  # OBJ 2
    Color.new(160,   0, 160, 192),  # OBJ 3
 
    # More color presets may be added in this array where OBJ number is
    # determined by the position in the list (OBJ 4, OBJ 5, etc.)
 
  ]  # <- Do not delete this line

  # * Minimap Blinking Frequency
  # Values 5~8 are recommended
  BLINK_LEVEL = 7

  # * Minimap Cache Setting
  #   This script creates a cache for each map. If the number of cached
  #   maps exceed CACHE_NUM, oldest cached maps are deleted.
  CACHE_NUM = 10
 
  # * show the minimap without fading in or out
  SNAP_FADE = true
end
#==============================================================================
# ☆ END Setting ☆
#==============================================================================

$kms_imported = {} if $kms_imported == nil
$kms_imported["MiniMap"] = true

module KMS_MiniMap
  # ミニマップ非表示
  REGEX_NO_MINIMAP_NOTE = /<(?:ミニマップ|MINIMAP)\s*(?:非表示|HIDE)>/i
  REGEX_NO_MINIMAP_NAME = /\[NOMAP\]/i

  # 障害物
  REGEX_WALL_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:壁|障害物|WALL)>/i

  # 移動イベント
  REGEX_MOVE_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:移動|MOVE)>/i

  # オブジェクト
  REGEX_OBJECT = /<(?:ミニマップ|MINIMAP)\s+OBJ(?:ECT)?\s*(\d+)>/i
end

# *****************************************************************************

#==============================================================================
# □ KMS_Commands
#==============================================================================

module KMS_Commands
  module_function
  #--------------------------------------------------------------------------
  # ○ ミニマップを表示
  #--------------------------------------------------------------------------
  def show_minimap
    $game_temp.minimap_manual_visible = true
    $game_system.minimap_show         = true
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップを隠す
  #--------------------------------------------------------------------------
  def hide_minimap
    $game_system.minimap_show = false
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップ表示状態の取得
  #--------------------------------------------------------------------------
  def minimap_showing?
    return $game_system.minimap_show
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップをリフレッシュ
  #--------------------------------------------------------------------------
  def refresh_minimap
    return unless SceneManager.scene_is?(Scene_Map)

    $game_map.refresh if $game_map.need_refresh
    SceneManager.scene.refresh_minimap
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップのオブジェクトを更新
  #--------------------------------------------------------------------------
  def update_minimap_object
    return unless SceneManager.scene_is?(Scene_Map)

    $game_map.refresh if $game_map.need_refresh
    SceneManager.scene.update_minimap_object
  end
end

#==============================================================================
# ■ Game_Interpreter
#==============================================================================

class Game_Interpreter
  # イベントコマンドから直接コマンドを叩けるようにする
  include KMS_Commands
end

#==============================================================================
# ■ RPG::Map
#==============================================================================

class RPG::Map
  #--------------------------------------------------------------------------
  # ○ ミニマップのキャッシュ生成
  #--------------------------------------------------------------------------
  def create_minimap_cache
    @__minimap_show = true

    note.each_line { |line|
      if line =~ KMS_MiniMap::REGEX_NO_MINIMAP_NOTE  # マップ非表示
        @__minimap_show = false
      end
    }
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップ表示
  #--------------------------------------------------------------------------
  def minimap_show?
    create_minimap_cache if @__minimap_show.nil?
    return @__minimap_show
  end
end

#==============================================================================
# ■ RPG::MapInfo
#==============================================================================

class RPG::MapInfo
  #--------------------------------------------------------------------------
  # ● マップ名取得
  #--------------------------------------------------------------------------
  def name
    return @name.gsub(/\[.*\]/) { "" }
  end
  #--------------------------------------------------------------------------
  # ○ オリジナルマップ名取得
  #--------------------------------------------------------------------------
  def original_name
    return @name
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップのキャッシュ生成
  #--------------------------------------------------------------------------
  def create_minimap_cache
    @__minimap_show = !(@name =~ KMS_MiniMap::REGEX_NO_MINIMAP_NAME)
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップ表示
  #--------------------------------------------------------------------------
  def minimap_show?
    create_minimap_cache if @__minimap_show == nil
    return @__minimap_show
  end
end

#==============================================================================
# ■ Game_Temp
#==============================================================================

class Game_Temp
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :minimap_manual_visible  # ミニマップ手動表示切り替えフラグ
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  alias initialize_KMS_MiniMap initialize
  def initialize
    initialize_KMS_MiniMap

    @minimap_manual_visible = true
  end
end

#==============================================================================
# ■ Game_System
#==============================================================================

class Game_System
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :minimap_show  # ミニマップ表示フラグ
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  alias initialize_KMS_MiniMap initialize
  def initialize
    initialize_KMS_MiniMap

    @minimap_show = true
  end
end

#==============================================================================
# ■ Game_Map
#==============================================================================

class Game_Map
  #--------------------------------------------------------------------------
  # ○ 定数
  #--------------------------------------------------------------------------
  MINIMAP_FADE_NONE = 0  # ミニマップ フェードなし
  MINIMAP_FADE_IN   = 1  # ミニマップ フェードイン
  MINIMAP_FADE_OUT  = 2  # ミニマップ フェードアウト
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :minimap_fade
  #--------------------------------------------------------------------------
  # ○ ミニマップを表示するか
  #--------------------------------------------------------------------------
  def minimap_show?
    return $data_mapinfos[map_id].minimap_show? && @map.minimap_show?
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップをフェードイン
  #--------------------------------------------------------------------------
  def fadein_minimap
    @minimap_fade = MINIMAP_FADE_IN
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップをフェードアウト
  #--------------------------------------------------------------------------
  def fadeout_minimap
    @minimap_fade = MINIMAP_FADE_OUT
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  alias refresh_KMS_MiniMap refresh
  def refresh
    refresh_KMS_MiniMap

    SceneManager.scene.refresh_minimap if SceneManager.scene_is?(Scene_Map)
  end
end

#==============================================================================
# ■ Game_Event
#==============================================================================

class Game_Event < Game_Character
  #--------------------------------------------------------------------------
  # ○ ミニマップ用のキャッシュを作成
  #--------------------------------------------------------------------------
  def __create_minimap_cache
    @__last_page = @page
    @__minimap_wall_event  = false
    @__minimap_move_event  = false
    @__minimap_object_type = -1

    return if @page.nil?

    @page.list.each { |cmd|
      # 注釈以外に到達したら離脱
      break unless [108, 408].include?(cmd.code)

      # 正規表現判定
      case cmd.parameters[0]
      when KMS_MiniMap::REGEX_WALL_EVENT
        @__minimap_wall_event = true
      when KMS_MiniMap::REGEX_MOVE_EVENT
        @__minimap_move_event = true
      when KMS_MiniMap::REGEX_OBJECT
        @__minimap_object_type = $1.to_i
      end
    }
  end
  private :__create_minimap_cache
  #--------------------------------------------------------------------------
  # ○ グラフィックがあるか
  #--------------------------------------------------------------------------
  def graphic_exist?
    return (character_name != "" || tile_id > 0)
  end
  #--------------------------------------------------------------------------
  # ○ 障害物か
  #--------------------------------------------------------------------------
  def is_minimap_wall_event?
    if @__minimap_wall_event.nil? || @__last_page != @page
      __create_minimap_cache
    end

    return @__minimap_wall_event
  end
  #--------------------------------------------------------------------------
  # ○ 移動イベントか
  #--------------------------------------------------------------------------
  def is_minimap_move_event?
    if @__minimap_move_event.nil? || @__last_page != @page
      __create_minimap_cache
    end

    return @__minimap_move_event
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップオブジェクトか
  #--------------------------------------------------------------------------
  def is_minimap_object?
    if @__minimap_object_type.nil? || @__last_page != @page
      __create_minimap_cache
    end

    return @__minimap_object_type > 0
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップオブジェクトタイプ
  #--------------------------------------------------------------------------
  def minimap_object_type
    if @__minimap_object_type.nil? || @__last_page != @page
      __create_minimap_cache
    end

    return @__minimap_object_type
  end
end

#==============================================================================
# □ Game_MiniMap
#------------------------------------------------------------------------------
#   ミニマップを扱うクラスです。
#==============================================================================

class Game_MiniMap
  #--------------------------------------------------------------------------
  # ○ 構造体
  #--------------------------------------------------------------------------
  Point = Struct.new(:x, :y)
  Size  = Struct.new(:width, :height)
  PassageCache = Struct.new(:map_id, :table, :scan_table)
  #--------------------------------------------------------------------------
  # ○ クラス変数
  #--------------------------------------------------------------------------
  @@passage_cache = []  # 通行フラグテーブルキャッシュ
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(tilemap)
    @map_rect  = KMS_MiniMap::MAP_RECT
    @grid_size = [KMS_MiniMap::GRID_SIZE, 1].max

    @x = 0
    @y = 0
    @grid_num = Point.new(
      (@map_rect.width  + @grid_size - 1) / @grid_size,
      (@map_rect.height + @grid_size - 1) / @grid_size
    )
    @draw_grid_num    = Point.new(@grid_num.x + 2, @grid_num.y + 2)
    @draw_range_begin = Point.new(0, 0)
    @draw_range_end   = Point.new(0, 0)
    @tilemap = tilemap

    @last_x = $game_player.x
    @last_y = $game_player.y

    @showing = false
    @hiding  = false

    create_sprites
    refresh

    unless $game_temp.minimap_manual_visible
      self.opacity = 0
    end
  end
  #--------------------------------------------------------------------------
  # ○ スプライト作成
  #--------------------------------------------------------------------------
  def create_sprites
    @viewport   = Viewport.new(@map_rect)
    @viewport.z = KMS_MiniMap::MAP_Z

    # ビットマップサイズ計算
    @bmp_size = Size.new(
      (@grid_num.x + 2) * @grid_size,
      (@grid_num.y + 2) * @grid_size
    )
    @buf_bitmap = Bitmap.new(@bmp_size.width, @bmp_size.height)

    # マップ用スプライト作成
    @map_sprite   = Sprite.new(@viewport)
    @map_sprite.x = -@grid_size
    @map_sprite.y = -@grid_size
    @map_sprite.z = 0
    @map_sprite.bitmap = Bitmap.new(@bmp_size.width, @bmp_size.height)

    # オブジェクト用スプライト作成
    @object_sprite   = Sprite_MiniMapIcon.new(@viewport)
    @object_sprite.x = -@grid_size
    @object_sprite.y = -@grid_size
    @object_sprite.z = 1
    @object_sprite.bitmap = Bitmap.new(@bmp_size.width, @bmp_size.height)

    # 現在位置スプライト作成
    @position_sprite   = Sprite_MiniMapIcon.new
    @position_sprite.x = @map_rect.x + @grid_num.x / 2 * @grid_size
    @position_sprite.y = @map_rect.y + @grid_num.y / 2 * @grid_size
    @position_sprite.z = @viewport.z + 2
    bitmap = Bitmap.new(@grid_size, @grid_size)
    bitmap.fill_rect(bitmap.rect, KMS_MiniMap::POSITION_COLOR)
    @position_sprite.bitmap = bitmap
  end
  #--------------------------------------------------------------------------
  # ● 解放
  #--------------------------------------------------------------------------
  def dispose
    @buf_bitmap.dispose
    @map_sprite.bitmap.dispose
    @map_sprite.dispose
    @object_sprite.bitmap.dispose
    @object_sprite.dispose
    @position_sprite.bitmap.dispose
    @position_sprite.dispose
    @viewport.dispose
  end
  #--------------------------------------------------------------------------
  # ○ 可視状態取得
  #--------------------------------------------------------------------------
  def visible
    return @map_sprite.visible
  end
  #--------------------------------------------------------------------------
  # ○ 可視状態設定
  #--------------------------------------------------------------------------
  def visible=(value)
    @viewport.visible        = value
    @map_sprite.visible      = value
    @object_sprite.visible   = value
    @position_sprite.visible = value
  end
  #--------------------------------------------------------------------------
  # ○ 不透明度取得
  #--------------------------------------------------------------------------
  def opacity
    return @map_sprite.opacity
  end
  #--------------------------------------------------------------------------
  # ○ 不透明度設定
  #--------------------------------------------------------------------------
  def opacity=(value)
    @map_sprite.opacity      = value
    @object_sprite.opacity   = value
    @position_sprite.opacity = value
  end
  #--------------------------------------------------------------------------
  # ○ リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    update_draw_range
    update_passage_table
    update_object_list
    update_position
    draw_map
    draw_object
    Graphics.frame_reset
  end
  #--------------------------------------------------------------------------
  # ○ フェードイン
  #--------------------------------------------------------------------------
  def fadein
    @showing = true
    @hiding  = false
    self.opacity = 255 if KMS_MiniMap::SNAP_FADE == true
  end
  #--------------------------------------------------------------------------
  # ○ フェードアウト
  #--------------------------------------------------------------------------
  def fadeout
    @showing = false
    @hiding  = true
    self.opacity = 0 if KMS_MiniMap::SNAP_FADE == true
  end
  #--------------------------------------------------------------------------
  # ○ 描画範囲更新
  #--------------------------------------------------------------------------
  def update_draw_range
    range = []
    (2).times { |i| range[i] = @draw_grid_num[i] / 2 }

    @draw_range_begin.x = $game_player.x - range[0]
    @draw_range_begin.y = $game_player.y - range[1]
    @draw_range_end.x   = $game_player.x + range[0]
    @draw_range_end.y   = $game_player.y + range[1]
  end
  #--------------------------------------------------------------------------
  # ○ 通行可否テーブル更新
  #--------------------------------------------------------------------------
  def update_passage_table
    cache = get_passage_table_cache
    @passage_table      = cache.table
    @passage_scan_table = cache.scan_table

    update_around_passage_table
  end
  #--------------------------------------------------------------------------
  # ○ 通行可否テーブルのキャッシュを取得
  #--------------------------------------------------------------------------
  def get_passage_table_cache
    map_id = $game_map.map_id
    cache  = @@passage_cache.find { |c| c.map_id == map_id }

    # キャッシュミスしたら新規作成
    if cache == nil
      cache = PassageCache.new(map_id)
      cache.table      = Table.new($game_map.width, $game_map.height)
      cache.scan_table = Table.new(
        ($game_map.width  + @draw_grid_num.x - 1) / @draw_grid_num.x,
        ($game_map.height + @draw_grid_num.y - 1) / @draw_grid_num.y
      )
    end

    # 直近のキャッシュは先頭に移動し、古いキャッシュは削除
    @@passage_cache.unshift(cache)
    @@passage_cache.delete_at(KMS_MiniMap::CACHE_NUM)

    return cache
  end
  #--------------------------------------------------------------------------
  # ○ 通行可否テーブルのキャッシュをクリア
  #--------------------------------------------------------------------------
  def clear_passage_table_cache
    return if @passage_scan_table == nil

    table = @passage_scan_table
    @passage_scan_table = Table.new(table.xsize, table.ysize)
  end
  #--------------------------------------------------------------------------
  # ○ 通行可否テーブルの探索
  #     x, y : 探索位置
  #--------------------------------------------------------------------------
  def scan_passage(x, y)
    dx = x / @draw_grid_num.x
    dy = y / @draw_grid_num.y

    # 探索済み
    return if @passage_scan_table[dx, dy] == 1

    # マップ範囲外
    return unless dx.between?(0, @passage_scan_table.xsize - 1)
    return unless dy.between?(0, @passage_scan_table.ysize - 1)

    rx = (dx * @draw_grid_num.x)...((dx + 1) * @draw_grid_num.x)
    ry = (dy * @draw_grid_num.y)...((dy + 1) * @draw_grid_num.y)
    mw = $game_map.width  - 1
    mh = $game_map.height - 1

    # 探索範囲内の通行テーブルを生成
    rx.each { |x|
      next unless x.between?(0, mw)
      ry.each { |y|
        next unless y.between?(0, mh)

        # 通行方向フラグ作成
        # (↓、←、→、↑ の順に 1, 2, 4, 8 が対応)
        flag = 0
        [2, 4, 6, 8].each{ |d|
          flag |= 1 << (d / 2 - 1) if $game_map.passable?(x, y, d)
        }
        @passage_table[x, y] = flag
      }
    }
    @passage_scan_table[dx, dy] = 1
  end
  #--------------------------------------------------------------------------
  # ○ 周辺の通行可否テーブル更新
  #--------------------------------------------------------------------------
  def update_around_passage_table
    gx = @draw_grid_num.x
    gy = @draw_grid_num.y
    dx = $game_player.x - gx / 2
    dy = $game_player.y - gy / 2
    scan_passage(dx,      dy)
    scan_passage(dx + gx, dy)
    scan_passage(dx,      dy + gy)
    scan_passage(dx + gx, dy + gy)
  end
  #--------------------------------------------------------------------------
  # ○ オブジェクト一覧更新
  #--------------------------------------------------------------------------
  def update_object_list
    events = $game_map.events.values

    # WALL
    @wall_events = events.find_all { |e| e.is_minimap_wall_event? }

    # MOVE
    @move_events = events.find_all { |e| e.is_minimap_move_event? }

    # OBJ
    @object_list = events.find_all { |e| e.is_minimap_object? }
  end
  #--------------------------------------------------------------------------
  # ○ 位置更新
  #--------------------------------------------------------------------------
  def update_position
    # 移動量算出
    pt = Point.new($game_player.x, $game_player.y)
    ox = ($game_player.real_x - pt.x) * @grid_size
    oy = ($game_player.real_y - pt.y) * @grid_size

    @viewport.ox = ox
    @viewport.oy = oy

    # 移動していたらマップ再描画
    if pt.x != @last_x || pt.y != @last_y
      draw_map
      @last_x = pt.x
      @last_y = pt.y
    end
  end
  #--------------------------------------------------------------------------
  # ○ 描画範囲内判定
  #--------------------------------------------------------------------------
  def in_draw_range?(x, y)
    rb = @draw_range_begin
    re = @draw_range_end
    return (x.between?(rb.x, re.x) && y.between?(rb.y, re.y))
  end
  #--------------------------------------------------------------------------
  # ○ マップ範囲内判定
  #--------------------------------------------------------------------------
  def in_map_range?(x, y)
    mw = $game_map.width
    mh = $game_map.height
    return (x.between?(0, mw - 1) && y.between?(0, mh - 1))
  end
  #--------------------------------------------------------------------------
  # ○ マップ描画
  #--------------------------------------------------------------------------
  def draw_map
    update_around_passage_table

    bitmap  = @map_sprite.bitmap
    bitmap.fill_rect(bitmap.rect, KMS_MiniMap::BACKGROUND_COLOR)

    draw_map_foreground(bitmap)
    draw_map_move_event(bitmap)
  end
  #--------------------------------------------------------------------------
  # ○ 通行可能領域の描画
  #--------------------------------------------------------------------------
  def draw_map_foreground(bitmap)
    range_x = (@draw_range_begin.x)..(@draw_range_end.x)
    range_y = (@draw_range_begin.y)..(@draw_range_end.y)
    map_w   = $game_map.width  - 1
    map_h   = $game_map.height - 1
    rect    = Rect.new(0, 0, @grid_size, @grid_size)

    range_x.each { |x|
      next unless x.between?(0, map_w)
      range_y.each { |y|
        next unless y.between?(0, map_h)
        next if @passage_table[x, y] == 0
        next if @wall_events.find { |e| e.x == x && e.y == y }  # 壁

        # グリッド描画サイズ算出
        rect.set(0, 0, @grid_size, @grid_size)
        rect.x = (x - @draw_range_begin.x) * @grid_size
        rect.y = (y - @draw_range_begin.y) * @grid_size
        flag = @passage_table[x, y]
        if flag & 0x01 == 0  # 下通行不能
          rect.height -= 1
        end
        if flag & 0x02 == 0  # 左通行不能
          rect.x     += 1
          rect.width -= 1
        end
        if flag & 0x04 == 0  # 右通行不能
          rect.width -= 1
        end
        if flag & 0x08 == 0  # 上通行不能
          rect.y      += 1
          rect.height -= 1
        end
        bitmap.fill_rect(rect, KMS_MiniMap::FOREGROUND_COLOR)
      }
    }
  end
  #--------------------------------------------------------------------------
  # ○ 移動イベントの描画
  #--------------------------------------------------------------------------
  def draw_map_move_event(bitmap)
    rect = Rect.new(0, 0, @grid_size, @grid_size)
    @move_events.each { |e|
      rect.x = (e.x - @draw_range_begin.x) * @grid_size
      rect.y = (e.y - @draw_range_begin.y) * @grid_size
      bitmap.fill_rect(rect, KMS_MiniMap::MOVE_EVENT_COLOR)
    }
  end
  #--------------------------------------------------------------------------
  # ○ アニメーション更新
  #--------------------------------------------------------------------------
  def update_animation
    if @showing
      # フェードイン
      self.opacity += 16
      if opacity == 255
        @showing = false
      end
    elsif @hiding
      # フェードアウト
      self.opacity -= 16
      if opacity == 0
        @hiding = false
      end
    end
  end
  #--------------------------------------------------------------------------
  # ○ オブジェクト描画
  #--------------------------------------------------------------------------
  def draw_object
    # 下準備
    bitmap = @object_sprite.bitmap
    bitmap.clear
    rect = Rect.new(0, 0, @grid_size, @grid_size)

    # オブジェクト描画
    @object_list.each { |obj|
      next unless in_draw_range?(obj.x, obj.y)

      color = KMS_MiniMap::OBJECT_COLOR[obj.minimap_object_type - 1]
      next if color.nil?

      rect.x = (obj.real_x - @draw_range_begin.x) * @grid_size
      rect.y = (obj.real_y - @draw_range_begin.y) * @grid_size
      bitmap.fill_rect(rect, color)
    }

    # 乗り物描画
    $game_map.vehicles.each { |vehicle|
      next if vehicle.transparent

      rect.x = (vehicle.real_x - @draw_range_begin.x) * @grid_size
      rect.y = (vehicle.real_y - @draw_range_begin.y) * @grid_size
      bitmap.fill_rect(rect, KMS_MiniMap::VEHICLE_COLOR)
    }
  end
  #--------------------------------------------------------------------------
  # ○ 更新
  #--------------------------------------------------------------------------
  def update
    return unless need_update?

    update_draw_range
    update_position
    update_animation
    draw_object

    @map_sprite.update
    @object_sprite.update
    @position_sprite.update
  end
  #--------------------------------------------------------------------------
  # ○ 更新判定
  #--------------------------------------------------------------------------
  def need_update?
    return (visible && opacity > 0) || @showing || @hiding
  end
end

#==============================================================================
# □ Sprite_MiniMapIcon
#------------------------------------------------------------------------------
#   ミニマップ用アイコンのクラスです。
#==============================================================================

class Sprite_MiniMapIcon < Sprite
  DURATION_MAX = 60
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     viewport : ビューポート
  #--------------------------------------------------------------------------
  def initialize(viewport = nil)
    super(viewport)
    @duration = DURATION_MAX / 2
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    super
    @duration += 1
    if @duration == DURATION_MAX
      @duration = 0
    end
    update_effect
  end
  #--------------------------------------------------------------------------
  # ○ エフェクトの更新
  #--------------------------------------------------------------------------
  def update_effect
    self.color.set(255, 255, 255,
      (@duration - DURATION_MAX / 2).abs * KMS_MiniMap::BLINK_LEVEL
    )
  end
end

#==============================================================================
# ■ Spriteset_Map
#==============================================================================

class Spriteset_Map
  attr_reader :minimap
  #--------------------------------------------------------------------------
  # ○ ミニマップの作成
  #--------------------------------------------------------------------------
  def create_minimap
    @minimap = Game_MiniMap.new(@tilemap)
    @minimap.visible = $game_system.minimap_show && $game_map.minimap_show?
  end
  #--------------------------------------------------------------------------
  # ● 解放
  #--------------------------------------------------------------------------
  alias dispose_KMS_MiniMap dispose
  def dispose
    dispose_KMS_MiniMap

    dispose_minimap
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップの解放
  #--------------------------------------------------------------------------
  def dispose_minimap
    @minimap.dispose [I][I]if [email protected]?[/I][/I]
    @minimap = nil
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias update_KMS_MiniMap update
  def update
    update_KMS_MiniMap

    update_minimap
    dispose_minimap if $game_system.minimap_show == false && $game_map.minimap_show? && [email protected]?
    create_minimap if $game_system.minimap_show == true && $game_map.minimap_show? && @minimap.nil?
    return if KMS_MiniMap::SWITCH_BUTTON.nil?
    if Input.trigger?(KMS_MiniMap::SWITCH_BUTTON)
      if $game_system.minimap_show == false && $game_map.minimap_show? && @minimap.nil?
        $game_system.minimap_show = true
        create_minimap
      elsif $game_system.minimap_show == true && $game_map.minimap_show? && [email protected]?
        $game_system.minimap_show = false
        dispose_minimap
      end
    end
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップ更新
  #--------------------------------------------------------------------------
  def minimap_show?
    return $game_map.minimap_show? && $game_system.minimap_show
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップ更新
  #--------------------------------------------------------------------------
  def update_minimap
    return if @minimap.nil?

    # 表示切替
    if minimap_show?
      @minimap.visible = true
    else
      @minimap.visible = false
      return
    end

    # フェード判定
    case $game_map.minimap_fade
    when Game_Map::MINIMAP_FADE_IN
      @minimap.fadein
      $game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
    when Game_Map::MINIMAP_FADE_OUT
      @minimap.fadeout
      $game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
    end

    @minimap.update
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップ全体をリフレッシュ
  #--------------------------------------------------------------------------
  def refresh_minimap
    return if @minimap.nil?

    @minimap.clear_passage_table_cache
    @minimap.refresh
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップのオブジェクトを更新
  #--------------------------------------------------------------------------
  def update_minimap_object
    @minimap.update_object_list unless @minimap.nil?
  end
end

#==============================================================================
# ■ Scene_Map
#==============================================================================

class Scene_Map
  #--------------------------------------------------------------------------
  # ● 場所移動後の処理
  #--------------------------------------------------------------------------
  alias post_transfer_KMS_MiniMap post_transfer
  def post_transfer
    refresh_minimap

    post_transfer_KMS_MiniMap
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップ全体をリフレッシュ
  #--------------------------------------------------------------------------
  def refresh_minimap
    @spriteset.refresh_minimap unless @spriteset.nil?
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップのオブジェクトを更新
  #--------------------------------------------------------------------------
  def update_minimap_object
    @spriteset.update_minimap_object unless @spriteset.nil?
  end
end
Since it looks like Kyonides simply provided the original script without the changes Palatkorn did...

Here is my copy of the file with the changes made and a new adjustment that removes the minimap as requested. (thanks for this by the way, I never realized the map never went away. This will help my game as well)

Spoiler: KMS Minimap dispose fix
Ruby:
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/    ◆ Minimap - KMS_MiniMap ◆ VXAce ◆
#_/    ◇ Last update : 2012/02/12  (TOMY@Kamesoft) ◇
#_/    ◇ Website: http://ytomy.sakura.ne.jp/ ◇
#_/    ◇ Translated by Mr. Bubble ◇
#_/----------------------------------------------------------------------------
#_/ Createts a minimap HUD based off the passability settings of the map.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
# This script is plug-and-play, but various customization options are available.
#----------------------------------------------------------------------------
#   Map Notetags
#----------------------------------------------------------------------------
# Notetags are added to "Notes" boxes. Right-click a map and select
# Map Properties to find the "Notes" box for maps.
#
# <minimap hide>
#   Completely disables the minimap on a specific map. [NOMAP] can also be
#   added to the beginning of map names for the same effect.
#----------------------------------------------------------------------------
#   Event Comment Tags
#----------------------------------------------------------------------------
# Since events do not have noteboxes, comment tags are used instead. Open the
# event, create a new event command, go to Tab 1, and click the "Comment..."
# event command. A box will open up allowing you to enter tags.
#
# <minimap wall>
#   Add this tag to an event's comment to change its minimap color to the
#   same as an impassable tile.
#
# <minimap move>
#   Add this tag to an event's comment to have them blink in the minimap.
#
# <minimap obj n>
#   Add this tag to an event's comment to have them blink in the minimap with
#   a specified color where n is the OBJ value defined in OBJECT_COLOR which
#   is found in the customization module below.
#----------------------------------------------------------------------------
#   Script Calls
#----------------------------------------------------------------------------
# Script calls are used in "Script..." event commands located under Tab 3.
#
# hide_minimap
#   Use this script call to hide the minimap on command.
#
# show_minimap
#   Use this script call to show the minimap on command.
#
# refresh_minimap
#   Use this script call to refresh the minimap.
#
# update_minimap_object
#   Use this script call to refresh objects on the minimap such as events.
#----------------------------------------------------------------------------
#   Script Calls : Conditional Branches
#----------------------------------------------------------------------------
# The following script calls can be used in Conditional Branches.
#
# minimap_showing?
#   Determines if the minimap is currently showing/hidden.
#----------------------------------------------------------------------------
#   Usage Notes
#----------------------------------------------------------------------------
# Impassable events will not appear as the correct color in the minimap.
# This effect is intended. If you want an event to appear as impassable
# on the minimap, add the tag <minimap wall> to an event's comment.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#==============================================================================
# ★ BEGIN Setting ★
#==============================================================================
module KMS_MiniMap
  # * Minimap Display Toggle Button
  # Set to nil to disable this function
  SWITCH_BUTTON = :Z

  # * Minimap Size and Position (x, y, width, height)
  MAP_RECT = Rect.new(364, 20, 160, 120)
  # * Minimap z-layer Priority
  # Glitchy if this value is set too high
  MAP_Z = 0
  # * Minimap Grid Size
  #   A size of 3 or higher is recommended
  GRID_SIZE = 5

  # * Mini-Map Color Settings
  #                  Color.new(red, green, blue, opacity)
  FOREGROUND_COLOR = Color.new(224, 224, 255, 160)  # Foreground (passable)
  BACKGROUND_COLOR = Color.new(  0,   0, 160, 160)  # Background (not passable)
  POSITION_COLOR   = Color.new(255,   0,   0, 192)  # Current Position color
  MOVE_EVENT_COLOR = Color.new(255, 160,   0, 192)  # Moving event color
  VEHICLE_COLOR    = Color.new( 96, 128,   0, 192)  # Vehicle color

  # * Object Color Presets
  #   Create custom color presets for events tagged with the
  #   corresponding OBJ tag
  OBJECT_COLOR = [
  # Color.new(red, green, blue, opacity)
    Color.new(  0, 128,   0, 192),  # OBJ 1
    Color.new(  0, 160, 160, 192),  # OBJ 2
    Color.new(160,   0, 160, 192),  # OBJ 3
   
    # More color presets may be added in this array where OBJ number is
    # determined by the position in the list (OBJ 4, OBJ 5, etc.)
 
  ]  # <- Do not delete this line

  # * Minimap Blinking Frequency
  # Values 5~8 are recommended
  BLINK_LEVEL = 7

  # * Minimap Cache Setting
  #   This script creates a cache for each map. If the number of cached
  #   maps exceed CACHE_NUM, oldest cached maps are deleted.
  CACHE_NUM = 10
 
  # * show the minimap without fading in or out
  SNAP_FADE = true
end
#==============================================================================
# ☆ END Setting ☆
#==============================================================================

$kms_imported = {} if $kms_imported == nil
$kms_imported["MiniMap"] = true

module KMS_MiniMap
  # ミニマップ非表示
  REGEX_NO_MINIMAP_NOTE = /<(?:ミニマップ|MINIMAP)\s*(?:非表示|HIDE)>/i
  REGEX_NO_MINIMAP_NAME = /\[NOMAP\]/i

  # 障害物
  REGEX_WALL_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:壁|障害物|WALL)>/i

  # 移動イベント
  REGEX_MOVE_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:移動|MOVE)>/i

  # オブジェクト
  REGEX_OBJECT = /<(?:ミニマップ|MINIMAP)\s+OBJ(?:ECT)?\s*(\d+)>/i
end

# *****************************************************************************

#==============================================================================
# □ KMS_Commands
#==============================================================================

module KMS_Commands
  module_function
  #--------------------------------------------------------------------------
  # ○ ミニマップを表示
  #--------------------------------------------------------------------------
  def show_minimap
    $game_temp.minimap_manual_visible = true
    $game_system.minimap_show         = true
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップを隠す
  #--------------------------------------------------------------------------
  def hide_minimap
    $game_system.minimap_show = false
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップ表示状態の取得
  #--------------------------------------------------------------------------
  def minimap_showing?
    return $game_system.minimap_show
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップをリフレッシュ
  #--------------------------------------------------------------------------
  def refresh_minimap
    return unless SceneManager.scene_is?(Scene_Map)

    $game_map.refresh if $game_map.need_refresh
    SceneManager.scene.refresh_minimap
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップのオブジェクトを更新
  #--------------------------------------------------------------------------
  def update_minimap_object
    return unless SceneManager.scene_is?(Scene_Map)

    $game_map.refresh if $game_map.need_refresh
    SceneManager.scene.update_minimap_object
  end
end

#==============================================================================
# ■ Game_Interpreter
#==============================================================================

class Game_Interpreter
  # イベントコマンドから直接コマンドを叩けるようにする
  include KMS_Commands
end

#==============================================================================
# ■ RPG::Map
#==============================================================================

class RPG::Map
  #--------------------------------------------------------------------------
  # ○ ミニマップのキャッシュ生成
  #--------------------------------------------------------------------------
  def create_minimap_cache
    @__minimap_show = true

    note.each_line { |line|
      if line =~ KMS_MiniMap::REGEX_NO_MINIMAP_NOTE  # マップ非表示
        @__minimap_show = false
      end
    }
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップ表示
  #--------------------------------------------------------------------------
  def minimap_show?
    create_minimap_cache if @__minimap_show.nil?
    return @__minimap_show
  end
end

#==============================================================================
# ■ RPG::MapInfo
#==============================================================================

class RPG::MapInfo
  #--------------------------------------------------------------------------
  # ● マップ名取得
  #--------------------------------------------------------------------------
  def name
    return @name.gsub(/\[.*\]/) { "" }
  end
  #--------------------------------------------------------------------------
  # ○ オリジナルマップ名取得
  #--------------------------------------------------------------------------
  def original_name
    return @name
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップのキャッシュ生成
  #--------------------------------------------------------------------------
  def create_minimap_cache
    @__minimap_show = !(@name =~ KMS_MiniMap::REGEX_NO_MINIMAP_NAME)
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップ表示
  #--------------------------------------------------------------------------
  def minimap_show?
    create_minimap_cache if @__minimap_show == nil
    return @__minimap_show
  end
end

#==============================================================================
# ■ Game_Temp
#==============================================================================

class Game_Temp
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :minimap_manual_visible  # ミニマップ手動表示切り替えフラグ
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  alias initialize_KMS_MiniMap initialize
  def initialize
    initialize_KMS_MiniMap

    @minimap_manual_visible = true
  end
end

#==============================================================================
# ■ Game_System
#==============================================================================

class Game_System
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :minimap_show  # ミニマップ表示フラグ
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  alias initialize_KMS_MiniMap initialize
  def initialize
    initialize_KMS_MiniMap

    @minimap_show = true
  end
end

#==============================================================================
# ■ Game_Map
#==============================================================================

class Game_Map
  #--------------------------------------------------------------------------
  # ○ 定数
  #--------------------------------------------------------------------------
  MINIMAP_FADE_NONE = 0  # ミニマップ フェードなし
  MINIMAP_FADE_IN   = 1  # ミニマップ フェードイン
  MINIMAP_FADE_OUT  = 2  # ミニマップ フェードアウト
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :minimap_fade
  #--------------------------------------------------------------------------
  # ○ ミニマップを表示するか
  #--------------------------------------------------------------------------
  def minimap_show?
    return $data_mapinfos[map_id].minimap_show? && @map.minimap_show?
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップをフェードイン
  #--------------------------------------------------------------------------
  def fadein_minimap
    @minimap_fade = MINIMAP_FADE_IN
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップをフェードアウト
  #--------------------------------------------------------------------------
  def fadeout_minimap
    @minimap_fade = MINIMAP_FADE_OUT
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  alias refresh_KMS_MiniMap refresh
  def refresh
    refresh_KMS_MiniMap

    SceneManager.scene.refresh_minimap if SceneManager.scene_is?(Scene_Map)
  end
end

#==============================================================================
# ■ Game_Event
#==============================================================================

class Game_Event < Game_Character
  #--------------------------------------------------------------------------
  # ○ ミニマップ用のキャッシュを作成
  #--------------------------------------------------------------------------
  def __create_minimap_cache
    @__last_page = @page
    @__minimap_wall_event  = false
    @__minimap_move_event  = false
    @__minimap_object_type = -1

    return if @page.nil?

    @page.list.each { |cmd|
      # 注釈以外に到達したら離脱
      break unless [108, 408].include?(cmd.code)

      # 正規表現判定
      case cmd.parameters[0]
      when KMS_MiniMap::REGEX_WALL_EVENT
        @__minimap_wall_event = true
      when KMS_MiniMap::REGEX_MOVE_EVENT
        @__minimap_move_event = true
      when KMS_MiniMap::REGEX_OBJECT
        @__minimap_object_type = $1.to_i
      end
    }
  end
  private :__create_minimap_cache
  #--------------------------------------------------------------------------
  # ○ グラフィックがあるか
  #--------------------------------------------------------------------------
  def graphic_exist?
    return (character_name != "" || tile_id > 0)
  end
  #--------------------------------------------------------------------------
  # ○ 障害物か
  #--------------------------------------------------------------------------
  def is_minimap_wall_event?
    if @__minimap_wall_event.nil? || @__last_page != @page
      __create_minimap_cache
    end

    return @__minimap_wall_event
  end
  #--------------------------------------------------------------------------
  # ○ 移動イベントか
  #--------------------------------------------------------------------------
  def is_minimap_move_event?
    if @__minimap_move_event.nil? || @__last_page != @page
      __create_minimap_cache
    end

    return @__minimap_move_event
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップオブジェクトか
  #--------------------------------------------------------------------------
  def is_minimap_object?
    if @__minimap_object_type.nil? || @__last_page != @page
      __create_minimap_cache
    end

    return @__minimap_object_type > 0
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップオブジェクトタイプ
  #--------------------------------------------------------------------------
  def minimap_object_type
    if @__minimap_object_type.nil? || @__last_page != @page
      __create_minimap_cache
    end

    return @__minimap_object_type
  end
end

#==============================================================================
# □ Game_MiniMap
#------------------------------------------------------------------------------
#   ミニマップを扱うクラスです。
#==============================================================================

class Game_MiniMap
  #--------------------------------------------------------------------------
  # ○ 構造体
  #--------------------------------------------------------------------------
  Point = Struct.new(:x, :y)
  Size  = Struct.new(:width, :height)
  PassageCache = Struct.new(:map_id, :table, :scan_table)
  #--------------------------------------------------------------------------
  # ○ クラス変数
  #--------------------------------------------------------------------------
  @@passage_cache = []  # 通行フラグテーブルキャッシュ
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(tilemap)
    @map_rect  = KMS_MiniMap::MAP_RECT
    @grid_size = [KMS_MiniMap::GRID_SIZE, 1].max

    @x = 0
    @y = 0
    @grid_num = Point.new(
      (@map_rect.width  + @grid_size - 1) / @grid_size,
      (@map_rect.height + @grid_size - 1) / @grid_size
    )
    @draw_grid_num    = Point.new(@grid_num.x + 2, @grid_num.y + 2)
    @draw_range_begin = Point.new(0, 0)
    @draw_range_end   = Point.new(0, 0)
    @tilemap = tilemap

    @last_x = $game_player.x
    @last_y = $game_player.y

    @showing = false
    @hiding  = false

    create_sprites
    refresh

    unless $game_temp.minimap_manual_visible
      self.opacity = 0
    end
  end
  #--------------------------------------------------------------------------
  # ○ スプライト作成
  #--------------------------------------------------------------------------
  def create_sprites
    @viewport   = Viewport.new(@map_rect)
    @viewport.z = KMS_MiniMap::MAP_Z

    # ビットマップサイズ計算
    @bmp_size = Size.new(
      (@grid_num.x + 2) * @grid_size,
      (@grid_num.y + 2) * @grid_size
    )
    @buf_bitmap = Bitmap.new(@bmp_size.width, @bmp_size.height)

    # マップ用スプライト作成
    @map_sprite   = Sprite.new(@viewport)
    @map_sprite.x = -@grid_size
    @map_sprite.y = -@grid_size
    @map_sprite.z = 0
    @map_sprite.bitmap = Bitmap.new(@bmp_size.width, @bmp_size.height)

    # オブジェクト用スプライト作成
    @object_sprite   = Sprite_MiniMapIcon.new(@viewport)
    @object_sprite.x = -@grid_size
    @object_sprite.y = -@grid_size
    @object_sprite.z = 1
    @object_sprite.bitmap = Bitmap.new(@bmp_size.width, @bmp_size.height)

    # 現在位置スプライト作成
    @position_sprite   = Sprite_MiniMapIcon.new
    @position_sprite.x = @map_rect.x + @grid_num.x / 2 * @grid_size
    @position_sprite.y = @map_rect.y + @grid_num.y / 2 * @grid_size
    @position_sprite.z = @viewport.z + 2
    bitmap = Bitmap.new(@grid_size, @grid_size)
    bitmap.fill_rect(bitmap.rect, KMS_MiniMap::POSITION_COLOR)
    @position_sprite.bitmap = bitmap
  end
  #--------------------------------------------------------------------------
  # ● 解放
  #--------------------------------------------------------------------------
  def dispose
    @buf_bitmap.dispose
    @map_sprite.bitmap.dispose
    @map_sprite.dispose
    @object_sprite.bitmap.dispose
    @object_sprite.dispose
    @position_sprite.bitmap.dispose
    @position_sprite.dispose
    @viewport.dispose
  end
  #--------------------------------------------------------------------------
  # ○ 可視状態取得
  #--------------------------------------------------------------------------
  def visible
    return @map_sprite.visible
  end
  #--------------------------------------------------------------------------
  # ○ 可視状態設定
  #--------------------------------------------------------------------------
  def visible=(value)
    @viewport.visible        = value
    @map_sprite.visible      = value
    @object_sprite.visible   = value
    @position_sprite.visible = value
  end
  #--------------------------------------------------------------------------
  # ○ 不透明度取得
  #--------------------------------------------------------------------------
  def opacity
    return @map_sprite.opacity
  end
  #--------------------------------------------------------------------------
  # ○ 不透明度設定
  #--------------------------------------------------------------------------
  def opacity=(value)
    @map_sprite.opacity      = value
    @object_sprite.opacity   = value
    @position_sprite.opacity = value
  end
  #--------------------------------------------------------------------------
  # ○ リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    update_draw_range
    update_passage_table
    update_object_list
    update_position
    draw_map
    draw_object
    Graphics.frame_reset
  end
  #--------------------------------------------------------------------------
  # ○ フェードイン
  #--------------------------------------------------------------------------
  def fadein
    @showing = true
    @hiding  = false
    self.opacity = 255 if KMS_MiniMap::SNAP_FADE == true
  end
  #--------------------------------------------------------------------------
  # ○ フェードアウト
  #--------------------------------------------------------------------------
  def fadeout
    @showing = false
    @hiding  = true
    self.opacity = 0 if KMS_MiniMap::SNAP_FADE == true
  end
  #--------------------------------------------------------------------------
  # ○ キー入力更新
  #--------------------------------------------------------------------------
  def update_input
    return if KMS_MiniMap::SWITCH_BUTTON.nil?

    if Input.trigger?(KMS_MiniMap::SWITCH_BUTTON)
      if opacity < 255 && !@showing
        $game_temp.minimap_manual_visible = true
        fadein
      elsif opacity > 0 && !@hiding
        $game_temp.minimap_manual_visible = false
        fadeout
      end
    end
  end
  #--------------------------------------------------------------------------
  # ○ 描画範囲更新
  #--------------------------------------------------------------------------
  def update_draw_range
    range = []
    (2).times { |i| range[i] = @draw_grid_num[i] / 2 }

    @draw_range_begin.x = $game_player.x - range[0]
    @draw_range_begin.y = $game_player.y - range[1]
    @draw_range_end.x   = $game_player.x + range[0]
    @draw_range_end.y   = $game_player.y + range[1]
  end
  #--------------------------------------------------------------------------
  # ○ 通行可否テーブル更新
  #--------------------------------------------------------------------------
  def update_passage_table
    cache = get_passage_table_cache
    @passage_table      = cache.table
    @passage_scan_table = cache.scan_table

    update_around_passage_table
  end
  #--------------------------------------------------------------------------
  # ○ 通行可否テーブルのキャッシュを取得
  #--------------------------------------------------------------------------
  def get_passage_table_cache
    map_id = $game_map.map_id
    cache  = @@passage_cache.find { |c| c.map_id == map_id }

    # キャッシュミスしたら新規作成
    if cache == nil
      cache = PassageCache.new(map_id)
      cache.table      = Table.new($game_map.width, $game_map.height)
      cache.scan_table = Table.new(
        ($game_map.width  + @draw_grid_num.x - 1) / @draw_grid_num.x,
        ($game_map.height + @draw_grid_num.y - 1) / @draw_grid_num.y
      )
    end

    # 直近のキャッシュは先頭に移動し、古いキャッシュは削除
    @@passage_cache.unshift(cache)
    @@passage_cache.delete_at(KMS_MiniMap::CACHE_NUM)

    return cache
  end
  #--------------------------------------------------------------------------
  # ○ 通行可否テーブルのキャッシュをクリア
  #--------------------------------------------------------------------------
  def clear_passage_table_cache
    return if @passage_scan_table == nil

    table = @passage_scan_table
    @passage_scan_table = Table.new(table.xsize, table.ysize)
  end
  #--------------------------------------------------------------------------
  # ○ 通行可否テーブルの探索
  #     x, y : 探索位置
  #--------------------------------------------------------------------------
  def scan_passage(x, y)
    dx = x / @draw_grid_num.x
    dy = y / @draw_grid_num.y

    # 探索済み
    return if @passage_scan_table[dx, dy] == 1

    # マップ範囲外
    return unless dx.between?(0, @passage_scan_table.xsize - 1)
    return unless dy.between?(0, @passage_scan_table.ysize - 1)

    rx = (dx * @draw_grid_num.x)...((dx + 1) * @draw_grid_num.x)
    ry = (dy * @draw_grid_num.y)...((dy + 1) * @draw_grid_num.y)
    mw = $game_map.width  - 1
    mh = $game_map.height - 1

    # 探索範囲内の通行テーブルを生成
    rx.each { |x|
      next unless x.between?(0, mw)
      ry.each { |y|
        next unless y.between?(0, mh)

        # 通行方向フラグ作成
        # (↓、←、→、↑ の順に 1, 2, 4, 8 が対応)
        flag = 0
        [2, 4, 6, 8].each{ |d|
          flag |= 1 << (d / 2 - 1) if $game_map.passable?(x, y, d)
        }
        @passage_table[x, y] = flag
      }
    }
    @passage_scan_table[dx, dy] = 1
  end
  #--------------------------------------------------------------------------
  # ○ 周辺の通行可否テーブル更新
  #--------------------------------------------------------------------------
  def update_around_passage_table
    gx = @draw_grid_num.x
    gy = @draw_grid_num.y
    dx = $game_player.x - gx / 2
    dy = $game_player.y - gy / 2
    scan_passage(dx,      dy)
    scan_passage(dx + gx, dy)
    scan_passage(dx,      dy + gy)
    scan_passage(dx + gx, dy + gy)
  end
  #--------------------------------------------------------------------------
  # ○ オブジェクト一覧更新
  #--------------------------------------------------------------------------
  def update_object_list
    events = $game_map.events.values

    # WALL
    @wall_events = events.find_all { |e| e.is_minimap_wall_event? }

    # MOVE
    @move_events = events.find_all { |e| e.is_minimap_move_event? }

    # OBJ
    @object_list = events.find_all { |e| e.is_minimap_object? }
  end
  #--------------------------------------------------------------------------
  # ○ 位置更新
  #--------------------------------------------------------------------------
  def update_position
    # 移動量算出
    pt = Point.new($game_player.x, $game_player.y)
    ox = ($game_player.real_x - pt.x) * @grid_size
    oy = ($game_player.real_y - pt.y) * @grid_size

    @viewport.ox = ox
    @viewport.oy = oy

    # 移動していたらマップ再描画
    if pt.x != @last_x || pt.y != @last_y
      draw_map
      @last_x = pt.x
      @last_y = pt.y
    end
  end
  #--------------------------------------------------------------------------
  # ○ 描画範囲内判定
  #--------------------------------------------------------------------------
  def in_draw_range?(x, y)
    rb = @draw_range_begin
    re = @draw_range_end
    return (x.between?(rb.x, re.x) && y.between?(rb.y, re.y))
  end
  #--------------------------------------------------------------------------
  # ○ マップ範囲内判定
  #--------------------------------------------------------------------------
  def in_map_range?(x, y)
    mw = $game_map.width
    mh = $game_map.height
    return (x.between?(0, mw - 1) && y.between?(0, mh - 1))
  end
  #--------------------------------------------------------------------------
  # ○ マップ描画
  #--------------------------------------------------------------------------
  def draw_map
    update_around_passage_table

    bitmap  = @map_sprite.bitmap
    bitmap.fill_rect(bitmap.rect, KMS_MiniMap::BACKGROUND_COLOR)

    draw_map_foreground(bitmap)
    draw_map_move_event(bitmap)
  end
  #--------------------------------------------------------------------------
  # ○ 通行可能領域の描画
  #--------------------------------------------------------------------------
  def draw_map_foreground(bitmap)
    range_x = (@draw_range_begin.x)..(@draw_range_end.x)
    range_y = (@draw_range_begin.y)..(@draw_range_end.y)
    map_w   = $game_map.width  - 1
    map_h   = $game_map.height - 1
    rect    = Rect.new(0, 0, @grid_size, @grid_size)

    range_x.each { |x|
      next unless x.between?(0, map_w)
      range_y.each { |y|
        next unless y.between?(0, map_h)
        next if @passage_table[x, y] == 0
        next if @wall_events.find { |e| e.x == x && e.y == y }  # 壁

        # グリッド描画サイズ算出
        rect.set(0, 0, @grid_size, @grid_size)
        rect.x = (x - @draw_range_begin.x) * @grid_size
        rect.y = (y - @draw_range_begin.y) * @grid_size
        flag = @passage_table[x, y]
        if flag & 0x01 == 0  # 下通行不能
          rect.height -= 1
        end
        if flag & 0x02 == 0  # 左通行不能
          rect.x     += 1
          rect.width -= 1
        end
        if flag & 0x04 == 0  # 右通行不能
          rect.width -= 1
        end
        if flag & 0x08 == 0  # 上通行不能
          rect.y      += 1
          rect.height -= 1
        end
        bitmap.fill_rect(rect, KMS_MiniMap::FOREGROUND_COLOR)
      }
    }
  end
  #--------------------------------------------------------------------------
  # ○ 移動イベントの描画
  #--------------------------------------------------------------------------
  def draw_map_move_event(bitmap)
    rect = Rect.new(0, 0, @grid_size, @grid_size)
    @move_events.each { |e|
      rect.x = (e.x - @draw_range_begin.x) * @grid_size
      rect.y = (e.y - @draw_range_begin.y) * @grid_size
      bitmap.fill_rect(rect, KMS_MiniMap::MOVE_EVENT_COLOR)
    }
  end
  #--------------------------------------------------------------------------
  # ○ アニメーション更新
  #--------------------------------------------------------------------------
  def update_animation
    if @showing
      # フェードイン
      self.opacity += 16
      if opacity == 255
        @showing = false
      end
    elsif @hiding
      # フェードアウト
      self.opacity -= 16
      if opacity == 0
        @hiding = false
      end
    end
  end
  #--------------------------------------------------------------------------
  # ○ オブジェクト描画
  #--------------------------------------------------------------------------
  def draw_object
    # 下準備
    bitmap = @object_sprite.bitmap
    bitmap.clear
    rect = Rect.new(0, 0, @grid_size, @grid_size)

    # オブジェクト描画
    @object_list.each { |obj|
      next unless in_draw_range?(obj.x, obj.y)

      color = KMS_MiniMap::OBJECT_COLOR[obj.minimap_object_type - 1]
      next if color.nil?

      rect.x = (obj.real_x - @draw_range_begin.x) * @grid_size
      rect.y = (obj.real_y - @draw_range_begin.y) * @grid_size
      bitmap.fill_rect(rect, color)
    }

    # 乗り物描画
    $game_map.vehicles.each { |vehicle|
      next if vehicle.transparent

      rect.x = (vehicle.real_x - @draw_range_begin.x) * @grid_size
      rect.y = (vehicle.real_y - @draw_range_begin.y) * @grid_size
      bitmap.fill_rect(rect, KMS_MiniMap::VEHICLE_COLOR)
    }
  end
  #--------------------------------------------------------------------------
  # ○ 更新
  #--------------------------------------------------------------------------
  def update
    update_input

    return unless need_update?

    update_draw_range
    update_position
    update_animation
    draw_object

    @map_sprite.update
    @object_sprite.update
    @position_sprite.update
  end
  #--------------------------------------------------------------------------
  # ○ 更新判定
  #--------------------------------------------------------------------------
  def need_update?
    return (visible && opacity > 0) || @showing || @hiding
  end
end

#==============================================================================
# □ Sprite_MiniMapIcon
#------------------------------------------------------------------------------
#   ミニマップ用アイコンのクラスです。
#==============================================================================

class Sprite_MiniMapIcon < Sprite
  DURATION_MAX = 60
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     viewport : ビューポート
  #--------------------------------------------------------------------------
  def initialize(viewport = nil)
    super(viewport)
    @duration = DURATION_MAX / 2
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    super
    @duration += 1
    if @duration == DURATION_MAX
      @duration = 0
    end
    update_effect
  end
  #--------------------------------------------------------------------------
  # ○ エフェクトの更新
  #--------------------------------------------------------------------------
  def update_effect
    self.color.set(255, 255, 255,
      (@duration - DURATION_MAX / 2).abs * KMS_MiniMap::BLINK_LEVEL
    )
  end
end

#==============================================================================
# ■ Spriteset_Map
#==============================================================================

class Spriteset_Map
  attr_reader :minimap
  #--------------------------------------------------------------------------
  # ○ ミニマップの作成
  #--------------------------------------------------------------------------
  def create_minimap
    @minimap = Game_MiniMap.new(@tilemap)
    @minimap.visible = $game_system.minimap_show && $game_map.minimap_show?
  end
  #--------------------------------------------------------------------------
  # ● 解放
  #--------------------------------------------------------------------------
  alias dispose_KMS_MiniMap dispose
  def dispose
    dispose_KMS_MiniMap

    dispose_minimap
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップの解放
  #--------------------------------------------------------------------------
  def dispose_minimap
    @minimap.dispose
    @minimap = nil
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias update_KMS_MiniMap update
  def update
    update_KMS_MiniMap

    update_minimap
    dispose_minimap if $game_system.minimap_show == false && $game_map.minimap_show? && [email protected]?
    create_minimap if $game_system.minimap_show == true && $game_map.minimap_show? && @minimap.nil?
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップ更新
  #--------------------------------------------------------------------------
  def minimap_show?
    return $game_map.minimap_show? && $game_system.minimap_show
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップ更新
  #--------------------------------------------------------------------------
  def update_minimap
    return if @minimap.nil?

    # 表示切替
    if minimap_show?
      @minimap.visible = true
    else
      @minimap.visible = false
      return
    end

    # フェード判定
    case $game_map.minimap_fade
    when Game_Map::MINIMAP_FADE_IN
      @minimap.fadein
      $game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
    when Game_Map::MINIMAP_FADE_OUT
      @minimap.fadeout
      $game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
    end

    @minimap.update
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップ全体をリフレッシュ
  #--------------------------------------------------------------------------
  def refresh_minimap
    return if @minimap.nil?

    @minimap.clear_passage_table_cache
    @minimap.refresh
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップのオブジェクトを更新
  #--------------------------------------------------------------------------
  def update_minimap_object
    @minimap.update_object_list unless @minimap.nil?
  end
end

#==============================================================================
# ■ Scene_Map
#==============================================================================

class Scene_Map
  #--------------------------------------------------------------------------
  # ● 場所移動後の処理
  #--------------------------------------------------------------------------
  alias post_transfer_KMS_MiniMap post_transfer
  def post_transfer
    refresh_minimap

    post_transfer_KMS_MiniMap
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップ全体をリフレッシュ
  #--------------------------------------------------------------------------
  def refresh_minimap
    @spriteset.refresh_minimap unless @spriteset.nil?
  end
  #--------------------------------------------------------------------------
  # ○ ミニマップのオブジェクトを更新
  #--------------------------------------------------------------------------
  def update_minimap_object
    @spriteset.update_minimap_object unless @spriteset.nil?
  end
end
this is awsome, thank you! but there are some problems
First, it seems that everytime I have the "hide_minimap" script call up and press esc the game crashes and shows this
Captura de ecrã 2024-11-12 002940.png


Another thing is that it does seem like the map stops updating when the "hide_minimap" command is up, but when I press W, which is the button switch I made for hiding the map, it seems the minimap is still updating in the background
this is awsome, thank you! but there are some problems
First, it seems that everytime I have the "hide_minimap" script call up and press esc the game crashes and shows this
View attachment 322805

Another thing is that it does seem like the map stops updating when the "hide_minimap" command is up, but when I press W, which is the button switch I made for hiding the map, it seems the minimap is still updating in the background
You're right I didn't check the button press for disposing the minimap.
Fixed
Also that error could not happen as dispose is not on that line. I assume you copy pasted wrong.
You're right I didn't check the button press for disposing the minimap.
Fixed
Also that error could not happen as dispose is not on that line. I assume you copy pasted wrong.
Thank you, i'll try it out tomorow when I wake up

You're right I didn't check the button press for disposing the minimap.
Fixed
Also that error could not happen as dispose is not on that line. I assume you copy pasted wrong.
I copy pasted it a bunch of time trying to figure out what I did wrong but no matter what it still gives me that error when I press esc with the hide map command
Captura de ecrã 2024-11-12 080818.png

Like, the menu works perfectly fine when the minimap is on screen, but when the minimap isn't on screen and I bring up the menu the game crashes
I even copypasted your script as is into my script editor and it still gives me that crash
(Also, I'm pretty sure the reason why dispose for you isn't on that line is because of the fade removal thing you added)
Because in reality, its function is to make it disappear or hide, but it still works. In such cases, try doing the following.

I don't have the VX version of the game but I'll try to fix it.

Spoiler
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆ ミニマップ - KMS_MiniMap ◆ VX Ace ◆
#_/ ◇ Last update : 2012/02/12 (TOMY@Kamesoft) ◇
#_/----------------------------------------------------------------------------

module KMS_MiniMap
SWITCH_BUTTON = :Z

# ミニマップ表示位置・サイズ (X, Y, 幅, 高さ)
MAP_RECT = Rect.new(364, 20, 160, 120)
MAP_Z = 0

# 1マスのサイズ
GRID_SIZE = 5

# ミニマップカラー
FOREGROUND_COLOR = Color.new(192, 192, 224, 160) # 前景色 (通行可)
BACKGROUND_COLOR = Color.new( 0, 0, 160, 160) # 背景色 (通行不可)
POSITION_COLOR = Color.new(255, 0, 0, 192) # 現在位置
MOVE_EVENT_COLOR = Color.new(255, 160, 0, 192) # マップ移動イベント
VEHICLE_COLOR = Color.new( 96, 128, 0, 192) # 乗り物

OBJECT_COLOR = [
Color.new( 0, 128, 0, 192), # OBJ 1
Color.new( 0, 160, 160, 192), # OBJ 2
Color.new(160, 0, 160, 192), # OBJ 3
]
BLINK_LEVEL = 7
CACHE_NUM = 10
end

$kms_imported = {} if $kms_imported == nil
$kms_imported["MiniMap"] = true

module KMS_MiniMap
REGEX_NO_MINIMAP_NOTE = /<(?:ミニマップ|MINIMAP)\s*(?:非表示|HIDE)>/i
REGEX_NO_MINIMAP_NAME = /\[NOMAP\]/i
REGEX_WALL_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:壁|障害物|WALL)>/i
REGEX_MOVE_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:移動|MOVE)>/i
REGEX_OBJECT = /<(?:ミニマップ|MINIMAP)\s+OBJ(?:ECT)?\s*(\d+)>/i
end

module KMS_Commands
module_function
def show_minimap
$game_temp.minimap_manual_visible = true
$game_system.minimap_show = true
end

def hide_minimap
$game_system.minimap_show = false
end

def minimap_showing?
return $game_system.minimap_show
end

def refresh_minimap
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.refresh_minimap
end

def update_minimap_object
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.update_minimap_object
end
end

class Game_Interpreter
include KMS_Commands
end

class RPG::Map
def create_minimap_cache
@__minimap_show = true
note.each_line { |line|
if line =~ KMS_MiniMap::REGEX_NO_MINIMAP_NOTE
@__minimap_show = false
end
}
end

def minimap_show?
create_minimap_cache if @__minimap_show.nil?
return @__minimap_show
end
end

class Game_Temp
attr_accessor :minimap_manual_visible
alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
@minimap_manual_visible = true
end
end

class Game_System
attr_accessor :minimap_show
alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
@minimap_show = true
end
end

class Game_Map
MINIMAP_FADE_NONE = 0
MINIMAP_FADE_IN = 1
MINIMAP_FADE_OUT = 2
attr_accessor :minimap_fade

def minimap_show?
return $data_mapinfos[map_id].minimap_show? && @map.minimap_show?
end

def fadein_minimap
@minimap_fade = MINIMAP_FADE_IN
end

def fadeout_minimap
@minimap_fade = MINIMAP_FADE_OUT
end

alias refresh_KMS_MiniMap refresh
def refresh
refresh_KMS_MiniMap
SceneManager.scene.refresh_minimap if SceneManager.scene_is?(Scene_Map)
end
end

class Game_Event < Game_Character
def __create_minimap_cache
@__last_page = @Page
@__minimap_wall_event = false
@__minimap_move_event = false
@__minimap_object_type = -1

return if @page.nil?

@page.list.each { |cmd|
break unless [108, 408].include?(cmd.code)
case cmd.parameters[0]
when KMS_MiniMap::REGEX_WALL_EVENT
@__minimap_wall_event = true
when KMS_MiniMap::REGEX_MOVE_EVENT
@__minimap_move_event = true
when KMS_MiniMap::REGEX_OBJECT
@__minimap_object_type = $1.to_i
end
}
end
private :__create_minimap_cache

def graphic_exist?
return (character_name != "" || tile_id > 0)
end

def is_minimap_wall_event?
if @__minimap_wall_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_wall_event
end

def is_minimap_move_event?
if @__minimap_move_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_move_event
end

def is_minimap_object?
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type > 0
end

def minimap_object_type
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type
end
end

class Game_MiniMap
Point = Struct.new🙂x, :y)
Size = Struct.new🙂width, :height)
PassageCache = Struct.new🙂map_id, :table, :scan_table)

@@passage_cache = []

attr_reader :minimap_active # A

def initialize(tilemap)
@minimap_active = false # B
@map_rect = KMS_MiniMap::MAP_RECT
@grid_size = [KMS_MiniMap::GRID_SIZE, 1].max
@x = 0
@y = 0
@grid_num = Point.new(
(@map_rect.width + @grid_size - 1) / @grid_size,
(@map_rect.height + @grid_size - 1) / @grid_size
)
@draw_grid_num = Point.new(@grid_num.x + 2, @grid_num.y + 2)
@draw_range_begin = Point.new(0, 0)
@draw_range_end = Point.new(0, 0)
@tilemap = tilemap
@last_x = $game_player.x
@last_y = $game_player.y
@showing = false
@hiding = false
create_sprites
refresh
unless $game_temp.minimap_manual_visible
self.opacity = 0
end
end

def fadein
@showing = true
@hiding = false
self.opacity = 255 # Set opacity to 255 immediately
@minimap_active = true # S
end

def fadeout
@showing = false
@hiding = true
self.opacity = 0 # Set opacity to 0 immediately
@minimap_active = false # ST
end

def update_input
return if KMS_MiniMap::SWITCH_BUTTON.nil?

if Input.trigger?(KMS_MiniMap::SWITCH_BUTTON)
if opacity < 255 && !@showing
$game_temp.minimap_manual_visible = true
fadein
elsif opacity > 0 && !@hiding
$game_temp.minimap_manual_visible = false
fadeout
end
end
end

def update
return unless @minimap_active # C

update_input
return unless need_update?

update_draw_range
update_position
update_animation
draw_object

@map_sprite.update
@object_sprite.update
@position_sprite.update
end

def need_update?
return (visible && opacity > 0) || @showing || @hiding
end
end

class Spriteset_Map
attr_reader :minimap

alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
create_minimap
end

def create_minimap
@minimap = Game_MiniMap.new(@tilemap)
@minimap.visible = $game_system.minimap_show && $game_map.minimap_show?
end

alias dispose_KMS_MiniMap dispose
def dispose
dispose_KMS_MiniMap
dispose_minimap
end

def dispose_minimap
@minimap.dispose
@minimap = nil
end

alias update_KMS_MiniMap update
def update
update_KMS_MiniMap
update_minimap
end

def minimap_show?
return $game_map.minimap_show? && $game_system.minimap_show
end

def update_minimap
return if @minimap.nil?

if minimap_show?
@minimap.visible = true
else
@minimap.visible = false
return
end

case $game_map.minimap_fade
when Game_Map::MINIMAP_FADE_IN
@minimap.fadein
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
when Game_Map::MINIMAP_FADE_OUT
@minimap.fadeout
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
end

@minimap.update
end

def refresh_minimap
return if @minimap.nil?

@minimap.clear_passage_table_cache
@minimap.refresh
end

def update_minimap_object
@minimap.update_object_list unless @minimap.nil?
end
end

class Scene_Map
alias post_transfer_KMS_MiniMap post_transfer
def post_transfer
refresh_minimap
post_transfer_KMS_MiniMap
end

def refresh_minimap
@spriteset.refresh_minimap unless @spriteset.nil?
end

def update_minimap_object
@spriteset.update_minimap_object unless @spriteset.nil?
end
end
Because in reality, its function is to make it disappear or hide, but it still works. In such cases, try doing the following.

I don't have the VX version of the game but I'll try to fix it.

Spoiler
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆ ミニマップ - KMS_MiniMap ◆ VX Ace ◆
#_/ ◇ Last update : 2012/02/12 (TOMY@Kamesoft) ◇
#_/----------------------------------------------------------------------------

module KMS_MiniMap
SWITCH_BUTTON = :Z

# ミニマップ表示位置・サイズ (X, Y, 幅, 高さ)
MAP_RECT = Rect.new(364, 20, 160, 120)
MAP_Z = 0

# 1マスのサイズ
GRID_SIZE = 5

# ミニマップカラー
FOREGROUND_COLOR = Color.new(192, 192, 224, 160) # 前景色 (通行可)
BACKGROUND_COLOR = Color.new( 0, 0, 160, 160) # 背景色 (通行不可)
POSITION_COLOR = Color.new(255, 0, 0, 192) # 現在位置
MOVE_EVENT_COLOR = Color.new(255, 160, 0, 192) # マップ移動イベント
VEHICLE_COLOR = Color.new( 96, 128, 0, 192) # 乗り物

OBJECT_COLOR = [
Color.new( 0, 128, 0, 192), # OBJ 1
Color.new( 0, 160, 160, 192), # OBJ 2
Color.new(160, 0, 160, 192), # OBJ 3
]
BLINK_LEVEL = 7
CACHE_NUM = 10
end

$kms_imported = {} if $kms_imported == nil
$kms_imported["MiniMap"] = true

module KMS_MiniMap
REGEX_NO_MINIMAP_NOTE = /<(?:ミニマップ|MINIMAP)\s*(?:非表示|HIDE)>/i
REGEX_NO_MINIMAP_NAME = /\[NOMAP\]/i
REGEX_WALL_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:壁|障害物|WALL)>/i
REGEX_MOVE_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:移動|MOVE)>/i
REGEX_OBJECT = /<(?:ミニマップ|MINIMAP)\s+OBJ(?:ECT)?\s*(\d+)>/i
end

module KMS_Commands
module_function
def show_minimap
$game_temp.minimap_manual_visible = true
$game_system.minimap_show = true
end

def hide_minimap
$game_system.minimap_show = false
end

def minimap_showing?
return $game_system.minimap_show
end

def refresh_minimap
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.refresh_minimap
end

def update_minimap_object
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.update_minimap_object
end
end

class Game_Interpreter
include KMS_Commands
end

class RPG::Map
def create_minimap_cache
@__minimap_show = true
note.each_line { |line|
if line =~ KMS_MiniMap::REGEX_NO_MINIMAP_NOTE
@__minimap_show = false
end
}
end

def minimap_show?
create_minimap_cache if @__minimap_show.nil?
return @__minimap_show
end
end

class Game_Temp
attr_accessor :minimap_manual_visible
alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
@minimap_manual_visible = true
end
end

class Game_System
attr_accessor :minimap_show
alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
@minimap_show = true
end
end

class Game_Map
MINIMAP_FADE_NONE = 0
MINIMAP_FADE_IN = 1
MINIMAP_FADE_OUT = 2
attr_accessor :minimap_fade

def minimap_show?
return $data_mapinfos[map_id].minimap_show? && @map.minimap_show?
end

def fadein_minimap
@minimap_fade = MINIMAP_FADE_IN
end

def fadeout_minimap
@minimap_fade = MINIMAP_FADE_OUT
end

alias refresh_KMS_MiniMap refresh
def refresh
refresh_KMS_MiniMap
SceneManager.scene.refresh_minimap if SceneManager.scene_is?(Scene_Map)
end
end

class Game_Event < Game_Character
def __create_minimap_cache
@__last_page = @Page
@__minimap_wall_event = false
@__minimap_move_event = false
@__minimap_object_type = -1

return if @page.nil?

@page.list.each { |cmd|
break unless [108, 408].include?(cmd.code)
case cmd.parameters[0]
when KMS_MiniMap::REGEX_WALL_EVENT
@__minimap_wall_event = true
when KMS_MiniMap::REGEX_MOVE_EVENT
@__minimap_move_event = true
when KMS_MiniMap::REGEX_OBJECT
@__minimap_object_type = $1.to_i
end
}
end
private :__create_minimap_cache

def graphic_exist?
return (character_name != "" || tile_id > 0)
end

def is_minimap_wall_event?
if @__minimap_wall_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_wall_event
end

def is_minimap_move_event?
if @__minimap_move_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_move_event
end

def is_minimap_object?
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type > 0
end

def minimap_object_type
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type
end
end

class Game_MiniMap
Point = Struct.new🙂x, :y)
Size = Struct.new🙂width, :height)
PassageCache = Struct.new🙂map_id, :table, :scan_table)

@@passage_cache = []

attr_reader :minimap_active # A

def initialize(tilemap)
@minimap_active = false # B
@map_rect = KMS_MiniMap::MAP_RECT
@grid_size = [KMS_MiniMap::GRID_SIZE, 1].max
@x = 0
@y = 0
@grid_num = Point.new(
(@map_rect.width + @grid_size - 1) / @grid_size,
(@map_rect.height + @grid_size - 1) / @grid_size
)
@draw_grid_num = Point.new(@grid_num.x + 2, @grid_num.y + 2)
@draw_range_begin = Point.new(0, 0)
@draw_range_end = Point.new(0, 0)
@tilemap = tilemap
@last_x = $game_player.x
@last_y = $game_player.y
@showing = false
@hiding = false
create_sprites
refresh
unless $game_temp.minimap_manual_visible
self.opacity = 0
end
end

def fadein
@showing = true
@hiding = false
self.opacity = 255 # Set opacity to 255 immediately
@minimap_active = true # S
end

def fadeout
@showing = false
@hiding = true
self.opacity = 0 # Set opacity to 0 immediately
@minimap_active = false # ST
end

def update_input
return if KMS_MiniMap::SWITCH_BUTTON.nil?

if Input.trigger?(KMS_MiniMap::SWITCH_BUTTON)
if opacity < 255 && !@showing
$game_temp.minimap_manual_visible = true
fadein
elsif opacity > 0 && !@hiding
$game_temp.minimap_manual_visible = false
fadeout
end
end
end

def update
return unless @minimap_active # C

update_input
return unless need_update?

update_draw_range
update_position
update_animation
draw_object

@map_sprite.update
@object_sprite.update
@position_sprite.update
end

def need_update?
return (visible && opacity > 0) || @showing || @hiding
end
end

class Spriteset_Map
attr_reader :minimap

alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
create_minimap
end

def create_minimap
@minimap = Game_MiniMap.new(@tilemap)
@minimap.visible = $game_system.minimap_show && $game_map.minimap_show?
end

alias dispose_KMS_MiniMap dispose
def dispose
dispose_KMS_MiniMap
dispose_minimap
end

def dispose_minimap
@minimap.dispose
@minimap = nil
end

alias update_KMS_MiniMap update
def update
update_KMS_MiniMap
update_minimap
end

def minimap_show?
return $game_map.minimap_show? && $game_system.minimap_show
end

def update_minimap
return if @minimap.nil?

if minimap_show?
@minimap.visible = true
else
@minimap.visible = false
return
end

case $game_map.minimap_fade
when Game_Map::MINIMAP_FADE_IN
@minimap.fadein
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
when Game_Map::MINIMAP_FADE_OUT
@minimap.fadeout
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
end

@minimap.update
end

def refresh_minimap
return if @minimap.nil?

@minimap.clear_passage_table_cache
@minimap.refresh
end

def update_minimap_object
@minimap.update_object_list unless @minimap.nil?
end
end

class Scene_Map
alias post_transfer_KMS_MiniMap post_transfer
def post_transfer
refresh_minimap
post_transfer_KMS_MiniMap
end

def refresh_minimap
@spriteset.refresh_minimap unless @spriteset.nil?
end

def update_minimap_object
@spriteset.update_minimap_object unless @spriteset.nil?
end
end
I tried using this script but there seems to be a problem
Captura de ecrã 2024-11-12 165555.png
Captura de ecrã 2024-11-12 165534.png
Try again, I can't test it so it's hard to make it work right away.

Spoiler
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆ ミニマップ - KMS_MiniMap ◆ VX Ace ◆
#_/ ◇ Last update : 2012/02/12 (TOMY@Kamesoft) ◇
#_/----------------------------------------------------------------------------

module KMS_MiniMap
SWITCH_BUTTON = :Z

# ミニマップ表示位置・サイズ (X, Y, 幅, 高さ)
MAP_RECT = Rect.new(364, 20, 160, 120)
MAP_Z = 0

# 1マスのサイズ
GRID_SIZE = 5

# ミニマップカラー
FOREGROUND_COLOR = Color.new(192, 192, 224, 160) # 前景色 (通行可)
BACKGROUND_COLOR = Color.new( 0, 0, 160, 160) # 背景色 (通行不可)
POSITION_COLOR = Color.new(255, 0, 0, 192) # 現在位置
MOVE_EVENT_COLOR = Color.new(255, 160, 0, 192) # マップ移動イベント
VEHICLE_COLOR = Color.new( 96, 128, 0, 192) # 乗り物

OBJECT_COLOR = [
Color.new( 0, 128, 0, 192), # OBJ 1
Color.new( 0, 160, 160, 192), # OBJ 2
Color.new(160, 0, 160, 192), # OBJ 3
]
BLINK_LEVEL = 7
CACHE_NUM = 10
end

$kms_imported = {} if $kms_imported == nil
$kms_imported["MiniMap"] = true

module KMS_MiniMap
REGEX_NO_MINIMAP_NOTE = /<(?:ミニマップ|MINIMAP)\s*(?:非表示|HIDE)>/i
REGEX_NO_MINIMAP_NAME = /\[NOMAP\]/i
REGEX_WALL_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:壁|障害物|WALL)>/i
REGEX_MOVE_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:移動|MOVE)>/i
REGEX_OBJECT = /<(?:ミニマップ|MINIMAP)\s+OBJ(?:ECT)?\s*(\d+)>/i
end

module KMS_Commands
module_function
def show_minimap
$game_temp.minimap_manual_visible = true
$game_system.minimap_show = true
end

def hide_minimap
$game_system.minimap_show = false
end

def minimap_showing?
return $game_system.minimap_show
end

def refresh_minimap
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.refresh_minimap
end

def update_minimap_object
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.update_minimap_object
end
end

class Game_Interpreter
include KMS_Commands
end

class RPG::Map
def create_minimap_cache
@__minimap_show = true
note.each_line { |line|
if line =~ KMS_MiniMap::REGEX_NO_MINIMAP_NOTE
@__minimap_show = false
end
}
end

def minimap_show?
create_minimap_cache if @__minimap_show.nil?
return @__minimap_show
end
end

class Game_Temp
attr_accessor :minimap_manual_visible
alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
@minimap_manual_visible = true
end
end

class Game_System
attr_accessor :minimap_show
alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
@minimap_show = true
end
end

class Game_Map
MINIMAP_FADE_NONE = 0
MINIMAP_FADE_IN = 1
MINIMAP_FADE_OUT = 2
attr_accessor :minimap_fade

def minimap_show?
return $data_mapinfos[map_id].minimap_show? && @map.minimap_show?
end

def fadein_minimap
@minimap_fade = MINIMAP_FADE_IN
end

def fadeout_minimap
@minimap_fade = MINIMAP_FADE_OUT
end

alias refresh_KMS_MiniMap refresh
def refresh
refresh_KMS_MiniMap
SceneManager.scene.refresh_minimap if SceneManager.scene_is?(Scene_Map)
end
end

class Game_Event < Game_Character
def __create_minimap_cache
@__last_page = @Page
@__minimap_wall_event = false
@__minimap_move_event = false
@__minimap_object_type = -1

return if @page.nil?

@page.list.each { |cmd|
break unless [108, 408].include?(cmd.code)
case cmd.parameters[0]
when KMS_MiniMap::REGEX_WALL_EVENT
@__minimap_wall_event = true
when KMS_MiniMap::REGEX_MOVE_EVENT
@__minimap_move_event = true
when KMS_MiniMap::REGEX_OBJECT
@__minimap_object_type = $1.to_i
end
}
end
private :__create_minimap_cache

def graphic_exist?
return (character_name != "" || tile_id > 0)
end

def is_minimap_wall_event?
if @__minimap_wall_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_wall_event
end

def is_minimap_move_event?
if @__minimap_move_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_move_event
end

def is_minimap_object?
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type > 0
end

def minimap_object_type
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type
end
end

class Game_MiniMap
Point = Struct.new🙂x, :y)
Size = Struct.new🙂width, :height)
PassageCache = Struct.new🙂map_id, :table, :scan_table)

@@passage_cache = []

attr_reader :minimap_active # A
def create_sprites
@map_sprite = Sprite.new(@tilemap.viewport)
@object_sprite = Sprite.new(@tilemap.viewport)
@position_sprite = Sprite.new(@tilemap.viewport)


@map_sprite.bitmap = Bitmap.new(@map_rect.width, @map_rect.height)
@object_sprite.bitmap = Bitmap.new(@map_rect.width, @map_rect.height)
@position_sprite.bitmap = Bitmap.new(@grid_size, @grid_size)


end
def initialize(tilemap)
@minimap_active = false # B
@map_rect = KMS_MiniMap::MAP_RECT
@grid_size = [KMS_MiniMap::GRID_SIZE, 1].max
@x = 0
@y = 0
@grid_num = Point.new(
(@map_rect.width + @grid_size - 1) / @grid_size,
(@map_rect.height + @grid_size - 1) / @grid_size
)
@draw_grid_num = Point.new(@grid_num.x + 2, @grid_num.y + 2)
@draw_range_begin = Point.new(0, 0)
@draw_range_end = Point.new(0, 0)
@tilemap = tilemap
@last_x = $game_player.x
@last_y = $game_player.y
@showing = false
@hiding = false
create_sprites
refresh
unless $game_temp.minimap_manual_visible
self.opacity = 0
end
end

def fadein
@showing = true
@hiding = false
self.opacity = 255 # Set opacity to 255 immediately
@minimap_active = true # S
end

def fadeout
@showing = false
@hiding = true
self.opacity = 0 # Set opacity to 0 immediately
@minimap_active = false # ST
end

def update_input
return if KMS_MiniMap::SWITCH_BUTTON.nil?

if Input.trigger?(KMS_MiniMap::SWITCH_BUTTON)
if opacity < 255 && !@showing
$game_temp.minimap_manual_visible = true
fadein
elsif opacity > 0 && !@hiding
$game_temp.minimap_manual_visible = false
fadeout
end
end
end

def update
return unless @minimap_active # C

update_input
return unless need_update?

update_draw_range
update_position
update_animation
draw_object

@map_sprite.update
@object_sprite.update
@position_sprite.update
end

def need_update?
return (visible && opacity > 0) || @showing || @hiding
end
end

class Spriteset_Map
attr_reader :minimap

alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
create_minimap
end

def create_minimap
@minimap = Game_MiniMap.new(@tilemap)
@minimap.visible = $game_system.minimap_show && $game_map.minimap_show?
end

alias dispose_KMS_MiniMap dispose
def dispose
dispose_KMS_MiniMap
dispose_minimap
end

def dispose_minimap
@minimap.dispose
@minimap = nil
end

alias update_KMS_MiniMap update
def update
update_KMS_MiniMap
update_minimap
end

def minimap_show?
return $game_map.minimap_show? && $game_system.minimap_show
end

def update_minimap
return if @minimap.nil?

if minimap_show?
@minimap.visible = true
else
@minimap.visible = false
return
end

case $game_map.minimap_fade
when Game_Map::MINIMAP_FADE_IN
@minimap.fadein
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
when Game_Map::MINIMAP_FADE_OUT
@minimap.fadeout
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
end

@minimap.update
end

def refresh_minimap
return if @minimap.nil?

@minimap.clear_passage_table_cache
@minimap.refresh
end

def update_minimap_object
@minimap.update_object_list unless @minimap.nil?
end
end

class Scene_Map
alias post_transfer_KMS_MiniMap post_transfer
def post_transfer
refresh_minimap
post_transfer_KMS_MiniMap
end

def refresh_minimap
@spriteset.refresh_minimap unless @spriteset.nil?
end

def update_minimap_object
@spriteset.update_minimap_object unless @spriteset.nil?
end
end
Try again, I can't test it so it's hard to make it work right away.

Spoiler
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆ ミニマップ - KMS_MiniMap ◆ VX Ace ◆
#_/ ◇ Last update : 2012/02/12 (TOMY@Kamesoft) ◇
#_/----------------------------------------------------------------------------

module KMS_MiniMap
SWITCH_BUTTON = :Z

# ミニマップ表示位置・サイズ (X, Y, 幅, 高さ)
MAP_RECT = Rect.new(364, 20, 160, 120)
MAP_Z = 0

# 1マスのサイズ
GRID_SIZE = 5

# ミニマップカラー
FOREGROUND_COLOR = Color.new(192, 192, 224, 160) # 前景色 (通行可)
BACKGROUND_COLOR = Color.new( 0, 0, 160, 160) # 背景色 (通行不可)
POSITION_COLOR = Color.new(255, 0, 0, 192) # 現在位置
MOVE_EVENT_COLOR = Color.new(255, 160, 0, 192) # マップ移動イベント
VEHICLE_COLOR = Color.new( 96, 128, 0, 192) # 乗り物

OBJECT_COLOR = [
Color.new( 0, 128, 0, 192), # OBJ 1
Color.new( 0, 160, 160, 192), # OBJ 2
Color.new(160, 0, 160, 192), # OBJ 3
]
BLINK_LEVEL = 7
CACHE_NUM = 10
end

$kms_imported = {} if $kms_imported == nil
$kms_imported["MiniMap"] = true

module KMS_MiniMap
REGEX_NO_MINIMAP_NOTE = /<(?:ミニマップ|MINIMAP)\s*(?:非表示|HIDE)>/i
REGEX_NO_MINIMAP_NAME = /\[NOMAP\]/i
REGEX_WALL_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:壁|障害物|WALL)>/i
REGEX_MOVE_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:移動|MOVE)>/i
REGEX_OBJECT = /<(?:ミニマップ|MINIMAP)\s+OBJ(?:ECT)?\s*(\d+)>/i
end

module KMS_Commands
module_function
def show_minimap
$game_temp.minimap_manual_visible = true
$game_system.minimap_show = true
end

def hide_minimap
$game_system.minimap_show = false
end

def minimap_showing?
return $game_system.minimap_show
end

def refresh_minimap
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.refresh_minimap
end

def update_minimap_object
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.update_minimap_object
end
end

class Game_Interpreter
include KMS_Commands
end

class RPG::Map
def create_minimap_cache
@__minimap_show = true
note.each_line { |line|
if line =~ KMS_MiniMap::REGEX_NO_MINIMAP_NOTE
@__minimap_show = false
end
}
end

def minimap_show?
create_minimap_cache if @__minimap_show.nil?
return @__minimap_show
end
end

class Game_Temp
attr_accessor :minimap_manual_visible
alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
@minimap_manual_visible = true
end
end

class Game_System
attr_accessor :minimap_show
alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
@minimap_show = true
end
end

class Game_Map
MINIMAP_FADE_NONE = 0
MINIMAP_FADE_IN = 1
MINIMAP_FADE_OUT = 2
attr_accessor :minimap_fade

def minimap_show?
return $data_mapinfos[map_id].minimap_show? && @map.minimap_show?
end

def fadein_minimap
@minimap_fade = MINIMAP_FADE_IN
end

def fadeout_minimap
@minimap_fade = MINIMAP_FADE_OUT
end

alias refresh_KMS_MiniMap refresh
def refresh
refresh_KMS_MiniMap
SceneManager.scene.refresh_minimap if SceneManager.scene_is?(Scene_Map)
end
end

class Game_Event < Game_Character
def __create_minimap_cache
@__last_page = @Page
@__minimap_wall_event = false
@__minimap_move_event = false
@__minimap_object_type = -1

return if @page.nil?

@page.list.each { |cmd|
break unless [108, 408].include?(cmd.code)
case cmd.parameters[0]
when KMS_MiniMap::REGEX_WALL_EVENT
@__minimap_wall_event = true
when KMS_MiniMap::REGEX_MOVE_EVENT
@__minimap_move_event = true
when KMS_MiniMap::REGEX_OBJECT
@__minimap_object_type = $1.to_i
end
}
end
private :__create_minimap_cache

def graphic_exist?
return (character_name != "" || tile_id > 0)
end

def is_minimap_wall_event?
if @__minimap_wall_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_wall_event
end

def is_minimap_move_event?
if @__minimap_move_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_move_event
end

def is_minimap_object?
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type > 0
end

def minimap_object_type
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type
end
end

class Game_MiniMap
Point = Struct.new🙂x, :y)
Size = Struct.new🙂width, :height)
PassageCache = Struct.new🙂map_id, :table, :scan_table)

@@passage_cache = []

attr_reader :minimap_active # A
def create_sprites
@map_sprite = Sprite.new(@tilemap.viewport)
@object_sprite = Sprite.new(@tilemap.viewport)
@position_sprite = Sprite.new(@tilemap.viewport)


@map_sprite.bitmap = Bitmap.new(@map_rect.width, @map_rect.height)
@object_sprite.bitmap = Bitmap.new(@map_rect.width, @map_rect.height)
@position_sprite.bitmap = Bitmap.new(@grid_size, @grid_size)


end
def initialize(tilemap)
@minimap_active = false # B
@map_rect = KMS_MiniMap::MAP_RECT
@grid_size = [KMS_MiniMap::GRID_SIZE, 1].max
@x = 0
@y = 0
@grid_num = Point.new(
(@map_rect.width + @grid_size - 1) / @grid_size,
(@map_rect.height + @grid_size - 1) / @grid_size
)
@draw_grid_num = Point.new(@grid_num.x + 2, @grid_num.y + 2)
@draw_range_begin = Point.new(0, 0)
@draw_range_end = Point.new(0, 0)
@tilemap = tilemap
@last_x = $game_player.x
@last_y = $game_player.y
@showing = false
@hiding = false
create_sprites
refresh
unless $game_temp.minimap_manual_visible
self.opacity = 0
end
end

def fadein
@showing = true
@hiding = false
self.opacity = 255 # Set opacity to 255 immediately
@minimap_active = true # S
end

def fadeout
@showing = false
@hiding = true
self.opacity = 0 # Set opacity to 0 immediately
@minimap_active = false # ST
end

def update_input
return if KMS_MiniMap::SWITCH_BUTTON.nil?

if Input.trigger?(KMS_MiniMap::SWITCH_BUTTON)
if opacity < 255 && !@showing
$game_temp.minimap_manual_visible = true
fadein
elsif opacity > 0 && !@hiding
$game_temp.minimap_manual_visible = false
fadeout
end
end
end

def update
return unless @minimap_active # C

update_input
return unless need_update?

update_draw_range
update_position
update_animation
draw_object

@map_sprite.update
@object_sprite.update
@position_sprite.update
end

def need_update?
return (visible && opacity > 0) || @showing || @hiding
end
end

class Spriteset_Map
attr_reader :minimap

alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
create_minimap
end

def create_minimap
@minimap = Game_MiniMap.new(@tilemap)
@minimap.visible = $game_system.minimap_show && $game_map.minimap_show?
end

alias dispose_KMS_MiniMap dispose
def dispose
dispose_KMS_MiniMap
dispose_minimap
end

def dispose_minimap
@minimap.dispose
@minimap = nil
end

alias update_KMS_MiniMap update
def update
update_KMS_MiniMap
update_minimap
end

def minimap_show?
return $game_map.minimap_show? && $game_system.minimap_show
end

def update_minimap
return if @minimap.nil?

if minimap_show?
@minimap.visible = true
else
@minimap.visible = false
return
end

case $game_map.minimap_fade
when Game_Map::MINIMAP_FADE_IN
@minimap.fadein
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
when Game_Map::MINIMAP_FADE_OUT
@minimap.fadeout
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
end

@minimap.update
end

def refresh_minimap
return if @minimap.nil?

@minimap.clear_passage_table_cache
@minimap.refresh
end

def update_minimap_object
@minimap.update_object_list unless @minimap.nil?
end
end

class Scene_Map
alias post_transfer_KMS_MiniMap post_transfer
def post_transfer
refresh_minimap
post_transfer_KMS_MiniMap
end

def refresh_minimap
@spriteset.refresh_minimap unless @spriteset.nil?
end

def update_minimap_object
@spriteset.update_minimap_object unless @spriteset.nil?
end
end
Captura de ecrã 2024-11-12 175213.png
Okay, to make it faster and easier for me to understand, I'll ask for a little AI help, but if there's an error, I'll try again. Unfortunately, I don't have the VX Ace version, it might be easier.

Spoiler
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆ ミニマップ - KMS_MiniMap ◆ VX Ace ◆
#_/ ◇ Last update : 2012/02/12 (TOMY@Kamesoft) ◇
#_/----------------------------------------------------------------------------

module KMS_MiniMap
SWITCH_BUTTON = :Z

MAP_RECT = Rect.new(364, 20, 160, 120)
MAP_Z = 0
GRID_SIZE = 5

FOREGROUND_COLOR = Color.new(192, 192, 224, 160)
BACKGROUND_COLOR = Color.new(0, 0, 160, 160)
POSITION_COLOR = Color.new(255, 0, 0, 192)
MOVE_EVENT_COLOR = Color.new(255, 160, 0, 192)
VEHICLE_COLOR = Color.new(96, 128, 0, 192)

OBJECT_COLOR = [
Color.new(0, 128, 0, 192),
Color.new(0, 160, 160, 192),
Color.new(160, 0, 160, 192),
]

BLINK_LEVEL = 7
CACHE_NUM = 10

REGEX_NO_MINIMAP_NOTE = /<(?:ミニマップ|MINIMAP)\s*(?:非表示|HIDE)>/i
REGEX_NO_MINIMAP_NAME = /\[NOMAP\]/i
REGEX_WALL_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:壁|障害物|WALL)>/i
REGEX_MOVE_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:移動|MOVE)>/i
REGEX_OBJECT = /<(?:ミニマップ|MINIMAP)\s+OBJ(?:ECT)?\s*(\d+)>/i
end

$kms_imported = {} if $kms_imported.nil?
$kms_imported["MiniMap"] = true

module KMS_Commands
module_function
def show_minimap
$game_temp.minimap_manual_visible = true
$game_system.minimap_show = true
end

def hide_minimap
$game_system.minimap_show = false
end

def minimap_showing?
return $game_system.minimap_show
end

def refresh_minimap
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.refresh_minimap
end

def update_minimap_object
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.update_minimap_object
end
end

class Game_Interpreter
include KMS_Commands
end

class RPG::Map
def create_minimap_cache
@__minimap_show = true
note.each_line { |line|
if line =~ KMS_MiniMap::REGEX_NO_MINIMAP_NOTE
@__minimap_show = false
end
}
end

def minimap_show?
create_minimap_cache if @__minimap_show.nil?
return @__minimap_show
end
end

class Game_Temp
attr_accessor :minimap_manual_visible
alias initialize_KMS_MiniMap initialize

def initialize
initialize_KMS_MiniMap
@minimap_manual_visible = true
end
end

class Game_System
attr_accessor :minimap_show
alias initialize_KMS_MiniMap initialize

def initialize
initialize_KMS_MiniMap
@minimap_show = true
end
end

class Game_Map
MINIMAP_FADE_NONE = 0
MINIMAP_FADE_IN = 1
MINIMAP_FADE_OUT = 2
attr_accessor :minimap_fade

def minimap_show?
return $data_mapinfos[map_id].minimap_show? && @map.minimap_show?
end

def fadein_minimap
@minimap_fade = MINIMAP_FADE_IN
end

def fadeout_minimap
@minimap_fade = MINIMAP_FADE_OUT
end

alias refresh_KMS_MiniMap refresh
def refresh
refresh_KMS_MiniMap
SceneManager.scene.refresh_minimap if SceneManager.scene_is?(Scene_Map)
end
end

class Game_Event < Game_Character
def __create_minimap_cache
@__last_page = @Page
@__minimap_wall_event = false
@__minimap_move_event = false
@__minimap_object_type = -1

return if @page.nil?

@page.list.each { |cmd|
break unless [108, 408].include?(cmd.code)
case cmd.parameters[0]
when KMS_MiniMap::REGEX_WALL_EVENT
@__minimap_wall_event = true
when KMS_MiniMap::REGEX_MOVE_EVENT
@__minimap_move_event = true
when KMS_MiniMap::REGEX_OBJECT
@__minimap_object_type = $1.to_i
end
}
end
private :__create_minimap_cache

def graphic_exist?
return (character_name != "" || tile_id > 0)
end

def is_minimap_wall_event?
if @__minimap_wall_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_wall_event
end

def is_minimap_move_event?
if @__minimap_move_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_move_event
end

def is_minimap_object?
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type > 0
end

def minimap_object_type
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type
end
end

class Game_MiniMap
Point = Struct.new🙂x, :y)
Size = Struct.new🙂width, :height)
PassageCache = Struct.new🙂map_id, :table, :scan_table)

@@passage_cache = []

attr_reader :minimap_active

def initialize(tilemap)
@minimap_active = false
@map_rect = KMS_MiniMap::MAP_RECT
@grid_size = [KMS_MiniMap::GRID_SIZE, 1].max
@x = 0
@y = 0
@grid_num = Point.new(
(@map_rect.width + @grid_size - 1) / @grid_size,
(@map_rect.height + @grid_size - 1) / @grid_size
)
@draw_grid_num = Point.new(@grid_num.x + 2, @grid_num.y + 2)
@draw_range_begin = Point.new(0, 0)
@draw_range_end = Point.new(0, 0)
@tilemap = tilemap
@last_x = $game_player.x
@last_y = $game_player.y
@showing = false
@hiding = false
create_sprites
refresh
@map_sprite.opacity = 0 unless $game_temp.minimap_manual_visible
end

def create_sprites
@map_sprite = Sprite.new(@tilemap.viewport)
@object_sprite = Sprite.new(@tilemap.viewport)
@position_sprite = Sprite.new(@tilemap.viewport)

@map_sprite.bitmap = Bitmap.new(@map_rect.width, @map_rect.height)
@object_sprite.bitmap = Bitmap.new(@map_rect.width, @map_rect.height)
@position_sprite.bitmap = Bitmap.new(@grid_size, @grid_size)
end

def refresh
@map_sprite.bitmap.clear if @map_sprite && @map_sprite.bitmap
@object_sprite.bitmap.clear if @object_sprite && @object_sprite.bitmap
@position_sprite.bitmap.clear if @position_sprite && @position_sprite.bitmap
draw_minimap
end

def draw_minimap
@map_sprite.bitmap.fill_rect(0, 0, @map_rect.width, @map_rect.height, KMS_MiniMap::BACKGROUND_COLOR)
@position_sprite.bitmap.fill_rect(0, 0, @grid_size, @grid_size, KMS_MiniMap:😛OSITION_COLOR)
end

def clear_passage_table_cache
@@passage_cache.clear
end

def update_object_list

end

def fadein
@showing = true
@hiding = false
@map_sprite.opacity = 255
@minimap_active = true
end

def fadeout
@showing = false
@hiding = true
@map_sprite.opacity = 0
@minimap_active = false
end

def update_input
return if KMS_MiniMap::SWITCH_BUTTON.nil?

if Input.trigger?(KMS_MiniMap::SWITCH_BUTTON)
if @map_sprite.opacity < 255 && !@showing
$game_temp.minimap_manual_visible = true
fadein
elsif @map_sprite.opacity > 0 && !@hiding
$game_temp.minimap_manual_visible = false
fadeout
end
end
end

def update
return unless @minimap_active # หยุดการอัพเดต minimap เมื่อซ่อน

update_input
return unless need_update?

update_draw_range
update_position
update_animation
draw_object

@map_sprite.update
@object_sprite.update
@position_sprite.update
end

def need_update?
return (visible && @map_sprite.opacity > 0) || @showing || @hiding
end
end

class Spriteset_Map
attr_reader :minimap

alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
create_minimap
end

def create_minimap
@minimap = Game_MiniMap.new(@tilemap)
@minimap.visible = $game_system.minimap_show && $game_map.minimap_show?
end

alias dispose_KMS_MiniMap dispose
def dispose
dispose_KMS_MiniMap
dispose_minimap
end

def dispose_minimap
@minimap.dispose
@minimap = nil
end

alias update_KMS_MiniMap update
def update
update_KMS_MiniMap
update_minimap
end

def minimap_show?
return $game_map.minimap_show? && $game_system.minimap_show
end

def update_minimap
return if @minimap.nil?

if minimap_show?
@minimap.visible = true
else
@minimap.visible = false
return
end

case $game_map.minimap_fade
when Game_Map::MINIMAP_FADE_IN
@minimap.fadein
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
when Game_Map::MINIMAP_FADE_OUT
@minimap.fadeout
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
end

@minimap.update
end

def refresh_minimap
return if @minimap.nil?

@minimap.clear_passage_table_cache
@minimap.refresh
end

def update_minimap_object
@minimap.update_object_list unless @minimap.nil?
end
end

class Scene_Map
alias post_transfer_KMS_MiniMap post_transfer
def post_transfer
refresh_minimap
post_transfer_KMS_MiniMap
end

def refresh_minimap
@spriteset.refresh_minimap unless @spriteset.nil?
end

def update_minimap_object
@spriteset.update_minimap_object unless @spriteset.nil?
end
end
Okay, to make it faster and easier for me to understand, I'll ask for a little AI help, but if there's an error, I'll try again. Unfortunately, I don't have the VX Ace version, it might be easier.

Spoiler
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆ ミニマップ - KMS_MiniMap ◆ VX Ace ◆
#_/ ◇ Last update : 2012/02/12 (TOMY@Kamesoft) ◇
#_/----------------------------------------------------------------------------

module KMS_MiniMap
SWITCH_BUTTON = :Z

MAP_RECT = Rect.new(364, 20, 160, 120)
MAP_Z = 0
GRID_SIZE = 5

FOREGROUND_COLOR = Color.new(192, 192, 224, 160)
BACKGROUND_COLOR = Color.new(0, 0, 160, 160)
POSITION_COLOR = Color.new(255, 0, 0, 192)
MOVE_EVENT_COLOR = Color.new(255, 160, 0, 192)
VEHICLE_COLOR = Color.new(96, 128, 0, 192)

OBJECT_COLOR = [
Color.new(0, 128, 0, 192),
Color.new(0, 160, 160, 192),
Color.new(160, 0, 160, 192),
]

BLINK_LEVEL = 7
CACHE_NUM = 10

REGEX_NO_MINIMAP_NOTE = /<(?:ミニマップ|MINIMAP)\s*(?:非表示|HIDE)>/i
REGEX_NO_MINIMAP_NAME = /\[NOMAP\]/i
REGEX_WALL_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:壁|障害物|WALL)>/i
REGEX_MOVE_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:移動|MOVE)>/i
REGEX_OBJECT = /<(?:ミニマップ|MINIMAP)\s+OBJ(?:ECT)?\s*(\d+)>/i
end

$kms_imported = {} if $kms_imported.nil?
$kms_imported["MiniMap"] = true

module KMS_Commands
module_function
def show_minimap
$game_temp.minimap_manual_visible = true
$game_system.minimap_show = true
end

def hide_minimap
$game_system.minimap_show = false
end

def minimap_showing?
return $game_system.minimap_show
end

def refresh_minimap
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.refresh_minimap
end

def update_minimap_object
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.update_minimap_object
end
end

class Game_Interpreter
include KMS_Commands
end

class RPG::Map
def create_minimap_cache
@__minimap_show = true
note.each_line { |line|
if line =~ KMS_MiniMap::REGEX_NO_MINIMAP_NOTE
@__minimap_show = false
end
}
end

def minimap_show?
create_minimap_cache if @__minimap_show.nil?
return @__minimap_show
end
end

class Game_Temp
attr_accessor :minimap_manual_visible
alias initialize_KMS_MiniMap initialize

def initialize
initialize_KMS_MiniMap
@minimap_manual_visible = true
end
end

class Game_System
attr_accessor :minimap_show
alias initialize_KMS_MiniMap initialize

def initialize
initialize_KMS_MiniMap
@minimap_show = true
end
end

class Game_Map
MINIMAP_FADE_NONE = 0
MINIMAP_FADE_IN = 1
MINIMAP_FADE_OUT = 2
attr_accessor :minimap_fade

def minimap_show?
return $data_mapinfos[map_id].minimap_show? && @map.minimap_show?
end

def fadein_minimap
@minimap_fade = MINIMAP_FADE_IN
end

def fadeout_minimap
@minimap_fade = MINIMAP_FADE_OUT
end

alias refresh_KMS_MiniMap refresh
def refresh
refresh_KMS_MiniMap
SceneManager.scene.refresh_minimap if SceneManager.scene_is?(Scene_Map)
end
end

class Game_Event < Game_Character
def __create_minimap_cache
@__last_page = @Page
@__minimap_wall_event = false
@__minimap_move_event = false
@__minimap_object_type = -1

return if @page.nil?

@page.list.each { |cmd|
break unless [108, 408].include?(cmd.code)
case cmd.parameters[0]
when KMS_MiniMap::REGEX_WALL_EVENT
@__minimap_wall_event = true
when KMS_MiniMap::REGEX_MOVE_EVENT
@__minimap_move_event = true
when KMS_MiniMap::REGEX_OBJECT
@__minimap_object_type = $1.to_i
end
}
end
private :__create_minimap_cache

def graphic_exist?
return (character_name != "" || tile_id > 0)
end

def is_minimap_wall_event?
if @__minimap_wall_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_wall_event
end

def is_minimap_move_event?
if @__minimap_move_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_move_event
end

def is_minimap_object?
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type > 0
end

def minimap_object_type
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type
end
end

class Game_MiniMap
Point = Struct.new🙂x, :y)
Size = Struct.new🙂width, :height)
PassageCache = Struct.new🙂map_id, :table, :scan_table)

@@passage_cache = []

attr_reader :minimap_active

def initialize(tilemap)
@minimap_active = false
@map_rect = KMS_MiniMap::MAP_RECT
@grid_size = [KMS_MiniMap::GRID_SIZE, 1].max
@x = 0
@y = 0
@grid_num = Point.new(
(@map_rect.width + @grid_size - 1) / @grid_size,
(@map_rect.height + @grid_size - 1) / @grid_size
)
@draw_grid_num = Point.new(@grid_num.x + 2, @grid_num.y + 2)
@draw_range_begin = Point.new(0, 0)
@draw_range_end = Point.new(0, 0)
@tilemap = tilemap
@last_x = $game_player.x
@last_y = $game_player.y
@showing = false
@hiding = false
create_sprites
refresh
@map_sprite.opacity = 0 unless $game_temp.minimap_manual_visible
end

def create_sprites
@map_sprite = Sprite.new(@tilemap.viewport)
@object_sprite = Sprite.new(@tilemap.viewport)
@position_sprite = Sprite.new(@tilemap.viewport)

@map_sprite.bitmap = Bitmap.new(@map_rect.width, @map_rect.height)
@object_sprite.bitmap = Bitmap.new(@map_rect.width, @map_rect.height)
@position_sprite.bitmap = Bitmap.new(@grid_size, @grid_size)
end

def refresh
@map_sprite.bitmap.clear if @map_sprite && @map_sprite.bitmap
@object_sprite.bitmap.clear if @object_sprite && @object_sprite.bitmap
@position_sprite.bitmap.clear if @position_sprite && @position_sprite.bitmap
draw_minimap
end

def draw_minimap
@map_sprite.bitmap.fill_rect(0, 0, @map_rect.width, @map_rect.height, KMS_MiniMap::BACKGROUND_COLOR)
@position_sprite.bitmap.fill_rect(0, 0, @grid_size, @grid_size, KMS_MiniMap:😛OSITION_COLOR)
end

def clear_passage_table_cache
@@passage_cache.clear
end

def update_object_list

end

def fadein
@showing = true
@hiding = false
@map_sprite.opacity = 255
@minimap_active = true
end

def fadeout
@showing = false
@hiding = true
@map_sprite.opacity = 0
@minimap_active = false
end

def update_input
return if KMS_MiniMap::SWITCH_BUTTON.nil?

if Input.trigger?(KMS_MiniMap::SWITCH_BUTTON)
if @map_sprite.opacity < 255 && !@showing
$game_temp.minimap_manual_visible = true
fadein
elsif @map_sprite.opacity > 0 && !@hiding
$game_temp.minimap_manual_visible = false
fadeout
end
end
end

def update
return unless @minimap_active # หยุดการอัพเดต minimap เมื่อซ่อน

update_input
return unless need_update?

update_draw_range
update_position
update_animation
draw_object

@map_sprite.update
@object_sprite.update
@position_sprite.update
end

def need_update?
return (visible && @map_sprite.opacity > 0) || @showing || @hiding
end
end

class Spriteset_Map
attr_reader :minimap

alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
create_minimap
end

def create_minimap
@minimap = Game_MiniMap.new(@tilemap)
@minimap.visible = $game_system.minimap_show && $game_map.minimap_show?
end

alias dispose_KMS_MiniMap dispose
def dispose
dispose_KMS_MiniMap
dispose_minimap
end

def dispose_minimap
@minimap.dispose
@minimap = nil
end

alias update_KMS_MiniMap update
def update
update_KMS_MiniMap
update_minimap
end

def minimap_show?
return $game_map.minimap_show? && $game_system.minimap_show
end

def update_minimap
return if @minimap.nil?

if minimap_show?
@minimap.visible = true
else
@minimap.visible = false
return
end

case $game_map.minimap_fade
when Game_Map::MINIMAP_FADE_IN
@minimap.fadein
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
when Game_Map::MINIMAP_FADE_OUT
@minimap.fadeout
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
end

@minimap.update
end

def refresh_minimap
return if @minimap.nil?

@minimap.clear_passage_table_cache
@minimap.refresh
end

def update_minimap_object
@minimap.update_object_list unless @minimap.nil?
end
end

class Scene_Map
alias post_transfer_KMS_MiniMap post_transfer
def post_transfer
refresh_minimap
post_transfer_KMS_MiniMap
end

def refresh_minimap
@spriteset.refresh_minimap unless @spriteset.nil?
end

def update_minimap_object
@spriteset.update_minimap_object unless @spriteset.nil?
end
end

Captura de ecrã 2024-11-12 184040.png
Captura de ecrã 2024-11-12 184057.png
Replace $data_mapinfos[map_id].minimap_show? with @map.minimap_show? to directly access the current map data.

Spoiler
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆ ミニマップ - KMS_MiniMap ◆ VX Ace ◆
#_/ ◇ Last update : 2012/02/12 (TOMY@Kamesoft) ◇
#_/----------------------------------------------------------------------------

module KMS_MiniMap
SWITCH_BUTTON = :Z

MAP_RECT = Rect.new(364, 20, 160, 120)
MAP_Z = 0
GRID_SIZE = 5

FOREGROUND_COLOR = Color.new(192, 192, 224, 160)
BACKGROUND_COLOR = Color.new(0, 0, 160, 160)
POSITION_COLOR = Color.new(255, 0, 0, 192)
MOVE_EVENT_COLOR = Color.new(255, 160, 0, 192)
VEHICLE_COLOR = Color.new(96, 128, 0, 192)

OBJECT_COLOR = [
Color.new(0, 128, 0, 192),
Color.new(0, 160, 160, 192),
Color.new(160, 0, 160, 192),
]

BLINK_LEVEL = 7
CACHE_NUM = 10

REGEX_NO_MINIMAP_NOTE = /<(?:ミニマップ|MINIMAP)\s*(?:非表示|HIDE)>/i
REGEX_NO_MINIMAP_NAME = /\[NOMAP\]/i
REGEX_WALL_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:壁|障害物|WALL)>/i
REGEX_MOVE_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:移動|MOVE)>/i
REGEX_OBJECT = /<(?:ミニマップ|MINIMAP)\s+OBJ(?:ECT)?\s*(\d+)>/i
end

$kms_imported = {} if $kms_imported.nil?
$kms_imported["MiniMap"] = true

module KMS_Commands
module_function
def show_minimap
$game_temp.minimap_manual_visible = true
$game_system.minimap_show = true
end

def hide_minimap
$game_system.minimap_show = false
end

def minimap_showing?
return $game_system.minimap_show
end

def refresh_minimap
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.refresh_minimap
end

def update_minimap_object
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.update_minimap_object
end
end

class Game_Interpreter
include KMS_Commands
end

class RPG::Map
def create_minimap_cache
@__minimap_show = true
note.each_line { |line|
if line =~ KMS_MiniMap::REGEX_NO_MINIMAP_NOTE
@__minimap_show = false
end
}
end

def minimap_show?
create_minimap_cache if @__minimap_show.nil?
return @__minimap_show
end
end

class Game_Temp
attr_accessor :minimap_manual_visible
alias initialize_KMS_MiniMap initialize

def initialize
initialize_KMS_MiniMap
@minimap_manual_visible = true
end
end

class Game_System
attr_accessor :minimap_show
alias initialize_KMS_MiniMap initialize

def initialize
initialize_KMS_MiniMap
@minimap_show = true
end
end

class Game_Map
MINIMAP_FADE_NONE = 0
MINIMAP_FADE_IN = 1
MINIMAP_FADE_OUT = 2
attr_accessor :minimap_fade

def minimap_show?
@map ||= load_data(sprintf("Data/Map%03d.rvdata2", @map_id))
return @map.minimap_show?
end

def fadein_minimap
@minimap_fade = MINIMAP_FADE_IN
end

def fadeout_minimap
@minimap_fade = MINIMAP_FADE_OUT
end

alias refresh_KMS_MiniMap refresh
def refresh
refresh_KMS_MiniMap
SceneManager.scene.refresh_minimap if SceneManager.scene_is?(Scene_Map)
end
end

class Game_Event < Game_Character
def __create_minimap_cache
@__last_page = @Page
@__minimap_wall_event = false
@__minimap_move_event = false
@__minimap_object_type = -1

return if @page.nil?

@page.list.each { |cmd|
break unless [108, 408].include?(cmd.code)
case cmd.parameters[0]
when KMS_MiniMap::REGEX_WALL_EVENT
@__minimap_wall_event = true
when KMS_MiniMap::REGEX_MOVE_EVENT
@__minimap_move_event = true
when KMS_MiniMap::REGEX_OBJECT
@__minimap_object_type = $1.to_i
end
}
end
private :__create_minimap_cache

def graphic_exist?
return (character_name != "" || tile_id > 0)
end

def is_minimap_wall_event?
if @__minimap_wall_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_wall_event
end

def is_minimap_move_event?
if @__minimap_move_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_move_event
end

def is_minimap_object?
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type > 0
end

def minimap_object_type
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type
end
end

class Game_MiniMap
Point = Struct.new🙂x, :y)
Size = Struct.new🙂width, :height)
PassageCache = Struct.new🙂map_id, :table, :scan_table)

@@passage_cache = []

attr_reader :minimap_active

def initialize(tilemap)
@minimap_active = false
@map_rect = KMS_MiniMap::MAP_RECT
@grid_size = [KMS_MiniMap::GRID_SIZE, 1].max
@x = 0
@y = 0
@grid_num = Point.new(
(@map_rect.width + @grid_size - 1) / @grid_size,
(@map_rect.height + @grid_size - 1) / @grid_size
)
@draw_grid_num = Point.new(@grid_num.x + 2, @grid_num.y + 2)
@draw_range_begin = Point.new(0, 0)
@draw_range_end = Point.new(0, 0)
@tilemap = tilemap
@last_x = $game_player.x
@last_y = $game_player.y
@showing = false
@hiding = false
create_sprites
refresh
@map_sprite.opacity = 0 unless $game_temp.minimap_manual_visible
end

def create_sprites
@map_sprite = Sprite.new(@tilemap.viewport)
@object_sprite = Sprite.new(@tilemap.viewport)
@position_sprite = Sprite.new(@tilemap.viewport)

@map_sprite.bitmap = Bitmap.new(@map_rect.width, @map_rect.height)
@object_sprite.bitmap = Bitmap.new(@map_rect.width, @map_rect.height)
@position_sprite.bitmap = Bitmap.new(@grid_size, @grid_size)
end

def refresh
@map_sprite.bitmap.clear if @map_sprite && @map_sprite.bitmap
@object_sprite.bitmap.clear if @object_sprite && @object_sprite.bitmap
@position_sprite.bitmap.clear if @position_sprite && @position_sprite.bitmap
draw_minimap
end

def draw_minimap
@map_sprite.bitmap.fill_rect(0, 0, @map_rect.width, @map_rect.height, KMS_MiniMap::BACKGROUND_COLOR)
@position_sprite.bitmap.fill_rect(0, 0, @grid_size, @grid_size, KMS_MiniMap:😛OSITION_COLOR)
end

def clear_passage_table_cache
@@passage_cache.clear
end

def update_object_list
# โค้ดสำหรับอัปเดตรายการวัตถุใน minimap ที่นี่
end

def fadein
@showing = true
@hiding = false
@map_sprite.opacity = 255
@minimap_active = true # เปิดใช้งาน minimap
end

def fadeout
@showing = false
@hiding = true
@map_sprite.opacity = 0
@minimap_active = false # ปิดการใช้งาน minimap
end

def update_input
return if KMS_MiniMap::SWITCH_BUTTON.nil?

if Input.trigger?(KMS_MiniMap::SWITCH_BUTTON)
if @map_sprite.opacity < 255 && !@showing
$game_temp.minimap_manual_visible = true
fadein
elsif @map_sprite.opacity > 0 && !@hiding
$game_temp.minimap_manual_visible = false
fadeout
end
end
end

def update
return unless @minimap_active # หยุดการอัพเดต minimap เมื่อซ่อน

update_input
return unless need_update?

update_draw_range
update_position
update_animation
draw_object

@map_sprite.update
@object_sprite.update
@position_sprite.update
end

def need_update?
return (visible && @map_sprite.opacity > 0) || @showing || @hiding
end
end

class Spriteset_Map
attr_reader :minimap

alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
create_minimap
end

def create_minimap
@minimap = Game_MiniMap.new(@tilemap)
@minimap.visible = $game_system.minimap_show && $game_map.minimap_show?
end

alias dispose_KMS_MiniMap dispose
def dispose
dispose_KMS_MiniMap
dispose_minimap
end

def dispose_minimap
@minimap.dispose
@minimap = nil
end

alias update_KMS_MiniMap update
def update
update_KMS_MiniMap
update_minimap
end

def minimap_show?
return $game_map.minimap_show? && $game_system.minimap_show
end

def update_minimap
return if @minimap.nil?

if minimap_show?
@minimap.visible = true
else
@minimap.visible = false
return
end

case $game_map.minimap_fade
when Game_Map::MINIMAP_FADE_IN
@minimap.fadein
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
when Game_Map::MINIMAP_FADE_OUT
@minimap.fadeout
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
end

@minimap.update
end

def refresh_minimap
return if @minimap.nil?

@minimap.clear_passage_table_cache
@minimap.refresh
end

def update_minimap_object
@minimap.update_object_list unless @minimap.nil?
end
end

class Scene_Map
alias post_transfer_KMS_MiniMap post_transfer
def post_transfer
refresh_minimap
post_transfer_KMS_MiniMap
end

def refresh_minimap
@spriteset.refresh_minimap unless @spriteset.nil?
end

def update_minimap_object
@spriteset.update_minimap_object unless @spriteset.nil?
end
end
Replace $data_mapinfos[map_id].minimap_show? with @map.minimap_show? to directly access the current map data.
Do you maybe have a discord or something so we can talk easier?
Captura de ecrã 2024-11-12 185247.png
Captura de ecrã 2024-11-12 185313.png
I have edited and attached the information. Try again.
I think someone here might be able to help me solve the problem after I did it. You can try again.
Spoiler
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆ ミニマップ - KMS_MiniMap ◆ VX Ace ◆
#_/ ◇ Last update : 2012/02/12 (TOMY@Kamesoft) ◇
#_/----------------------------------------------------------------------------

module KMS_MiniMap
SWITCH_BUTTON = :Z

MAP_RECT = Rect.new(364, 20, 160, 120)
MAP_Z = 0
GRID_SIZE = 5

FOREGROUND_COLOR = Color.new(192, 192, 224, 160)
BACKGROUND_COLOR = Color.new(0, 0, 160, 160)
POSITION_COLOR = Color.new(255, 0, 0, 192)
MOVE_EVENT_COLOR = Color.new(255, 160, 0, 192)
VEHICLE_COLOR = Color.new(96, 128, 0, 192)

OBJECT_COLOR = [
Color.new(0, 128, 0, 192),
Color.new(0, 160, 160, 192),
Color.new(160, 0, 160, 192),
]

BLINK_LEVEL = 7
CACHE_NUM = 10

REGEX_NO_MINIMAP_NOTE = /<(?:ミニマップ|MINIMAP)\s*(?:非表示|HIDE)>/i
REGEX_NO_MINIMAP_NAME = /\[NOMAP\]/i
REGEX_WALL_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:壁|障害物|WALL)>/i
REGEX_MOVE_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:移動|MOVE)>/i
REGEX_OBJECT = /<(?:ミニマップ|MINIMAP)\s+OBJ(?:ECT)?\s*(\d+)>/i
end

$kms_imported = {} if $kms_imported.nil?
$kms_imported["MiniMap"] = true

module KMS_Commands
module_function
def show_minimap
$game_temp.minimap_manual_visible = true
$game_system.minimap_show = true
end

def hide_minimap
$game_system.minimap_show = false
end

def minimap_showing?
return $game_system.minimap_show
end

def refresh_minimap
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.refresh_minimap
end

def update_minimap_object
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.update_minimap_object
end
end

class Game_Interpreter
include KMS_Commands
end

class RPG::Map
def create_minimap_cache
@__minimap_show = true
note.each_line { |line|
if line =~ KMS_MiniMap::REGEX_NO_MINIMAP_NOTE
@__minimap_show = false
end
}
end

def minimap_show?
create_minimap_cache if @__minimap_show.nil?
return @__minimap_show
end
end

class Game_Temp
attr_accessor :minimap_manual_visible
alias initialize_KMS_MiniMap initialize

def initialize
initialize_KMS_MiniMap
@minimap_manual_visible = true
end
end

class Game_System
attr_accessor :minimap_show
alias initialize_KMS_MiniMap initialize

def initialize
initialize_KMS_MiniMap
@minimap_show = true
end
end

class Game_Map
MINIMAP_FADE_NONE = 0
MINIMAP_FADE_IN = 1
MINIMAP_FADE_OUT = 2
attr_accessor :minimap_fade

def minimap_show?
@map ||= load_data(sprintf("Data/Map%03d.rvdata2", @map_id))
return @map.minimap_show?
end

def fadein_minimap
@minimap_fade = MINIMAP_FADE_IN
end

def fadeout_minimap
@minimap_fade = MINIMAP_FADE_OUT
end

alias refresh_KMS_MiniMap refresh
def refresh
refresh_KMS_MiniMap
SceneManager.scene.refresh_minimap if SceneManager.scene_is?(Scene_Map)
end
end

class Game_Event < Game_Character
def __create_minimap_cache
@__last_page = @Page
@__minimap_wall_event = false
@__minimap_move_event = false
@__minimap_object_type = -1

return if @page.nil?

@page.list.each { |cmd|
break unless [108, 408].include?(cmd.code)
case cmd.parameters[0]
when KMS_MiniMap::REGEX_WALL_EVENT
@__minimap_wall_event = true
when KMS_MiniMap::REGEX_MOVE_EVENT
@__minimap_move_event = true
when KMS_MiniMap::REGEX_OBJECT
@__minimap_object_type = $1.to_i
end
}
end
private :__create_minimap_cache

def graphic_exist?
return (character_name != "" || tile_id > 0)
end

def is_minimap_wall_event?
if @__minimap_wall_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_wall_event
end

def is_minimap_move_event?
if @__minimap_move_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_move_event
end

def is_minimap_object?
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type > 0
end

def minimap_object_type
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type
end
end

class Game_MiniMap
Point = Struct.new🙂x, :y)
Size = Struct.new🙂width, :height)
PassageCache = Struct.new🙂map_id, :table, :scan_table)

@@passage_cache = []

attr_reader :minimap_active

def initialize(tilemap)
@minimap_active = false
@map_rect = KMS_MiniMap::MAP_RECT
@grid_size = [KMS_MiniMap::GRID_SIZE, 1].max
@x = 0
@y = 0
@grid_num = Point.new(
(@map_rect.width + @grid_size - 1) / @grid_size,
(@map_rect.height + @grid_size - 1) / @grid_size
)
@draw_grid_num = Point.new(@grid_num.x + 2, @grid_num.y + 2)
@draw_range_begin = Point.new(0, 0)
@draw_range_end = Point.new(0, 0)
@tilemap = tilemap
@last_x = $game_player.x
@last_y = $game_player.y
@showing = false
@hiding = false
create_sprites
refresh
@map_sprite.opacity = 0 unless $game_temp.minimap_manual_visible
end

def create_sprites
@map_sprite = Sprite.new(@tilemap.viewport)
@object_sprite = Sprite.new(@tilemap.viewport)
@position_sprite = Sprite.new(@tilemap.viewport)

@map_sprite.bitmap = Bitmap.new(@map_rect.width, @map_rect.height)
@object_sprite.bitmap = Bitmap.new(@map_rect.width, @map_rect.height)
@position_sprite.bitmap = Bitmap.new(@grid_size, @grid_size)
end

def refresh
@map_sprite.bitmap.clear if @map_sprite && @map_sprite.bitmap
@object_sprite.bitmap.clear if @object_sprite && @object_sprite.bitmap
@position_sprite.bitmap.clear if @position_sprite && @position_sprite.bitmap
draw_minimap
end

def draw_minimap
@map_sprite.bitmap.fill_rect(0, 0, @map_rect.width, @map_rect.height, KMS_MiniMap::BACKGROUND_COLOR)
@position_sprite.bitmap.fill_rect(0, 0, @grid_size, @grid_size, KMS_MiniMap:😛OSITION_COLOR)
end

def clear_passage_table_cache
@@passage_cache.clear
end

def update_object_list
# โค้ดสำหรับอัปเดตรายการวัตถุใน minimap ที่นี่
end

def fadein
@showing = true
@hiding = false
@map_sprite.opacity = 255
@minimap_active = true # เปิดใช้งาน minimap
end

def fadeout
@showing = false
@hiding = true
@map_sprite.opacity = 0
@minimap_active = false # ปิดการใช้งาน minimap
end

def update_input
return if KMS_MiniMap::SWITCH_BUTTON.nil?

if Input.trigger?(KMS_MiniMap::SWITCH_BUTTON)
if @map_sprite.opacity < 255 && !@showing
$game_temp.minimap_manual_visible = true
fadein
elsif @map_sprite.opacity > 0 && !@hiding
$game_temp.minimap_manual_visible = false
fadeout
end
end
end

def update
return unless @minimap_active # หยุดการอัพเดต minimap เมื่อซ่อน

update_input
return unless need_update?

update_draw_range
update_position
update_animation
draw_object

@map_sprite.update
@object_sprite.update
@position_sprite.update
end

def need_update?
return (visible && @map_sprite.opacity > 0) || @showing || @hiding
end
end

class Spriteset_Map
attr_reader :minimap

alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
create_minimap
end

def create_minimap
@minimap = Game_MiniMap.new(@tilemap)
@minimap.visible = $game_system.minimap_show && $game_map.minimap_show?
end

alias dispose_KMS_MiniMap dispose
def dispose
dispose_KMS_MiniMap
dispose_minimap
end

def dispose_minimap
@minimap.dispose
@minimap = nil
end

alias update_KMS_MiniMap update
def update
update_KMS_MiniMap
update_minimap
end

def minimap_show?
return $game_map.minimap_show? && $game_system.minimap_show
end

def update_minimap
return if @minimap.nil?

if minimap_show?
@minimap.visible = true
else
@minimap.visible = false
return
end

case $game_map.minimap_fade
when Game_Map::MINIMAP_FADE_IN
@minimap.fadein
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
when Game_Map::MINIMAP_FADE_OUT
@minimap.fadeout
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
end

@minimap.update
end

def refresh_minimap
return if @minimap.nil?

@minimap.clear_passage_table_cache
@minimap.refresh
end

def update_minimap_object
@minimap.update_object_list unless @minimap.nil?
end
end

class Scene_Map
alias post_transfer_KMS_MiniMap post_transfer
def post_transfer
refresh_minimap
post_transfer_KMS_MiniMap
end

def refresh_minimap
@spriteset.refresh_minimap unless @spriteset.nil?
end

def update_minimap_object
@spriteset.update_minimap_object unless @spriteset.nil?
end
end
I have edited and attached the information. Try again.
I think someone here might be able to help me solve the problem after I did it. You can try again.
Spoiler
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆ ミニマップ - KMS_MiniMap ◆ VX Ace ◆
#_/ ◇ Last update : 2012/02/12 (TOMY@Kamesoft) ◇
#_/----------------------------------------------------------------------------

module KMS_MiniMap
SWITCH_BUTTON = :Z

MAP_RECT = Rect.new(364, 20, 160, 120)
MAP_Z = 0
GRID_SIZE = 5

FOREGROUND_COLOR = Color.new(192, 192, 224, 160)
BACKGROUND_COLOR = Color.new(0, 0, 160, 160)
POSITION_COLOR = Color.new(255, 0, 0, 192)
MOVE_EVENT_COLOR = Color.new(255, 160, 0, 192)
VEHICLE_COLOR = Color.new(96, 128, 0, 192)

OBJECT_COLOR = [
Color.new(0, 128, 0, 192),
Color.new(0, 160, 160, 192),
Color.new(160, 0, 160, 192),
]

BLINK_LEVEL = 7
CACHE_NUM = 10

REGEX_NO_MINIMAP_NOTE = /<(?:ミニマップ|MINIMAP)\s*(?:非表示|HIDE)>/i
REGEX_NO_MINIMAP_NAME = /\[NOMAP\]/i
REGEX_WALL_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:壁|障害物|WALL)>/i
REGEX_MOVE_EVENT = /<(?:ミニマップ|MINIMAP)\s*(?:移動|MOVE)>/i
REGEX_OBJECT = /<(?:ミニマップ|MINIMAP)\s+OBJ(?:ECT)?\s*(\d+)>/i
end

$kms_imported = {} if $kms_imported.nil?
$kms_imported["MiniMap"] = true

module KMS_Commands
module_function
def show_minimap
$game_temp.minimap_manual_visible = true
$game_system.minimap_show = true
end

def hide_minimap
$game_system.minimap_show = false
end

def minimap_showing?
return $game_system.minimap_show
end

def refresh_minimap
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.refresh_minimap
end

def update_minimap_object
return unless SceneManager.scene_is?(Scene_Map)
$game_map.refresh if $game_map.need_refresh
SceneManager.scene.update_minimap_object
end
end

class Game_Interpreter
include KMS_Commands
end

class RPG::Map
def create_minimap_cache
@__minimap_show = true
note.each_line { |line|
if line =~ KMS_MiniMap::REGEX_NO_MINIMAP_NOTE
@__minimap_show = false
end
}
end

def minimap_show?
create_minimap_cache if @__minimap_show.nil?
return @__minimap_show
end
end

class Game_Temp
attr_accessor :minimap_manual_visible
alias initialize_KMS_MiniMap initialize

def initialize
initialize_KMS_MiniMap
@minimap_manual_visible = true
end
end

class Game_System
attr_accessor :minimap_show
alias initialize_KMS_MiniMap initialize

def initialize
initialize_KMS_MiniMap
@minimap_show = true
end
end

class Game_Map
MINIMAP_FADE_NONE = 0
MINIMAP_FADE_IN = 1
MINIMAP_FADE_OUT = 2
attr_accessor :minimap_fade

def minimap_show?
@map ||= load_data(sprintf("Data/Map%03d.rvdata2", @map_id))
return @map.minimap_show?
end

def fadein_minimap
@minimap_fade = MINIMAP_FADE_IN
end

def fadeout_minimap
@minimap_fade = MINIMAP_FADE_OUT
end

alias refresh_KMS_MiniMap refresh
def refresh
refresh_KMS_MiniMap
SceneManager.scene.refresh_minimap if SceneManager.scene_is?(Scene_Map)
end
end

class Game_Event < Game_Character
def __create_minimap_cache
@__last_page = @Page
@__minimap_wall_event = false
@__minimap_move_event = false
@__minimap_object_type = -1

return if @page.nil?

@page.list.each { |cmd|
break unless [108, 408].include?(cmd.code)
case cmd.parameters[0]
when KMS_MiniMap::REGEX_WALL_EVENT
@__minimap_wall_event = true
when KMS_MiniMap::REGEX_MOVE_EVENT
@__minimap_move_event = true
when KMS_MiniMap::REGEX_OBJECT
@__minimap_object_type = $1.to_i
end
}
end
private :__create_minimap_cache

def graphic_exist?
return (character_name != "" || tile_id > 0)
end

def is_minimap_wall_event?
if @__minimap_wall_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_wall_event
end

def is_minimap_move_event?
if @__minimap_move_event.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_move_event
end

def is_minimap_object?
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type > 0
end

def minimap_object_type
if @__minimap_object_type.nil? || @__last_page != @Page
__create_minimap_cache
end
return @__minimap_object_type
end
end

class Game_MiniMap
Point = Struct.new🙂x, :y)
Size = Struct.new🙂width, :height)
PassageCache = Struct.new🙂map_id, :table, :scan_table)

@@passage_cache = []

attr_reader :minimap_active

def initialize(tilemap)
@minimap_active = false
@map_rect = KMS_MiniMap::MAP_RECT
@grid_size = [KMS_MiniMap::GRID_SIZE, 1].max
@x = 0
@y = 0
@grid_num = Point.new(
(@map_rect.width + @grid_size - 1) / @grid_size,
(@map_rect.height + @grid_size - 1) / @grid_size
)
@draw_grid_num = Point.new(@grid_num.x + 2, @grid_num.y + 2)
@draw_range_begin = Point.new(0, 0)
@draw_range_end = Point.new(0, 0)
@tilemap = tilemap
@last_x = $game_player.x
@last_y = $game_player.y
@showing = false
@hiding = false
create_sprites
refresh
@map_sprite.opacity = 0 unless $game_temp.minimap_manual_visible
end

def create_sprites
@map_sprite = Sprite.new(@tilemap.viewport)
@object_sprite = Sprite.new(@tilemap.viewport)
@position_sprite = Sprite.new(@tilemap.viewport)

@map_sprite.bitmap = Bitmap.new(@map_rect.width, @map_rect.height)
@object_sprite.bitmap = Bitmap.new(@map_rect.width, @map_rect.height)
@position_sprite.bitmap = Bitmap.new(@grid_size, @grid_size)
end

def refresh
@map_sprite.bitmap.clear if @map_sprite && @map_sprite.bitmap
@object_sprite.bitmap.clear if @object_sprite && @object_sprite.bitmap
@position_sprite.bitmap.clear if @position_sprite && @position_sprite.bitmap
draw_minimap
end

def draw_minimap
@map_sprite.bitmap.fill_rect(0, 0, @map_rect.width, @map_rect.height, KMS_MiniMap::BACKGROUND_COLOR)
@position_sprite.bitmap.fill_rect(0, 0, @grid_size, @grid_size, KMS_MiniMap:😛OSITION_COLOR)
end

def clear_passage_table_cache
@@passage_cache.clear
end

def update_object_list
# โค้ดสำหรับอัปเดตรายการวัตถุใน minimap ที่นี่
end

def fadein
@showing = true
@hiding = false
@map_sprite.opacity = 255
@minimap_active = true # เปิดใช้งาน minimap
end

def fadeout
@showing = false
@hiding = true
@map_sprite.opacity = 0
@minimap_active = false # ปิดการใช้งาน minimap
end

def update_input
return if KMS_MiniMap::SWITCH_BUTTON.nil?

if Input.trigger?(KMS_MiniMap::SWITCH_BUTTON)
if @map_sprite.opacity < 255 && !@showing
$game_temp.minimap_manual_visible = true
fadein
elsif @map_sprite.opacity > 0 && !@hiding
$game_temp.minimap_manual_visible = false
fadeout
end
end
end

def update
return unless @minimap_active # หยุดการอัพเดต minimap เมื่อซ่อน

update_input
return unless need_update?

update_draw_range
update_position
update_animation
draw_object

@map_sprite.update
@object_sprite.update
@position_sprite.update
end

def need_update?
return (visible && @map_sprite.opacity > 0) || @showing || @hiding
end
end

class Spriteset_Map
attr_reader :minimap

alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
create_minimap
end

def create_minimap
@minimap = Game_MiniMap.new(@tilemap)
@minimap.visible = $game_system.minimap_show && $game_map.minimap_show?
end

alias dispose_KMS_MiniMap dispose
def dispose
dispose_KMS_MiniMap
dispose_minimap
end

def dispose_minimap
@minimap.dispose
@minimap = nil
end

alias update_KMS_MiniMap update
def update
update_KMS_MiniMap
update_minimap
end

def minimap_show?
return $game_map.minimap_show? && $game_system.minimap_show
end

def update_minimap
return if @minimap.nil?

if minimap_show?
@minimap.visible = true
else
@minimap.visible = false
return
end

case $game_map.minimap_fade
when Game_Map::MINIMAP_FADE_IN
@minimap.fadein
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
when Game_Map::MINIMAP_FADE_OUT
@minimap.fadeout
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
end

@minimap.update
end

def refresh_minimap
return if @minimap.nil?

@minimap.clear_passage_table_cache
@minimap.refresh
end

def update_minimap_object
@minimap.update_object_list unless @minimap.nil?
end
end

class Scene_Map
alias post_transfer_KMS_MiniMap post_transfer
def post_transfer
refresh_minimap
post_transfer_KMS_MiniMap
end

def refresh_minimap
@spriteset.refresh_minimap unless @spriteset.nil?
end

def update_minimap_object
@spriteset.update_minimap_object unless @spriteset.nil?
end
end
Captura de ecrã 2024-11-12 190920.png
Captura de ecrã 2024-11-12 190934.png

I was given the suggestion of using a script comparer to compare the original script from roninators script to see if I can find a fix

Original thread: https://forums.rpgmakerweb.com/threads/help-witm-kms-mini-map-script.173163/