MiniMap Script Version: 1.7
Introduction A simple minimap script, this one shows the whole map instead of just a part, but I wouldn't recommend it with large maps(you'll see why later)
Features No graphics needed for player or NPC's, the indicators are drawn by the script.
3 different ways to have the minimap made
Control what color the dots are for every individual event
Screenshots Demo http://savefile.com/files/452326 *I realize savefile isn't very efficient, but this script isn't all too hard to do*
Script Spoiler for "script" :
#============================================================================== # MiniMapScript #------------------------------------------------------------------------------ # Translation credit: Mr. DJ # Stolen by : KHORN, markusmks #============================================================================== class MiniMapScript < Window_Base attr_accessor :modus #-------------------------------------------------------------------------- # ? Initialize #-------------------------------------------------------------------------- def initialize(mapname=nil) super(0, 0, 200, 67) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.color = normal_color self.contents.font.name = "Arial" self.contents.font.size = 20 self.windowskin = nil # ---------------------------OPTION------------------------- # Mode 1 = Name of the map as: "mapname.png" # Vb: "Dungeon.png" # Mode 2 = Id as the name as "mapID.png" # Vb: "1.png" # Mode 3 = $name_minim[MapID] = "Screen" / screenone ".png" # in Modus 3 you save all the images in /pictures/MiniMaps and asign them to the map with call script #============================================================ @modus = 3 # ------------------------------------------------------------ @mapname = mapname if @modus == 1 real_map = $game_map.name elsif @modus == 2 real_map = $game_map.map_id.to_s elsif @modus == 3 real_map = $name_minim[$game_map.map_id] end @real_map = real_map if FileTest.exist?("Graphics/Pictures/MiniMaps/"+real_map+".png") @mapname = real_map end if @mapname != nil #--<Colors>-- Will be the colors of the player and NPC, but do not change these! see below player_color = Color.new(0,0,0) npc_color = Color.new(255,0,0) #----MAP------------------------# @player_color=player_color @npc_color=npc_color @gra_dir = "Graphics/Pictures/MiniMaps/" @mmap = @gra_dir+@mapname+".png" map = Bitmap.new(@mmap) @map_sprite = Sprite.new @map_sprite.bitmap = map @map_sprite.x = 0 @map_sprite.y = 0 @map_sprite.opacity = 180 @map_sprite.zoom_x = 0.98 @map_sprite.zoom_y = 0.98 #------PLAYER------------# @player_sprite = Sprite.new @player_sprite.bitmap = Bitmap.new(3,3) @player_sprite.bitmap.fill_rect(0,0,3,3,@player_color) #you can change these @event_sprite = [] for i in $game_map.events.keys.sort if ($game_map.events[i].is_a?(Game_Event) and $game_map.events[i].list!=nil and $game_map.events[i].list[0].code == 108 and $game_map.events[i].list[0].parameters == ["mm_point"]) @event_sprite[i] = Sprite.new @event_sprite[i].bitmap = Bitmap.new(3,3) if $game_map.events[i].list[1].parameters[0] != nil colors = $game_map.events[i].list[1].parameters[0].split red = colors[0].to_i green = colors[1].to_i blue = colors[2].to_i @npc_color = Color.new(red,green,blue) else @npc_color = Color.new(255,0,0) end @event_sprite[i].bitmap.fill_rect(0,0,3,3,@npc_color) end end refresh end end #-------------------------------------------------------------------------- # ? Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear if @event_sprite == [] renew end if FileTest.exist?("Graphics/Pictures/MiniMaps/"+@real_map+".png") @mapname = @real_map else @mapname = nil end if @mapname != nil for i in $game_map.events.keys.sort if ($game_map.events[i].is_a?(Game_Event) and $game_map.events[i].list!=nil and $game_map.events[i].list[0].code == 108 and $game_map.events[i].list[0].parameters == ["mm_point"]) if @event_sprite == [] renew return end @event_sprite[i].x = $game_map.events[i].real_x/16 @event_sprite[i].y = $game_map.events[i].real_y/16 @event_sprite[i].opacity = 255 @event_sprite[i].zoom_x = 1 @event_sprite[i].zoom_y = 1 end i += 1 end #----PLAYER MOVE---------# @player_sprite.x = $game_player.real_x/16 @player_sprite.y = $game_player.real_y/16 @player_sprite.opacity = 255 @player_sprite.zoom_x = 1 @player_sprite.zoom_y = 1 #----------------------------# end end #-------------------------------------------------------------------------- # ? Renew Graphics #-------------------------------------------------------------------------- def renew dispose if @modus == 1 real_map = $game_map.name elsif @modus == 2 real_map = $game_map.map_id.to_s elsif @modus == 3 real_map = $name_minim[$game_map.map_id] end @real_map = real_map if FileTest.exist?("Graphics/Pictures/MiniMaps/"+@real_map+".png") @mapname = real_map end @gra_dir = "Graphics/Pictures/MiniMaps/" @mmap = @gra_dir+@mapname+".png" map = Bitmap.new(@mmap) @map_sprite = Sprite.new @map_sprite.bitmap = map @map_sprite.x = 0 @map_sprite.y = 0 @map_sprite.opacity = 180 @map_sprite.zoom_x = 0.98 @map_sprite.zoom_y = 0.98 @player_sprite = Sprite.new @player_sprite.bitmap = Bitmap.new(3,3) #you can change these @player_sprite.bitmap.fill_rect(0,0,3,3,@player_color=Color.new(0,0,0)) #you can change these @event_sprite = [] for i in $game_map.events.keys.sort if ($game_map.events[i].is_a?(Game_Event) and $game_map.events[i].list!=nil and $game_map.events[i].list[0].code == 108 and $game_map.events[i].list[0].parameters == ["mm_point"]) @event_sprite[i] = Sprite.new @event_sprite[i].bitmap = Bitmap.new(3,3) if $game_map.events[i].list[1].parameters[0] != nil colors = $game_map.events[i].list[1].parameters[0].split red = colors[0].to_i green = colors[1].to_i blue = colors[2].to_i @npc_color = Color.new(red,green,blue) else @npc_color = Color.new(255,0,0) end @event_sprite[i].bitmap.fill_rect(0,0,3,3,@npc_color) #you can change these end end end #-------------------------------------------------------------------------- # ? Update #-------------------------------------------------------------------------- def update if @modus == 3 and $name_minim[$game_map.map_id] != "" renew end refresh end #-------------------------------------------------------------------------- # ? Dispose all #-------------------------------------------------------------------------- def dispose if @event_sprite != nil for sprite in @event_sprite if sprite != nil sprite.dispose end end end if @player_sprite != nil @player_sprite.dispose end if @map_sprite != nil @map_sprite.dispose end end end #============================================================================== # ? Game_MiniMap #------------------------------------------------------------------------------ # © i dont know #============================================================================== class Game_MiniMap #-------------------------------------------------------------------------- # ? Initialize #-------------------------------------------------------------------------- def initialize @data = [] end #-------------------------------------------------------------------------- # ? Map ID # variable_id : Map ID #-------------------------------------------------------------------------- def [](variable_id) if variable_id <= 5000 and @data[variable_id] != nil return @data[variable_id] else return "" end end #-------------------------------------------------------------------------- # ? MiniMap Screen declared here # variable_id : Map ID # value : Screen Name #-------------------------------------------------------------------------- def []=(variable_id, value) if variable_id <= 5000 @data[variable_id] = value end end end # ==================== Read this ======================================= # # As i cannot alias, please read this!! # To make sure the data of the minimaps is saved, # Copy the text between the edits, to the corresponding place in: # Scene_Title, Scene_Load, Scene_Save # After you did that... # ...Delete all the codes below # so they wont work here ^^... Mr. DJ # # ================================================================== class Scene_Title def command_new_game $game_system.se_play($data_system.decision_se) Audio.bgm_stop Graphics.frame_count = 0 $game_temp = Game_Temp.new $game_system = Game_System.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_screen = Game_Screen.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new # EDIT ------------------------------- $name_minim = Game_MiniMap.new # ------------------------------------ $game_party.setup_starting_members $game_map.setup($data_system.start_map_id) $game_player.moveto($data_system.start_x, $data_system.start_y) $game_player.refresh $game_map.autoplay $game_map.update $scene = Scene_Map.new end end class Scene_Save def write_save_data(file) characters = [] for i in 0...$game_party.actors.size actor = $game_party.actors[i] characters.push([actor.character_name, actor.character_hue]) end Marshal.dump(characters, file) Marshal.dump(Graphics.frame_count, file) $game_system.save_count += 1 $game_system.magic_number = $data_system.magic_number Marshal.dump($game_system, file) Marshal.dump($game_switches, file) Marshal.dump($game_variables, file) Marshal.dump($game_self_switches, file) Marshal.dump($game_screen, file) Marshal.dump($game_actors, file) Marshal.dump($game_party, file) Marshal.dump($game_troop, file) Marshal.dump($game_map, file) Marshal.dump($game_player, file) # EDIT ------------------------ Marshal.dump($name_minim, file) # ----------------------------- end end class Scene_Load def read_save_data(file) characters = Marshal.load(file) Graphics.frame_count = Marshal.load(file) $game_system = Marshal.load(file) $game_switches = Marshal.load(file) $game_variables = Marshal.load(file) $game_self_switches = Marshal.load(file) $game_screen = Marshal.load(file) $game_actors = Marshal.load(file) $game_party = Marshal.load(file) $game_troop = Marshal.load(file) $game_map = Marshal.load(file) $game_player = Marshal.load(file) # EDIT --------------------------------- $name_minim = Marshal.load(file) # -------------------------------------- if $game_system.magic_number != $data_system.magic_number $game_map.setup($game_map.map_id) $game_player.center($game_player.x, $game_player.y) end $game_party.refresh end end
And replace Scene_Map with this:
OR Add this in Scene_Map:
Under @message_window = Window_Message.new add
@mini_map = MiniMapScript.new
Under
$game_map.update
$game_system.map_interpreter.update
$game_player.update
Add
if @mini_map != nil
@mini_map.update
else
@mini_map = MiniMapScript.new
end
Finally under @spriteset = Spriteset_Map.new (make sure its near the end) add
@mini_map.dispose
@mini_map = MiniMapScript.new
Instructions For the mode pre-chosen on the script(mode 3), you must make a folder INSIDE your pictures folder, and name it Minimaps. Inside place pictures of about 160x120 (they can be bigger or smaller, but it will take more/less room on the screen. This is why its not very good for really large maps).
After you have done that, you must call the maps to their pictures by events. Once the event has happened, you can erase it or whatever.
Lets say you wanted your first map to have the picture you set in the Minimaps folder to have the picture of Map_01, well call it by event like this:
$name_minim[1] = "map_01"
The [1] is the map number and the "map_01" is the picture you set it to.
Now for events. For default color(red) just put a comment in the event saying just mm_point. BUT if you want to customize the color for the event, make a comment for the event saying:
mm_point
30 30 200
Where 30 30 and 200 are the colors (set in RGB of course)
Now for Mode 1 (that last was Mode 3, what the script is by default)
Pretty simple, if your map name is Dungeon, place a picture called Dungeon in the minimaps folder.
And Mode 2; You name the PNGs what the mapID is. So for map01 in your game, the png would be called 1.
If anyone has any trouble following these instructions on modes or anything just ask.
FAQ Nothing yet.
Compatibility Tested with SDK, and will not work with it. It's a small fix, but because the minimap is drawn in Scene_Map, and SDK rewrites it, then the minimap is not drawn. So either put the Scene_Map edit below SDK or just add the minimap lines in the SDK's Scene_Map part. Untested, but should work.
Credits and Thanks Made by Markusmks. I barely did anything but post it here:p