#========================================================
#
# Rune's CMS # 4
# Ver. 1.1
#
#========================================================
# Features
#
# • 4 - Person CMS
# • Face lift since last version
# • Teleport function
# • Scrolling teleport window
# • Scrolling Command window
# • One command per line (Command window, used to be 2)
#
#========================================================
# Instructions
#
# • In Scene_Save, search for
# $scene = Scene_Menu.new(4)
# Change the 4 to a 5
# Repeat, there are two of these lines.
#
# • Then, in Scene_End, search for
# $scene = Scene_Menu.new(5)
# Change the 5 to a 6
# Again, repeat. There are two of these lines.
#
# • Rest throughout script
#
#========================================================
# Credit
#
# • Rune (Me)
#
#========================================================
# Skills Required
#
# • Creating and handling Variables
# • Changing Strings (Purple text in scripting)
#
#========================================================
# Known Incompatibility Issues
#
# • My Simple HUD, and just about everything else that
# uses a location display.
#
#========================================================
# Other Comments
#
# Any problems or queries, contact me via PM, or
# by MSN (rune-666@hotmail.co.uk).
#
#========================================================
#========================
#
# Window_Command rewrite
#
#========================
class Window_Command < Window_Selectable
def initialize(width, commands, style = 0, inf_scroll = 1)
super(0, 0, width, commands.size * 32 + 32)
@inf_scroll = inf_scroll
@item_max = commands.size
@commands = commands
@style = style
self.contents = Bitmap.new(width - 32, @item_max * 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 22
refresh
self.index = 0
end
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
def draw_item(index, color)
self.contents.font.color = color
rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index], @style)
end
def disable_item(index)
draw_item(index, disabled_color)
end
def update_help
@help_window.set_actor($game_party.actors[$scene.actor_index])
end
end
#========================
#
# Window_MenuStatus edit
#
#========================
class Window_MenuStatus
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 116, self.width - 32, 100)
end
end
end
#========================
#
# Menu Scene
#
#========================
class Scene_Menu
def initialize(menu_index = 0, tele_index = -1)
@menu_index = menu_index
@tele_index = tele_index
end
def main
s1 = "Inventory"
s2 = "Techniques"
s3 = "Equipment"
s4 = "Status"
s5 = "Teleport"
s6 = "Save Game"
s7 = "End Game"
#==========================================================
#
# Change the "Town 1", "Town 2", etc, to the names
# of the areas you would like to teleport to.
#
# Make a variable, call it something like "Tele_Areas"
# Change the number in square brackets ( [] ) to the
# ID if the variable.
#
# Whenever you want an area to become available for
# teleportation, add 1 to the variable.
#
# NOTE: State the areas in the order that they become
# available. Otherwise, the function won't work
# properly.
#
#==========================================================
if $game_variables[1] >= 1
t1 = "Hynda"
else
t1 = "-----"
end
if $game_variables[1] >= 2
t2 = "Kelva"
else
t2 = "-----"
end
if $game_variables[1] >= 3
t3 = "Strate"
else
t3 = "-----"
end
if $game_variables[1] >= 4
t4 = "Locko"
else
t4 = "-----"
end
if $game_variables[1] >= 5
t5 = "Fheltä"
else
t5 = "-----"
end
if $game_variables[1] >= 6
t6 = "Numiika"
else
t6 = "-----"
end
if $game_variables[1] >= 7
t7 = "Rech"
else
t7 = "-----"
end
if $game_variables[1] >= 8
t8 = "Vraij"
else
t8 = "-----"
end
if $game_variables[1] >= 9
t9 = "Klé"
else
t9 = "-----"
end
if $game_variables[1] >= 10
t10 = "Medolin"
else
t10 = "-----"
end
if $game_variables[1] >= 11
t11 = "Valraika"
else
t11 = "-----"
end
if $game_variables[1] >= 12
t12 = "Lohn"
else
t12 = "-----"
end
if $game_variables[1] >= 13
t13 = "Govik"
else
t13 = "-----"
end
if $game_variables[1] >= 14
t14 = "Cärukta"
else
t14 = "-----"
end
#==========================================================
#
# To make extra options, simply add underneath that
# last end:
#
# if $game_variables[1] >= 15
# t13 = "Town15"
# else
# t13 = "-----"
# end
# if $game_variables[1] >= 16
# t14 = "Town16"
# else
# t14 = "-----"
# end
#
# And so on...
#
#==========================================================
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7], 1, 1)
@command_window.index = @menu_index
@command_window.x = 480
@command_window.y = 0
@command_window.height = 32 * 5 + 1
#==========================================================
#
# At the end of the following line, make sure there
# are as many 't' numbers, as there are 't' options
# listed above.
#
#==========================================================
@tele_window = Window_Command.new(160, [t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14], 1, 1)
@tele_window.index = @tele_index
@tele_window.x = 480
@tele_window.y = 320
@tele_window.height = 32 * 5
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
#==========================================================
#
# If "Save" is disabled, so is "Teleport". To remove
# this feature, simply remove:
# @command_window.disable_item(4)
#
#==========================================================
if $game_system.save_disabled
@command_window.disable_item(4)
@command_window.disable_item(5)
end
#==========================================================
#
# Again, change the number in square brackets to the
# ID of the variable you made earlier.
#
#==========================================================
if $game_variables[1] < 1
@tele_window.disable_item(0)
end
if $game_variables[1] < 2
@tele_window.disable_item(1)
end
if $game_variables[1] < 3
@tele_window.disable_item(2)
end
if $game_variables[1] < 4
@tele_window.disable_item(3)
end
if $game_variables[1] < 5
@tele_window.disable_item(4)
end
if $game_variables[1] < 6
@tele_window.disable_item(5)
end
if $game_variables[1] < 7
@tele_window.disable_item(6)
end
if $game_variables[1] < 8
@tele_window.disable_item(7)
end
if $game_variables[1] < 9
@tele_window.disable_item(8)
end
if $game_variables[1] < 10
@tele_window.disable_item(9)
end
if $game_variables[1] < 11
@tele_window.disable_item(10)
end
if $game_variables[1] < 12
@tele_window.disable_item(11)
end
if $game_variables[1] < 13
@tele_window.disable_item(12)
end
if $game_variables[1] < 14
@tele_window.disable_item(13)
end
#==========================================================
#
# This makes unavailable options appear in gray.
#
# To add more to suit your selection of areas, simply
# add after that last end:
#
# if $game_variables[1] < 15
# @tele_window.disable_item(14)
# end
# if $game_variables[1] < 16
# @tele_window.disable_item(15)
# end
#
# And so on..
#
# NOTE: The numbers in the brackets (curved) and the
# numbers at the end of the lines that start with 'if'
# are different for a reason! The index for the
# bracketed numbers starts at 0.
#
#==========================================================
# Do not edit below until the next comment
#==========================================================
@playtime_window = Window_PlayTime.new
@playtime_window.x = 480
@playtime_window.y = 160
@gold_window = Window_Gold.new
@gold_window.x = 480
@gold_window.y = 256
@status_window = Window_MenuStatus.new
@status_window.x = 0
@status_window.y = 0
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@tele_window.dispose
@command_window.dispose
@playtime_window.dispose
@gold_window.dispose
@status_window.dispose
end
def update
@tele_window.update
@command_window.update
@playtime_window.update
@gold_window.update
@status_window.update
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
if @tele_window.active
update_tele
return
end
end
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
#==========================================================
#
# If "Teleport" is not disabled when "Save" is,
# delete the lines in-between the green lines.
#
#==========================================================
when 4
#----------------------------------------------------------
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
#----------------------------------------------------------
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@tele_window.active = true
@tele_window.index = 0
when 5
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Save.new
when 6
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new
end
return
end
end
def update_status
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 1
if $game_party.actors[@status_window.index].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
def update_tele
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@tele_window.active = false
@tele_window.index = -1
return
end
if Input.trigger?(Input::C)
case @tele_window.index
#==========================================================
#
# Once again, change the number in square brackets to
# the ID of the variable you made before.
#
#==========================================================
when 0
if $game_variables[1] >= 1
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
#==========================================================
#
# Change the ! to the ID of the map you would like
# this option to teleport the character to.
#
#==========================================================
$game_map.setup("8")
#==========================================================
#
# These are the co-ordinates of the position you would
# like to teleport to. The first 0 is the x co-ordinate
# and the second 0 is the y co-ordinate. (x, y)
#
#==========================================================
$game_player.moveto(5, 7)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
else
$game_system.se_play($data_system.buzzer_se)
return
end
#==========================================================
#
# The above three comments apply for all the options.
# Repeat them for each of the options. To help you
# distinguish between each option, I have separated
# them with green lines.
#
#==========================================================
when 1
if $game_variables[1] >= 2
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_map.setup("!")
$game_player.moveto(0, 0)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
else
$game_system.se_play($data_system.buzzer_se)
return
end
#==========================================================
when 2
if $game_variables[1] >= 3
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_map.setup("!")
$game_player.moveto(0, 0)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
else
$game_system.se_play($data_system.buzzer_se)
return
end
#==========================================================
when 3
if $game_variables[1] >= 4
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_map.setup("!")
$game_player.moveto(0, 0)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
else
$game_system.se_play($data_system.buzzer_se)
return
end
#==========================================================
when 4
if $game_variables[1] >= 5
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_map.setup("!")
$game_player.moveto(0, 0)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
else
$game_system.se_play($data_system.buzzer_se)
return
end
#==========================================================
when 5
if $game_variables[1] >= 6
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_map.setup("!")
$game_player.moveto(0, 0)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
else
$game_system.se_play($data_system.buzzer_se)
return
end
#==========================================================
when 6
if $game_variables[1] >= 7
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_map.setup("!")
$game_player.moveto(0, 0)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
else
$game_system.se_play($data_system.buzzer_se)
return
end
#==========================================================
when 7
if $game_variables[1] >= 8
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_map.setup("!")
$game_player.moveto(0, 0)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
else
$game_system.se_play($data_system.buzzer_se)
return
end
#==========================================================
when 8
if $game_variables[1] >= 8
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_map.setup("!")
$game_player.moveto(0, 0)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
else
$game_system.se_play($data_system.buzzer_se)
return
end
#==========================================================
when 9
if $game_variables[1] >= 10
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_map.setup("!")
$game_player.moveto(0, 0)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
else
$game_system.se_play($data_system.buzzer_se)
return
end
#==========================================================
when 10
if $game_variables[1] >= 11
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_map.setup("!")
$game_player.moveto(0, 0)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
else
$game_system.se_play($data_system.buzzer_se)
return
end
#==========================================================
when 11
if $game_variables[1] >= 12
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_map.setup("!")
$game_player.moveto(0, 0)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
else
$game_system.se_play($data_system.buzzer_se)
return
end
#==========================================================
when 12
if $game_variables[1] >= 13
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_map.setup("!")
$game_player.moveto(0, 0)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
else
$game_system.se_play($data_system.buzzer_se)
return
end
#==========================================================
when 13
if $game_variables[1] >= 14
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_map.setup("!")
$game_player.moveto(0, 0)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
else
$game_system.se_play($data_system.buzzer_se)
return
end
#==========================================================
#
# If you have more than 14 options, add, after that
# last end:
# when 14
# if $game_variables[1] >= 15
# $game_system.se_play($data_system.decision_se)
# Audio.bgm_stop
# Graphics.frame_count = 0
# $game_map.setup("!")
# $game_player.moveto(0, 0)
# $game_player.refresh
# $game_map.autoplay
# $game_map.update
# $scene = Scene_Map.new
# else
# $game_system.se_play($data_system.buzzer_se)
# return
# end
##==========================================================
# when 15
# if $game_variables[1] >= 16
# $game_system.se_play($data_system.decision_se)
# Audio.bgm_stop
# Graphics.frame_count = 0
# $game_map.setup("!")
# $game_player.moveto(0, 0)
# $game_player.refresh
# $game_map.autoplay
# $game_map.update
# $scene = Scene_Map.new
# else
# $game_system.se_play($data_system.buzzer_se)
# return
# end
#
# And so on...
#
# Repeat the last few comments again with these new
# additions.
#
#==========================================================
end
return
end
end
end