Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
QuesTMajoR

QuesTMajoR's Gold and Map Name Display (Transparent Window)

Recommended Posts

QuesTMajoR's Gold and Map Name Display (Transparent Window)

Description
This Script Allows you to add Map Name and Gold Displayed on your Screen, of course It's Window is TRANSPARENT so you will able to see the map on it's back. ALSO! This Script has a Gold and Map Icon.

ScreenShot
post-22158-0-79038000-1344399267_thumb.jpg

SCRIPT
 

 


=begin
----------------------->>>>>>>>>>>>>>>>†<<<<<<<<<<<<<<<<------------------------
QuesTMajoR's Transparent Gold and Map Window with Icons
Credits: QuesTMajoR
Instructions:
-Plug 'n Play, you just need Icons for the Gold and Map. The Icon must be named
"Gold-Pouch" (For Gold Icon) and "Map" (For Map Icon), the format must be ".png"
and must be at the "Graphics/Icons/" Folder. <img src="http://www.rmxpunlimited.net/forums//public/style_emoticons/default/biggrin.png" alt="biggrin.png">
Have Fun Using this on your Game! Just Give a Credit!
=end
class Game_Map
#--------------------------------------------------------------------------
# â— Properties
#--------------------------------------------------------------------------
attr_accessor :tileset_name # Name of the tileset file
attr_accessor :autotile_names # Names of the autotiles files
attr_accessor :panorama_name # Name of the background graphic file
attr_accessor :panorama_hue # Hue of the background graphic
attr_accessor :fog_name # Name of the foreground graphic file
attr_accessor :fog_hue # Hue of the foreground graphic
attr_accessor :fog_opacity # Opacity of the foreground graphic (0-255)
attr_accessor :fog_blend_type # Blending of the foregroung graphic (0=Normal, 1=Additive, 2=Negative)
attr_accessor :fog_zoom # Zoom settings of the foreground graphic
attr_accessor :fog_sx # Horizontal scrolling direction for the foreground graphic. (-=left, +=right)
attr_accessor :fog_sy # Vertical scrolling direction for the foreground graphic (-=up, +=down)
attr_accessor :battleback_name # Name of the battle background file
attr_accessor :display_x # How far right the map has scrolled (4 units = 1 pixel)
attr_accessor :display_y # How far down the map has scrolled (4 units = 1 pixel)
attr_accessor :need_refresh # Check if the screen needs to be refereshed
attr_reader :passages # Map's tile passability values
attr_reader :priorities # Map's tile prioritiey values
attr_reader :terrain_tags # Map's tile terrain values
attr_reader :events # Events on the map
attr_reader :fog_ox # displacement of the foreground graphic relative to the origin in the X direction
attr_reader :fog_oy # displacement of the foreground graphic relative to the origin in the Y direction
attr_reader :fog_tone # Tone of the foregound graphic
attr_reader :map_name # Name of the map
#--------------------------------------------------------------------------
# â— Initialize the map
#--------------------------------------------------------------------------
def initialize
@map_id = 0
@display_x = 0
@display_y = 0
end
#--------------------------------------------------------------------------
# â— Set up the map
# map_id : ID assigned to the map
#--------------------------------------------------------------------------
def setup(map_id)
# get tileset information from a Map file
@map_id = map_id
@map = load_data(sprintf("Data/Map%03d.rxdata", @map_id))
# get map name from MapInfos file
@map_name = load_data("Data/MapInfos.rxdata")[$game_map.map_id].name
tileset = $data_tilesets[@map.tileset_id]
@tileset_name = tileset.tileset_name
@autotile_names = tileset.autotile_names
@panorama_name = tileset.panorama_name
@panorama_hue = tileset.panorama_hue
@fog_name = tileset.fog_name
@fog_hue = tileset.fog_hue
@fog_opacity = tileset.fog_opacity
@fog_blend_type = tileset.fog_blend_type
@fog_zoom = tileset.fog_zoom
@fog_sx = tileset.fog_sx
@fog_sy = tileset.fog_sy
@battleback_name = tileset.battleback_name
@passages = tileset.passages
@priorities = tileset.priorities
@terrain_tags = tileset.terrain_tags
@display_x = 0
@display_y = 0
@need_refresh = false
@events = {}
for i in @map.events.keys
@events = Game_Event.new(@map_id, @map.events)
end
@common_events = {}
for i in 1...$data_common_events.size
@common_events = Game_CommonEvent.new(i)
end
@fog_ox = 0
@fog_oy = 0
@fog_tone = Tone.new(0, 0, 0, 0)
@fog_tone_target = Tone.new(0, 0, 0, 0)
@fog_tone_duration = 0
@fog_opacity_duration = 0
@fog_opacity_target = 0
@scroll_direction = 2
@scroll_rest = 0
@scroll_speed = 4
end
#--------------------------------------------------------------------------
# â— Return the ID assigned to the map
#--------------------------------------------------------------------------
def map_id
return @map_id
end
#--------------------------------------------------------------------------
# â— Return the width of the map in tiles
#--------------------------------------------------------------------------
def width
return @map.width
end
#--------------------------------------------------------------------------
# â— Return the height of the map in tiles
#--------------------------------------------------------------------------
def height
return @map.height
end
#--------------------------------------------------------------------------
# â— Return the monster groups that can be encountered on the map
#--------------------------------------------------------------------------
def encounter_list
return @map.encounter_list
end
#--------------------------------------------------------------------------
# â— Return the number of steps to occurr between encounters
#--------------------------------------------------------------------------
def encounter_step
return @map.encounter_step
end
#--------------------------------------------------------------------------
# â— Return the raw tile information from the map data file to the caller
#--------------------------------------------------------------------------
def data
return @map.data
end
#--------------------------------------------------------------------------
# â— Play the BGM and BGS that are assigned to the map
#--------------------------------------------------------------------------
def autoplay
if @map.autoplay_bgm
$game_system.bgm_play(@map.bgm)
end
if @map.autoplay_bgs
$game_system.bgs_play(@map.bgs)
end
end
#--------------------------------------------------------------------------
# â— Update the events on the map
#--------------------------------------------------------------------------
def refresh
if @map_id > 0
for event in @events.values
event.refresh
end
for common_event in @common_events.values
common_event.refresh
end
end
@need_refresh = false
end
#--------------------------------------------------------------------------
# â— Scroll the map down
# distance : Distance to scroll in real units (4 = 1 pixel).
#--------------------------------------------------------------------------
def scroll_down(distance)
@display_y = [@display_y + distance, (self.height - 15) * 128].min
end
#--------------------------------------------------------------------------
# â— Scroll the map left
# distance : Distance to scroll in real units (4 = 1 pixel).
#--------------------------------------------------------------------------
def scroll_left(distance)
@display_x = [@display_x - distance, 0].max
end
#--------------------------------------------------------------------------
# â— Scroll the map right
# distance : Distance to scroll in real units (4 = 1 pixel).
#--------------------------------------------------------------------------
def scroll_right(distance)
@display_x = [@display_x + distance, (self.width - 20) * 128].min
end
#--------------------------------------------------------------------------
# â— Scroll the map up
# distance : Distance to scroll in real units (4 = 1 pixel).
#--------------------------------------------------------------------------
def scroll_up(distance)
@display_y = [@display_y - distance, 0].max
end
#--------------------------------------------------------------------------
# â— Checks to see if an ordered pair of (X, Y) tile coordinates passed to it are within the bounds of the map.
# x : X must be greater than 0 and less than the width of the map
# y : Y must be greater than 0 and less than the height of the map
#--------------------------------------------------------------------------
def valid?(x, y)
return (x >= 0 and x < width and y >= 0 and y < height)
end
#--------------------------------------------------------------------------
# â— Checks to see if a tile on the map is passable
# x : X coordinate to check
# y : Y coordinate to check
# d : Direction to check (0,2,4,6,8,10)
# 0-Multidirectional
# 2-Down
# 4-Left
# 6-Right
# 8-Up
# 10-Special
# self_event : Event for which passability is being evaluated
#--------------------------------------------------------------------------
def passable?(x, y, d, self_event = nil)
unless valid?(x, y)
return false
end
bit = (1 << (d / 2 - 1)) & 0x0f
for event in events.values
if event.tile_id >= 0 and event != self_event and
event.x == x and event.y == y and not event.through
if @passages[event.tile_id] & bit != 0
return false
elsif @passages[event.tile_id] & 0x0f == 0x0f
return false
elsif @priorities[event.tile_id] == 0
return true
end
end
end
for i in [2, 1, 0]
tile_id = data[x, y, i]
if tile_id == nil
return false
elsif @passages[tile_id] & bit != 0
return false
elsif @passages[tile_id] & 0x0f == 0x0f
return false
elsif @priorities[tile_id] == 0
return true
end
end
return true
end
#--------------------------------------------------------------------------
# â— Checks if the "Obscure Character" flag is set for any of the three tiles
# at the specified X/Y coordinates.
# x : X Coordinate to check
# y : Y Coordinate to check
#--------------------------------------------------------------------------
def bush?(x, y)
if @map_id != 0
for i in [2, 1, 0]
tile_id = data[x, y, i]
if tile_id == nil
return false
elsif @passages[tile_id] & 0x40 == 0x40
return true
end
end
end
return false
end
#--------------------------------------------------------------------------
# â— Checks if the counter flag is set for any of the three tiles at the
# specified X/Y coordinates
# x : X coordinate to check
# y : Y coordinate to check
#--------------------------------------------------------------------------
def counter?(x, y)
if @map_id != 0
for i in [2, 1, 0]
tile_id = data[x, y, i]
if tile_id == nil
return false
elsif @passages[tile_id] & 0x80 == 0x80
return true
end
end
end
return false
end
#--------------------------------------------------------------------------
# â— Returns the terrain tag for the specified X and Y coordinates
# x : X coordinate to check
# y : Y coordinate to check
#--------------------------------------------------------------------------
def terrain_tag(x, y)
if @map_id != 0
for i in [2, 1, 0]
tile_id = data[x, y, i]
if tile_id == nil
return 0
elsif @terrain_tags[tile_id] > 0
return @terrain_tags[tile_id]
end
end
end
return 0
end
#--------------------------------------------------------------------------
# â— Return the event ID for the event at the X and Y coordinates passed to
# this method.
# x : X coordinate to check
# y : Y coordinate to check
#--------------------------------------------------------------------------
def check_event(x, y)
for event in $game_map.events.values
if event.x == x and event.y == y
return event.id
end
end
end
#--------------------------------------------------------------------------
# â— Scroll the camera across the map
# direction : Direction to scroll (2, 4, 6, 8).
# 2-Down
# 4-Left
# 6-Right
# 8-Up
# distance : Distance to scroll in tiles
# speed : Speed to scroll (1-6)
#--------------------------------------------------------------------------
def start_scroll(direction, distance, speed)
@scroll_direction = direction
@scroll_rest = distance * 128
@scroll_speed = speed
end
#--------------------------------------------------------------------------
# â— Checks if the screen is scrolling
#--------------------------------------------------------------------------
def scrolling?
return @scroll_rest > 0
end
#--------------------------------------------------------------------------
# â— Change the tone of the foreground
# tone : Value of the new tone
# duration : Transition time in frames
#--------------------------------------------------------------------------
def start_fog_tone_change(tone, duration)
@fog_tone_target = tone.clone
@fog_tone_duration = duration
if @fog_tone_duration == 0
@fog_tone = @fog_tone_target.clone
end
end
#--------------------------------------------------------------------------
# â— Change the opacity of the foreground
# opacity : Value of the new opacity
# duration : Transition time in frames
#--------------------------------------------------------------------------
def start_fog_opacity_change(opacity, duration)
@fog_opacity_target = opacity * 1.0
@fog_opacity_duration = duration
if @fog_opacity_duration == 0
@fog_opacity = @fog_opacity_target
end
end
#--------------------------------------------------------------------------
# â— Refresh the map each frame
#--------------------------------------------------------------------------
def update
if $game_map.need_refresh
refresh
end
if @scroll_rest > 0
distance = 2 ** @scroll_speed
case @scroll_direction
when 2
scroll_down(distance)
when 4
scroll_left(distance)
when 6
scroll_right(distance)
when 8
scroll_up(distance)
end
@scroll_rest -= distance
end
for event in @events.values
event.update
end
for common_event in @common_events.values
common_event.update
end
@fog_ox -= @fog_sx / 8.0
@fog_oy -= @fog_sy / 8.0
if @fog_tone_duration >= 1
d = @fog_tone_duration
target = @fog_tone_target
@fog_tone.red = (@fog_tone.red * (d - 1) + target.red) / d
@fog_tone.green = (@fog_tone.green * (d - 1) + target.green) / d
@fog_tone.blue = (@fog_tone.blue * (d - 1) + target.blue) / d
@fog_tone.gray = (@fog_tone.gray * (d - 1) + target.gray) / d
@fog_tone_duration -= 1
end
if @fog_opacity_duration >= 1
d = @fog_opacity_duration
@fog_opacity = (@fog_opacity * (d - 1) + @fog_opacity_target) / d
@fog_opacity_duration -= 1
end
end
end
#==============================================================================
# â–  Scene_Map
#------------------------------------------------------------------------------
#  This class handles the scene-related elements of the map, such as setting up
# the message window and calling various menus that would change the "Scene".
# Other duties, such as processing of map graphics and map events, are handled
# by the Game_Map class and its member objects.
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# â— Properties
# Global variables so the gold and help window can be controlled
# on the map.
#--------------------------------------------------------------------------
attr_accessor :gold_window
attr_accessor :help_window
#--------------------------------------------------------------------------
# â— Set up the scene
#--------------------------------------------------------------------------
def main
@spriteset = Spriteset_Map.new
@message_window = Window_Message.new
# Put gold on page
$gold_window = Window_Gold2.new
$gold_window.opacity = 0
$gold_window.x = -10
$gold_window.y = 410
# Put title on page
$help_window = Window_MapName.new
$help_window.opacity = 0
$help_window.x = -10
$help_window.y = 435
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose
@message_window.dispose
$help_window.dispose
$gold_window.dispose
if $scene.is_a?(Scene_Title)
Graphics.transition
Graphics.freeze
end
end
#--------------------------------------------------------------------------
# â— Update the map contents and processes input from the player
#--------------------------------------------------------------------------
def update
loop do
$game_map.update
$game_system.map_interpreter.update
$game_player.update
$game_system.update
$game_screen.update
unless $game_temp.player_transferring
break
end
transfer_player
if $game_temp.transition_processing
break
end
end
@spriteset.update
@message_window.update
$gold_window.update
if $game_temp.gameover
$scene = Scene_Gameover.new
return
end
if $game_temp.to_title
$scene = Scene_Title.new
return
end
if $game_temp.transition_processing
$game_temp.transition_processing = false
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
if $game_temp.message_window_showing
return
end
if $game_player.encounter_count == 0 and $game_map.encounter_list != []
unless $game_system.map_interpreter.running? or
$game_system.encounter_disabled
n = rand($game_map.encounter_list.size)
troop_id = $game_map.encounter_list[n]
if $data_troops[troop_id] != nil
$game_temp.battle_calling = true
$game_temp.battle_troop_id = troop_id
$game_temp.battle_can_escape = true
$game_temp.battle_can_lose = false
$game_temp.battle_proc = nil
end
end
end
# Open Menu at player's request
if Input.trigger?(Input::B)
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
$game_temp.menu_calling = true
$game_temp.menu_beep = true
end
end
# Open Journal at player's request (a)
if Input.press?(Input::X)
call_journal
end
# Open Item Menu at player's request (s)
if Input.trigger?(Input::Y)
call_items
end
# Open Options Menu at player's request (a)
if Input.press?(Input::Z)
call_options
end
if $DEBUG and Input.press?(Input::F9)
$game_temp.debug_calling = true
end
unless $game_player.moving?
if $game_temp.battle_calling
call_battle
elsif $game_temp.shop_calling
call_shop
elsif $game_temp.name_calling
call_name
elsif $game_temp.menu_calling
call_menu
elsif $game_temp.save_calling
call_save
elsif $game_temp.debug_calling
call_debug
end
end
end
#--------------------------------------------------------------------------
# â— Call the battle screen
#--------------------------------------------------------------------------
def call_battle
$game_temp.battle_calling = false
$game_temp.menu_calling = false
$game_temp.menu_beep = false
$game_player.make_encounter_count
$game_temp.map_bgm = $game_system.playing_bgm
$game_system.bgm_stop
$game_system.se_play($data_system.battle_start_se)
$game_system.bgm_play($game_system.battle_bgm)
$game_player.straighten
$scene = Scene_Battle.new
end
#--------------------------------------------------------------------------
# â— Open the Journal
#--------------------------------------------------------------------------
def call_journal
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
$game_system.se_play($data_system.decision_se)
$scene = Scene_Journal.new
end
end
#--------------------------------------------------------------------------
# â— Open the Save Menu
#--------------------------------------------------------------------------
def call_save
$game_player.straighten
$scene = Scene_Save.new
end
#--------------------------------------------------------------------------
# â— Open the Item Menu
#--------------------------------------------------------------------------
def call_items
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
end
end
#--------------------------------------------------------------------------
# â— Open the shop window
#--------------------------------------------------------------------------
def call_shop
$game_temp.shop_calling = false
$game_player.straighten
$scene = Scene_Shop.new
end
#--------------------------------------------------------------------------
# â— Open the Hero Name window
#--------------------------------------------------------------------------
def call_name
$game_temp.name_calling = false
$game_player.straighten
$scene = Scene_Name.new
end
#--------------------------------------------------------------------------
# â— Open the save window
#--------------------------------------------------------------------------
def call_options
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
$option_menu_on = 1
$game_system.se_play($data_system.decision_se)
$scene = Scene_Save.new
end
end
#--------------------------------------------------------------------------
# â— Opens the Main Menu
#--------------------------------------------------------------------------
def call_menu
$game_temp.menu_calling = false
if $game_temp.menu_beep
$game_system.se_play($data_system.decision_se)
$game_temp.menu_beep = false
end
$game_player.straighten
$scene = Scene_Menu.new
end
#--------------------------------------------------------------------------
# â— Open the Debug Window (f9 during gameplay)
#--------------------------------------------------------------------------
def call_debug
$game_temp.debug_calling = false
$game_system.se_play($data_system.decision_se)
$game_player.straighten
$scene = Scene_Debug.new
end
#--------------------------------------------------------------------------
# â— Teleport the Player
#--------------------------------------------------------------------------
def transfer_player
$game_temp.player_transferring = false
# Map to teleport to
if $game_map.map_id != $game_temp.player_new_map_id
$game_map.setup($game_temp.player_new_map_id)
$help_window.update
end
# Location on the map to teleport to
$game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
# Direction the player should face
case $game_temp.player_new_direction
when 2 # Down
$game_player.turn_down
when 4 # Left
$game_player.turn_left
when 6 # Right
$game_player.turn_right
when 8 # Up
$game_player.turn_up
end
$game_player.straighten
$game_map.update
@spriteset.dispose
@spriteset = Spriteset_Map.new
if $game_temp.transition_processing
$game_temp.transition_processing = false
Graphics.transition(20)
end
$game_map.autoplay
Graphics.frame_reset
Input.update
end
end
#==============================================================================
# QuesTMajoR's Gold Transparent Window
#------------------------------------------------------------------------------
#==============================================================================
class Window_Gold2 < Window_Base
#--------------------------------------------------------------------------
# â— Initializes the 'Currency' window
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 21
refresh
end
#--------------------------------------------------------------------------
# â— Draw the content of the window
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.bold = false
self.contents.font.size = 15
pic1 = RPG::Cache.icon("post-22158-0-60751400-1344399409")
x = 28
y = 0
x2 =120
y2 = 32
text = $game_party.gold.to_s
align = 1
rect = Rect.new(x, y, x2, y2)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
# shadow
self.contents.font.color = knockout_color
self.contents.draw_text(x+1, y, x2, y2, text)
self.contents.draw_text(x-1, y, x2, y2, text)
self.contents.draw_text(x, y+1, x2, y2, text)
self.contents.draw_text(x, y-1, x2, y2, text)
# text
self.contents.font.color = normal_color
self.contents.draw_text(x, y, x2, y2, text)
self.contents.blt(0, 0, pic1, Rect.new(0,0,33,48))
end
#--------------------------------------------------------------------------
# â— Update the content of the window
#--------------------------------------------------------------------------
def update
super
refresh
end
end
#==============================================================================
# QuesTMajoR's Map Name Transparent Window
#------------------------------------------------------------------------------
class Window_MapName < Window_Base
#--------------------------------------------------------------------------
# â— Initializes the 'Currency' window
#--------------------------------------------------------------------------
def initialize
super(0, 0, 260, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
refresh
end
#--------------------------------------------------------------------------
# â— Draw the content of the window
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.bold = false
self.contents.font.size = 15
pic1 = RPG::Cache.icon("post-22158-0-35001600-1344399423")
x = 28
y = 0
x2 =120
y2 = 32
text = $game_map.map_name.to_s
align = 1
rect = Rect.new(x, y, x2, y2)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
# shadow
self.contents.font.color = system_color
self.contents.draw_text(x+1, y, x2, y2, text)
self.contents.draw_text(x-1, y, x2, y2, text)
self.contents.draw_text(x, y+1, x2, y2, text)
self.contents.draw_text(x, y-1, x2, y2, text)
# text
self.contents.font.color = knockout_color
self.contents.draw_text(x, y, x2, y2, text)
self.contents.blt(0,4, pic1, Rect.new(0,0,33,48))
end
#--------------------------------------------------------------------------
# â— Update the content of the window
#--------------------------------------------------------------------------
def update
super
refresh
end
end


INSTRUCTIONS
Place this Script above main. You Need this Icons that must be placed on "Graphics/Icons/".

post-22158-0-60751400-1344399409.png
post-22158-0-35001600-1344399423.png

DEMO
EXPIRED

CREDITS
QuesTMajoR - For the Script Building...

Edited by QuesTMajoR

Share this post


Link to post
Share on other sites

uhmm whats up with the dual posts? anyway. i want to ask how do you disable this script. Theres a time I dont want to display the map names because most of my map have a guide extensions on it(ex. Annie's House_No Doors, Nerima Future1, Tsuburu Island_Restricted). I really dont want to edit those extensions. I want to edit the map names displayed in what I want it to be.

Share this post


Link to post
Share on other sites

Oh Sorry about the Double Post, my Internet connection is gone crazy...

 

Anyway.. If you want to disable it. Call This Script Lines:

 

If You Want to Hide:

 

$gold_window.contents_opacity = 0

$help_window.contents_opacity = 0

 

 

If You Want to Show it Again:

 

$gold_window.contents_opacity = 255

$help_window.contents_opacity = 255

 

 

biggrin.png

 

The Name that is Displayed on the Map is Automatically Changing, it depends on the name that you entered.

Edited by QuesTMajoR

Share this post


Link to post
Share on other sites
The Spoiler is not working :(

 

Oh, seems like your Internet connection made the spoilers not working.

I already changed the script storage into a

 

If you want to hide the Display just simply call these script lines :

 

$help.window.contents_opacity = 0
$gold.window.contents_opacity = 0

 

And To Show It Again

 

$help.window.contents_opacity = 255
$gold.window.contents_opacity = 255
Edited by QuesTMajoR

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...