05-30-2008, 01:00 PM
TDS Map Name Pop-Up
Introduction
Well this has been done before countless times, but I still wanted to make it.
Features
Shows the name of the map when you enter it or choose to show it by using a script call.
Script
Instructions
To change how long the pop up window stays visible on screen find this line on the script(Line 49)
Then change the 120 to the number of frames you wish for it to show.
If you wish to change wether or not to show the pop up window when the game starts find this line in the script(Line 51)
Change it to true if you wish for it to show when a new game starts and change it to false if you dont want it to show when a new game starts.
Advance - Script related calls.
Compatibility
None that I know so far.
Credits and Thanks
TDS
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
No support is given. If you are the owner of the thread, please contact administration.
Introduction
Well this has been done before countless times, but I still wanted to make it.
Features
Shows the name of the map when you enter it or choose to show it by using a script call.
Script
"Script"
Code:
#==============================================================================
# ** TDS Map Name Pop-Up
# Version: 1.5
#------------------------------------------------------------------------------
# This script will display the name of the map when you enter it.
#==============================================================================
# WARNING:
#
# Do not release, distribute or change my work without my expressed written
# consent, doing so violates the terms of use of this work.
#
# * Not Knowing English or understanding these terms will not excuse you in any
# way from the consequenses.
#
# Contact Email: Sephirothtds@hotmail.com
#==============================================================================
# Instructions:
#
# To not show the map name use this in a call script.
# $game_temp.show_map_pop_up = false
#
# To make it show the name of the map again
# $game_temp.show_map_pop_up = true
#
#
# For changing the position of where the window shows up use this in a script
# call:
#
# $game_temp.map_pop_up_position = Value
#
# Value = Is the numerical value for the postion of the window.
# 1 = up
# 2 = down
#
# Example:
# $game_temp.map_pop_up_position = 1
#
# To call the map name window in any place you wish simply use this in a call
# script.
#
# $game_temp.map_pop_up_force_show = true
#
#==============================================================================
#--------------------------------------------------------------------------
# * Constants
#--------------------------------------------------------------------------
# Constant to hold value for time
MAP_NAME_DISPLAY_TIME = 120
# Constant to determine if at the start of the game the window will show
MAP_NAME_DISPLAY_NEW_GAME = false
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
# This class handles temporary data that is not included with save data.
# The instance of this class is referenced by $game_temp.
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :show_map_pop_up # Display flag for effect
attr_accessor :map_pop_up_position # Position of the Map name window
attr_accessor :map_pop_up_force_show # Forced showing flag
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias tds_map_name_popup_game_temp_initialize initialize
def initialize
@show_map_pop_up = true
@map_pop_up_position = 1
@map_pop_up_force_show = false
tds_map_name_popup_game_temp_initialize
end
end
#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
# This class performs the title screen processing.
#==============================================================================
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# * Command: New Game
#--------------------------------------------------------------------------
def command_new_game
confirm_player_location
Sound.play_decision
$game_party.setup_starting_members # Initial party
$game_map.setup($data_system.start_map_id) # Initial map position
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$scene = Scene_Map.new(MAP_NAME_DISPLAY_NEW_GAME)
RPG::BGM.fade(1500)
close_command_window
Graphics.fadeout(60)
Graphics.wait(40)
Graphics.frame_count = 0
RPG::BGM.stop
$game_map.autoplay
end
end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs the map screen processing.
#==============================================================================
class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias tds_map_name_popup_initialize initialize
def initialize(show_map_name = $game_temp.show_map_pop_up)
@show_map_name = show_map_name
@current_map_id = $game_map.map_id
tds_map_name_popup_initialize
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
alias tds_map_name_popup_start start
def start
super
$game_map.refresh
@spriteset = Spriteset_Map.new
@message_window = Window_Message.new
# Get the name of the current map
get_map_name
# Create Map Pop Up window
create_map_name_window
# If not
if @show_map_name
@map_name_display.open
end
tds_map_name_popup_start
end
#--------------------------------------------------------------------------
# * Get Map Name
#--------------------------------------------------------------------------
def get_map_name
# Current Map ID
@current_map_id = $game_map.map_id
# Set Map Name
@map = load_data("Data/MapInfos.rvdata")
@map_name = @map[$game_map.map_id].name
return
end
#--------------------------------------------------------------------------
# * Create Map Name Window
#--------------------------------------------------------------------------
def create_map_name_window
# Map Counter timer initial time
@map_counter = 0
@map_counter %= MAP_NAME_DISPLAY_TIME
@map_name_display = Window_Base.new(0, 5, Graphics.width, 64)
width = @map_name_display.contents.text_size(@map_name.to_s).width
@map_name_display.width = width + 60
@map_name_display.x = Graphics.width / 2 - @map_name_display.width / 2
@map_name_display.y = ($game_temp.map_pop_up_position == 1 ? 5 : 350 )
@map_name_display.create_contents
@map_name_display.openness = 0
@map_name_display.contents.draw_text(0,0, width + 29, 32, @map_name.to_s,1)
end
#--------------------------------------------------------------------------
# * Show Map Name Window
#--------------------------------------------------------------------------
def show_map_name_window
return if $game_temp.show_map_pop_up == false
$game_temp.map_pop_up_force_show = false if $game_temp.map_pop_up_force_show
get_map_name
if @map_name_display.disposed?
create_map_name_window
end
@map_counter = 0
@map_name_display.visible = true
@map_name_display.open
end
#--------------------------------------------------------------------------
# * Player Transfer Processing
#--------------------------------------------------------------------------
alias tds_map_name_popup_update_transfer_player update_transfer_player
def update_transfer_player
return unless $game_player.transfer?
fade = (Graphics.brightness > 0)
fadeout(30) if fade
@spriteset.dispose # Dispose of sprite set
if !@map_name_display.disposed?
@map_name_display.dispose # Dispose of display window
end
$game_player.perform_transfer # Execute player transfer
$game_map.autoplay # Automatically switch BGM and BGS
$game_map.update
Graphics.wait(15)
@spriteset = Spriteset_Map.new # Recreate sprite set
fadein(30) if fade
Input.update
# If current map is not the same as the old one
if @current_map_id != $game_map.map_id
show_map_name_window
end
tds_map_name_popup_update_transfer_player
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias tds_map_name_popup_update update
def update
super
@map_counter += 1 if @map_counter != MAP_NAME_DISPLAY_TIME
@map_name_display.update if !@map_name_display.disposed?
if $game_temp.map_pop_up_force_show
show_map_name_window
end
if !@map_name_display.disposed?
if @map_name_display.openness == 255 and @map_counter == MAP_NAME_DISPLAY_TIME
@map_name_display.close
@map_counter = 0
end
end
tds_map_name_popup_update
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
alias tds_map_name_popup_terminate terminate
def terminate
@map_name_display.dispose
tds_map_name_popup_terminate
super
end
end
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs the menu screen processing.
#==============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# * Update Command Selection
#--------------------------------------------------------------------------
alias tds_map_name_popup_menu_update_command_selection update_command_selection
def update_command_selection
tds_map_name_popup_menu_update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
# Test - Once you go back to map name wont show again
$scene = Scene_Map.new(false)
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # Item
$scene = Scene_Item.new
when 1,2,3 # Skill, equipment, status
start_actor_selection
when 4 # Save
$scene = Scene_File.new(true, false, false)
when 5 # End Game
$scene = Scene_End.new
end
end
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# * End Battle
# result : Results (0: win, 1: escape, 2:lose)
#--------------------------------------------------------------------------
alias tds_map_name_popup_battle_battle_end battle_end
def battle_end(result)
tds_map_name_popup_battle_battle_end(result)
if result == 2 and not $game_troop.can_lose
call_gameover
else
$game_party.clear_actions
$game_party.remove_states_battle
$game_troop.clear
if $game_temp.battle_proc != nil
$game_temp.battle_proc.call(result)
$game_temp.battle_proc = nil
end
unless $BTEST
$game_temp.map_bgm.play
$game_temp.map_bgs.play
end
$scene = Scene_Map.new(false)
@message_window.clear
Graphics.fadeout(30)
end
$game_temp.in_battle = false
end
end
Instructions
To change how long the pop up window stays visible on screen find this line on the script(Line 49)
Code:
MAP_NAME_DISPLAY_TIME = 120
Then change the 120 to the number of frames you wish for it to show.
If you wish to change wether or not to show the pop up window when the game starts find this line in the script(Line 51)
Code:
MAP_NAME_DISPLAY_NEW_GAME = false
Change it to true if you wish for it to show when a new game starts and change it to false if you dont want it to show when a new game starts.
Advance - Script related calls.
Code:
# Instructions:
#
# To not show the map name use this in a call script.
# $game_temp.show_map_pop_up = false
#
# To make it show the name of the map again
# $game_temp.show_map_pop_up = true
#
#
# For changing the position of where the window shows up use this in a script
# call:
#
# $game_temp.map_pop_up_position = Value
#
# Value = Is the numerical value for the postion of the window.
# 1 = up
# 2 = down
#
# Example:
# $game_temp.map_pop_up_position = 1
#
# To call the map name window in any place you wish simply use this in a call
# script.
#
# $game_temp.map_pop_up_force_show = true
#
Compatibility
None that I know so far.
Credits and Thanks
TDS