death by moogles
Member
I'm writing this script for interaction with an evented AI. The script works fine, but the command window isn't visible at all.
I know that it's something simple that I've just overlooked, but I have no idea what it is. How do I make the command window actually show up? This is only my second script ever, so take it easy. I want to learn though, so if you have any suggestions, let me know!
One thanks in advance!
EDIT: In addition to this, I'd really like it if I could completely take the option out if the switch isn't on. So, if switch 4 isn't on, the command window's list will only consist of "Giza Plains," because the first option, "Rabanastre," is completely omitted from the list. How do I go about doing this?
Code:
class Scene_AutoPilot
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# * Main
#--------------------------------------------------------------------------
def main
# Make sprite set
@spriteset = Spriteset_Map.new
# Make command window
s1 = "Rabanastre"
s2 = "Giza Plains"
@command_window = Window_Command.new(160, [s1, s2])
@command_window.index = @menu_index
# Determine whether each location can be visited or not.
if $game_switches[4] == false # Rabanastre
@command_window.disable_item(0)
end
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@command_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@command_window.update
# If command window is active: call update_command
if @command_window.active
update_command
return
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update_command
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
$scene = Scene_Map.new
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0 # Rabanastre
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Go to Rabanastre
$game_switches[101] = true
$game_map.need_refresh = true
# Close window
$scene = Scene_Map.new
when 1 # Giza Plains
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Go to Giza Plains
$game_switches[102] = true
$game_map.need_refresh = true
# Close window
$scene = Scene_Map.new
return
end
end
end
end
I know that it's something simple that I've just overlooked, but I have no idea what it is. How do I make the command window actually show up? This is only my second script ever, so take it easy. I want to learn though, so if you have any suggestions, let me know!
One thanks in advance!
EDIT: In addition to this, I'd really like it if I could completely take the option out if the switch isn't on. So, if switch 4 isn't on, the command window's list will only consist of "Giza Plains," because the first option, "Rabanastre," is completely omitted from the list. How do I go about doing this?