Chaos Project

RPG Maker => RPG Maker Scripts => Topic started by: Hellfire Dragon on February 02, 2009, 12:22:20 pm

Title: Common event from title screen...?
Post by: Hellfire Dragon on February 02, 2009, 12:22:20 pm
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)
Title: Re: Common event from title screen...?
Post by: Calintz on February 02, 2009, 04:46:47 pm
Can you even do that!?
Title: Re: Common event from title screen...?
Post by: Hellfire Dragon on February 02, 2009, 05:31:30 pm
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
Title: Re: Common event from title screen...?
Post by: Calintz on February 02, 2009, 05:38:10 pm
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?
Title: Re: Common event from title screen...?
Post by: Hellfire Dragon on February 02, 2009, 05:39:53 pm
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:
Title: Re: Common event from title screen...?
Post by: Calintz on February 02, 2009, 05:41:33 pm
I have no clue chief, I can't script, so I don't know how the load process itself works...
Title: Re: Common event from title screen...?
Post by: Hellfire Dragon on February 02, 2009, 05:42:58 pm
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 )
Title: Re: Common event from title screen...?
Post by: Aqua on February 02, 2009, 05:52:43 pm
$game_temp.common_event_id = 01


There shouldn't be a leading 0.  So it should just be 1
Title: Re: Common event from title screen...?
Post by: Hellfire Dragon on February 02, 2009, 05:56:27 pm
Nope, still get the error :P
Title: Re: Common event from title screen...?
Post by: Starrodkirby86 on February 02, 2009, 06:16:51 pm
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.
Title: Re: Common event from title screen...?
Post by: G_G on February 02, 2009, 06:51:18 pm
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.
Title: Re: Common event from title screen...?
Post by: modern algebra on February 04, 2009, 09:23:01 pm
(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.