06-05-2020, 03:43 AM
(This post was last modified: 06-30-2020, 05:05 PM by DerVVulfman.
Edit Reason: Necessary spot for patches
)
Patches
Well, I couldn't just stop there. I had to make a little ... extra.
Use The Charlie Mini-Map / Dynamic Maps Patch if this script is in use with Dynamic Maps Expanded.
For those who use Spriteset shots of the map as a background to various systems, be they menus or Battlebacks that have the map visible, this patch hides the mini-map itself. It is for use with Charlie's Mini-Map Extended ver 1.8+.
The below script is not really for the game, but for use by YOU when making minimaps for distribution. It doesn't change the system, but it does tell you how far along the maps are when being generated.
Well, I couldn't just stop there. I had to make a little ... extra.
Use The Charlie Mini-Map / Dynamic Maps Patch if this script is in use with Dynamic Maps Expanded.
For those who use Spriteset shots of the map as a background to various systems, be they menus or Battlebacks that have the map visible, this patch hides the mini-map itself. It is for use with Charlie's Mini-Map Extended ver 1.8+.
Spriteset Patch
Code:
#==============================================================================
# ** Spriteset Patch for Charlie's Mini-Map Extended
#------------------------------------------------------------------------------
# Basically, this is a patch for anyone who wishes to display the map
# behind a menu screen and do not wish to have the mini-map to appear
# overtop, possibly blocking some of the menu objects.
#
# This is an example or model, and can be adjusted accordingly.
#
#==============================================================================
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs map screen processing.
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias charlie_hide_minimap_call_battle call_battle
alias charlie_hide_minimap_call_shop call_shop
alias charlie_hide_minimap_call_name call_name
alias charlie_hide_minimap_call_menu call_menu
alias charlie_hide_minimap_call_save call_save
alias charlie_hide_minimap_call_debug call_debug
#--------------------------------------------------------------------------
# * Battle Call
#--------------------------------------------------------------------------
def call_battle
# Perform the original call
charlie_hide_minimap_call_battle
# Disable 'scene visible' temp flag, hiding mini-map
$game_temp.scene_visible = false
end
#--------------------------------------------------------------------------
# * Shop Call
#--------------------------------------------------------------------------
def call_shop
# Perform the original call
charlie_hide_minimap_call_shop
# Disable 'scene visible' temp flag, hiding mini-map
$game_temp.scene_visible = false
end
#--------------------------------------------------------------------------
# * Name Input Call
#--------------------------------------------------------------------------
def call_name
# Perform the original call
charlie_hide_minimap_call_name
# Disable 'scene visible' temp flag, hiding mini-map
$game_temp.scene_visible = false
end
#--------------------------------------------------------------------------
# * Menu Call
#--------------------------------------------------------------------------
def call_menu
# Perform the original call
charlie_hide_minimap_call_menu
# Disable 'scene visible' temp flag, hiding mini-map
$game_temp.scene_visible = false
end
#--------------------------------------------------------------------------
# * Save Call
#--------------------------------------------------------------------------
def call_save
# Perform the original call
charlie_hide_minimap_call_save
# Disable 'scene visible' temp flag, hiding mini-map
$game_temp.scene_visible = false
end
#--------------------------------------------------------------------------
# * Debug Call
#--------------------------------------------------------------------------
def call_debug
# Perform the original call
charlie_hide_minimap_call_debug
# Disable 'scene visible' temp flag, hiding mini-map
$game_temp.scene_visible = false
end
end
The below script is not really for the game, but for use by YOU when making minimaps for distribution. It doesn't change the system, but it does tell you how far along the maps are when being generated.
Progress Display Window
Code:
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
# This class handles temporary data that is not included with save data.
# Refer to "$game_temp" for the instance of this class.
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :aavisible # Visibility for Progress Window
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
alias charlieprogress_initialize initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Original call
charlieprogress_initialize
# Set Value at atart
@aavisible = false
end
end
#==============================================================================
# ** Window_Progress
#------------------------------------------------------------------------------
# This window displays amount of gold.
#==============================================================================
class Window_Progress < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(240, 208, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh("",0)
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh(headertext="", percent=0)
self.contents.clear
self.contents.font.color = normal_color
text = headertext + ": " + (percent.to_s) + "%"
cx = contents.text_size(text).width
self.contents.draw_text(4, 0, 120, 32, text, 2)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if $game_temp.aavisible == true
self.opacity = 255
self.back_opacity = 255
self.contents_opacity = 255
else
self.opacity = 0
self.back_opacity = 0
self.contents_opacity = 0
end
end
end
#==============================================================================
# ** Zlib
#------------------------------------------------------------------------------
# This module handles data compression, its library having been written by
# Jean-loup Gailly and Mark Adler.
#==============================================================================
module Zlib
#============================================================================
# ** Png_File
#----------------------------------------------------------------------------
# This class performs generation of PNG formatted bitmap image files
#============================================================================
class Png_File < GzipWriter
#--------------------------------------------------------------------------
# * Make Bitmap Data 0
#--------------------------------------------------------------------------
def make_bitmap_data0
gz = Zlib::GzipWriter.open('hoge.gz')
t_Fx = 0
w = @bitmap.width
h = @bitmap.height
data = []
for y in 0...h
percy = ( y * 100) / h
$scene.progress.refresh("Map", percy)
data.push(0)
for x in 0...w
t_Fx += 1
if t_Fx % 10000 == 0
Graphics.update
end
if t_Fx % 100000 == 0
s = data.pack("C*")
gz.write(s)
data.clear
end
color = @bitmap.get_pixel(x, y)
red = color.red
green = color.green
blue = color.blue
alpha = color.alpha
data.push(red)
data.push(green)
data.push(blue)
data.push(alpha)
end
end
s = data.pack("C*")
gz.write(s)
gz.close
data.clear
gz = Zlib::GzipReader.open('hoge.gz')
data = gz.read
gz.close
File.delete('hoge.gz')
return data
end
end
end
#==============================================================================
# ** Passability_Map
#------------------------------------------------------------------------------
# This class actively renders the minimap utilizing game map passage data,
# and brings it together with events rendered by the Map_Objects class.
# It is used within the Scene_Map class.
#==============================================================================
class Passability_Map < Sprite
#--------------------------------------------------------------------------
# * Create a new minimap and make cached png file
#--------------------------------------------------------------------------
def renew
# Make Visible
$game_temp.aavisible = true
$scene.progress.refresh("Data", 0)
$scene.progress.update
@map = Bitmap.new( 4 * $game_map.width, 4 * $game_map.height)
for x in 0...$game_map.width
# Generate Percent
percy = ( x * 100) / $game_map.width
$scene.progress.refresh("Data", percy)
Graphics.update
refreshflag = false
for y in 0...$game_map.height
if refreshflag == false
if y > ($game_map.height/2)
refreshflag = true
Graphics.update
end
end
temp=0
@map.fill_rect(x*4,y*4,4,4,PassMap::PASSABLE_TILE_COLOR)
if !$game_map.passable?(x,y,2) # DOWN
@map.fill_rect(x*4,y*4+3,4,1,PassMap::BLOCKED_TILE_COLOR)
temp+=1
end
if !$game_map.passable?(x,y,4) # LEFT
@map.fill_rect(x*4,y*4,1,4,PassMap::BLOCKED_TILE_COLOR)
temp+=1
end
if !$game_map.passable?(x,y,6) # RIGHT
@map.fill_rect(x*4+3,y*4,1,4,PassMap::BLOCKED_TILE_COLOR)
temp+=1
end
if !$game_map.passable?(x,y,8) # UP
@map.fill_rect(x*4,y*4,4,1,PassMap::BLOCKED_TILE_COLOR)
temp+=1
end
if temp==4
@map.fill_rect(x*4+1,y*4+1,2,2,PassMap::BLOCKED_TILE_COLOR)
end
end
end
# Create named PNG file from bitmap created
@map.make_png(@name_map)
# Turn off visibility
$game_temp.aavisible = false
end
end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs map screen processing.
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :progress # Field Map
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias scene_map_passmap_cf_progress_main main
alias scene_map_passmap_cf_progress_update update
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
#Passable Minimap Initialization
@progress = Window_Progress.new
# Original call
scene_map_passmap_cf_progress_main
# Passable Minimap Disposal
@progress.dispose
end
def update
@progress.update unless @progress.nil?
# Original call
scene_map_passmap_cf_progress_update
end
end