Sobeman459
Member
Ok i get his error when i try using the script below. Any help would be appreciated Im triing to finish this scrip asap.
http://img264.imageshack.us/img264/8301/errorjb7.png[/IMG]
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
http://img264.imageshack.us/img264/8301/errorjb7.png[/IMG]
Code:
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs menu screen processing.
#==============================================================================
class Scene_PokeGear
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(poke_index = 0)
@poke_index = poke_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
a = 300 #Width - REQUIRED
b = ['Return','Radio','Phone', 'Map'] #Commands - REQUIRED
c = 1 #Type (0 = Vertical, 1 = Horizontal) - OPTIONAL
d = nil #Text Alignment (0 = Left, 1 = Center, 2 = Right) - OPTIONAL
e = nil #Commands When Selected (EX: N E W G A M E) - OPTIONAL
f = nil #Color of Selected Command - OPTIONAL
g = nil #Icon names (EX: ['Icon1','Icon2','Icon3'] - OPTIONAL
@command_window = Window_Command2.new(a,b,c,d,e,f,g)
@command_window.index = @poke_index
# Make game over graphic
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.picture('pkmn map.png')
@sprite.visible = false
# Execute transition
Graphics.transition
# 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
if @sprite.visible = true
update_map
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
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)
# If command other than save or end game, and party members = 0
if $game_party.actors.size == 0 and @command_window.index < 4
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Branch by command window cursor position
case @command_window.index
when 0 # item
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to item screen
$scene = Scene_Item.new
when 1 # skill
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3 #pokegear
# Play decision SE
$game_system.se_play($data_system.decision_se)
@sprite.visible = true
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when map is active)
#--------------------------------------------------------------------------
def update_map
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map visible off
@sprite.visible = false
return
end
end
end
end
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