I'm trying to get my game to start in a map so I can event an opening.
I've achieved that, but I get an error when starting a new game:
Exception: NoMethodError
Message: undefined method `update' for nil:NilClass
PokemonMessages:21:in `updatemini'
PokemonMessages:67:in `pbUpdateSceneMap'
PokemonMessages:886:in `pbDisplayMessageFancy'
PokemonMessages:587:in `pbMessage'
PokemonMessages:278:in `command_101'
Interpreter:276:in `execute_command'
Interpreter:190:in `update'
Interpreter:104:in `loop'
Interpreter:195:in `update'
Scene_Map:99:in `update'
My "Main":
Code:
def pbCallTitle
return Scene_Intro.new('Pic_2')
end
def mainFunction
return pbCriticalCode {
Graphics.frame_count = 0
$game_system=Game_System.new
$game_temp = Game_Temp.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_player = Game_Player.new
$ItemData=readItemList("Data/items.dat")
$PokemonMap=PokemonMapMetadata.new
$PokemonGlobal=PokemonGlobalMetadata.new
$PokemonStorage=PokemonStorage.new
$PokemonEncounters=PokemonEncounters.new
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_system = load_data("Data/System.rxdata")
$MapFactory=PokemonMapFactory.new(5)
$game_player.moveto(0, 0)
setScreenBorderName("border.png")
Graphics.update
Graphics.freeze
# Refresh player
$game_player.refresh
# Run automatic change for BGM and BGS set with map
$game_map.autoplay
# Update map (run parallel process event)
$game_map.update
$scene = Scene_Map.new
#$scene = pbCallTitle
while $scene != nil
$scene.main
end
Graphics.transition(20)
}
end
loop do
retval=mainFunction
if retval==0 # failed
loop do
Graphics.update
end
elsif retval==1 # ended successfully
break
end
end
How I "start" the game after the title:
Code:
@> Script:
Audio.bgm_stop
sscene=PokemonLoadScene.new
sscreen=PokemonLoad.new(sscene)
sscreen.pbStartLoadScreen
I only get this error when starting a new game, but when selecting continue the map just "appears" rather than the normal fade in before I altered the Main script. :/