#################################################################### # MapRadar v1.8 # By: SojaBird # Site: http://www.nestcast.blogspot.com # Discription: Shows a radar with map and where the player is located #################################################################### # Start Setup #################################################################### # General Setup Radar_Switch = 1 # Number of the switch wich determens if the radar is shown or not Player_Map = 1 # Wheter to move the playericon or the map to display the playerposition [MovePlayerIcon=1, MoveMap=2] MapOffset = 3 # Amount wich the map will be offset from the border (E.g. the frameborderthickness) # Picture Setup PlayerWidth = 8 # The width of the playerindicator picture PlayerHeight = 8 # The height of the playerindicator picture PicWidth = 144 # The width of the frame and back pictures PicHeight = 144 # The height of the frame and back pictures Frame = "Frame" # Name of the picture for the frame Player = "Player" # Name of the picture wich shows the playerindicator Back = "Back" # Name of the picture wich is the BG for the Hud whene there is no map displayed # You need a picture of every map you want to display in the Hud, where the width=PlayerSize*[number of X-tiles] and where is the height=PlayerSize*[number of Y-tiles] # The name of these maps need to be "Map..." where the "..." stand for the map nr. So for map001 you need a picture called "Map1", for map002 "Map2" etc. # Placement Setup PlacementX = 2 # Horizontal placement of the Hud [Left=1, Center=2, Right=3, Custom=0] PlacementY = 2 # Vertical placement of the Hud [Top=1, Center=2, Bottom=3, Custom=0] CustomX = 0 # Your custom horizontal placement of the Hud CustomY = 0 # Your custom vertical placement of the Hud # Opacity Setup Back_Opacity = 100 # Background opacity Map_Opacity = 200 # Map opacity Frame_Opacity = 255 # Frame opacity Player_Opacity = 200 # Playerindicator opacity Hide = true # Wheter or not to hide the Hud when the player is behind it Hide_Opacity = 150 # Amount that decreases the opacity of the Hud when the player is behind it # Text Setup DrawLocation = true # Whether or not to draw the mapname Font = "" # Font of the drawn mapname (use "" for the default "UmePlus Gothic"-style) LocationX = LocationY = SelfX = 0 SelfY = 0 # ScriptUse Setup UseRadar = true # Whether or not to use this script (put false and playergrafic to non to make mappictures) #################################################################### # End Setup #################################################################### #################################################################### #################################################################### X_Place = case PlacementX when 1 0 when 2 272-(PicWidth/2) when 3 544-PicWidth when 0 CustomX end Y_Place = case PlacementY when 1 0 when 2 208-(PicHeight/2) when 3 416-PicHeight when 0 CustomY end #################################################################### #################################################################### if UseRadar == true #################################################################### #################################################################### class Scene_Map < Scene_Base def start super $game_map.refresh @spriteset = Spriteset_Map.new @message_window = Window_Message.new if $game_switches[Radar_Switch] == true $Radar = Radar.new end end def terminate super if $scene.is_a?(Scene_Battle) @spriteset.dispose_characters end snapshot_for_background @spriteset.dispose @message_window.dispose if $game_switches[Radar_Switch] == true $Radar.dispose end if $scene.is_a?(Scene_Battle) perform_battle_transition end end def update super $game_map.interpreter.update $game_map.update $game_player.update $game_system.update @spriteset.update @message_window.update if $game_switches[Radar_Switch] == true if $Radar == nil $Radar = Radar.new end $Radar.update elsif $Radar != nil $Radar.dispose end unless $game_message.visible update_transfer_player update_encounter update_call_menu update_call_debug update_scene_change end end def update_transfer_player return unless $game_player.transfer? fade = (Graphics.brightness > 0) fadeout(30) if fade @spriteset.dispose $game_player.perform_transfer $game_map.autoplay $game_map.update Graphics.wait(15) @spriteset = Spriteset_Map.new if $game_switches[Radar_Switch] == true $Radar.dispose $Radar = Radar.new end fadein(30) if fade Input.update end end #################################################################### #################################################################### class Radar def initialize # draw frame @frame = Sprite.new @frame.bitmap = Cache.picture(Frame) @frame.x = X_Place @frame.y = Y_Place @frame.z = 9998 @frame.opacity = Frame_Opacity # draw location if DrawLocation == true @location_name = Sprite.new @location_name.bitmap = Bitmap.new(200,32) @location_name.x = (544/2)-100 @location_name.y = 416-32 if Font == "" @location_name.bitmap.font.name = "UmePlus Gothic" else @location_name.bitmap.font.name = Font end @map_id = $game_map.map_id @location_name.bitmap.clear @location_name.bitmap.draw_text(0, 0, 200, 32, load_data("Data/MapInfos.rvdata")[@map_id].name,1) end # draw bg @map_back_viewport = Viewport.new(X_Place, Y_Place, PicWidth, PicHeight) @map_back = Sprite.new(@map_back_viewport) @map_back.z = 9996 @map_back.bitmap = Cache.picture(Back) @map_back.opacity = Back_Opacity # draw map @map_viewport = Viewport.new(X_Place+MapOffset, Y_Place+MapOffset, PicWidth, PicHeight) @map = Sprite.new(@map_viewport) @map.bitmap = Cache.picture("Map" + $game_map.map_id.to_s) @map.z = 9997 @map.opacity = Map_Opacity # draw player @player_icon = Sprite.new(@map_viewport) @player_icon.bitmap = Cache.picture(Player) @player_icon.x = PicWidth/2 @player_icon.y = PicHeight/2 @player_icon.z = 9999 @player_icon.opacity = Player_Opacity update end def update # draw location if DrawLocation == true if @map_id != $game_map.map_id @map_id = $game_map.map_id @location_name.bitmap.clear @location_name.bitmap.draw_text(0, 0, 200, 32, load_data("Data/MapInfos.rvdata")[@map_id].name,1) end end # move player or map? case Player_Map when 1 # move player to map (x, y) if @map.x*32 != $game_player.x or @map.y*32 != $game_player.y @player_icon.x = ($game_player.x * PlayerWidth) @player_icon.y = ($game_player.y * PlayerHeight) end when 2 # move map to player (x, y) if @map.x*32 != $game_player.x or @map.y*32 != $game_player.y @map.x = (PicWidth/2) - ($game_player.x * PlayerWidth) @map.y = (PicHeight/2) - ($game_player.y * PlayerHeight) end end if Hide == true if $game_player.x >= X_Place/32 and $game_player.y >= Y_Place/32 and $game_player.x <= (X_Place+PicWidth)/32 and $game_player.y <= (Y_Place+PicHeight)/32 @frame.opacity = Frame_Opacity-Hide_Opacity @map_back.opacity = Back_Opacity-Hide_Opacity @map.opacity = Map_Opacity-Hide_Opacity @player_icon.opacity = Player_Opacity-Hide_Opacity else @frame.opacity = Frame_Opacity @map_back.opacity = Back_Opacity @map.opacity = Map_Opacity @player_icon.opacity = Player_Opacity end end end def dispose if DrawLocation == true @location_name.dispose end @map.opacity = 0 @map_back.opacity = 0 @player_icon.opacity = 0 @frame.opacity = 0 end end end