I was trying to call a common event from the title screen but I got a problem. I keep getting this;
Script 'Scene_Title' line 174: NoMethodError occured.
undefined method 'common_event_id=' for nil:class
Here's a link to the script (http://h1.ripway.com/WingTSG/Scene_Title.txt)
Can you even do that!?
No idea... I just thought it would be easier for something I have planned. It worked for normal menus but I guess the title screen is different :P
Haha, I wouldn't think it would, because if New Game or Continue Game hasn't been selected yet, then the Common Events haven't even been loaded yet, right?
I dunno, I thought it was because before any options there's this;
# Load database
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
So I just assumed :roll:
I have no clue chief, I can't script, so I don't know how the load process itself works...
Same here I just looked at the scripts and started guessing :P Except for the common event thing, Juan told how to call a common event from a script (at least I think it Juan... :P )
$game_temp.common_event_id = 01
There shouldn't be a leading 0. So it should just be 1
Nope, still get the error :P
Can't you make the title scene a map and have that launch a Common Event, therefore making a Common Event from the title screen? :???:
I don't know, shooting wild things out of the blue, don't mind me.
Okay you need to put this under def main then call the common event and see if it works.
# Load database
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
after that than try calling the common event.
(A) $game_temp is not initialized until new game or Continue are selected, thus you are trying to use a method on a nil variable.
(B) It wouldn't work straight from the title because common events are updated in $game_map ~ meaning $game_map must exist and be updating.
There might be more that I'm missing since this is just off the top of my head, but the bottom line is that you should initialize all your $game_ variables ~ there might be a few you can ignore, but since you're calling Scene_Map you'll need at least all the $game_ variables involvedin operating that. I wouldn't mix common events in with this type of script though - better to design your own scene.