Custom Menu Commands (Story Mode, Campaign Mode, Options and Shutdown)

PlexaryDamato

Veteran
Veteran
Joined
Jan 12, 2014
Messages
40
Reaction score
10
First Language
Spanish
Primarily Uses
Hey, what's up. I'm looking for a little help here, I want to modify the title's command window so it displays four options: Story Mode, Campaign Mode, Options and Shutdown. Anything of the likes of this description is more than welcomed.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,960
First Language
English
Primarily Uses
RMMV
You'd have to make a new script that overloads the default command window:

class Window_TitleCommand < Window_Command

  def make_command_list

    add_command("Story Mode" (you could always change the new game part of the database to Story Mode and keep this as Vocab::new_game), :story_mode (or keep this as :new_game))

    add_command("Campaign Mode", :campaign_mode)

    add_command("Options", :options)

    add_command(Vocab::shutdown, :shutdown)

  end

end

You would then need to add methods called story_mode, campaign_mode and options to process the appropriate choices from there.
 

PlexaryDamato

Veteran
Veteran
Joined
Jan 12, 2014
Messages
40
Reaction score
10
First Language
Spanish
Primarily Uses
So adding another script (presumably above Main) solves this? Also, it'd be great if someone could bring a somewhat more detailed tutorial of how to make it.
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
the method it show you is incomplet what it will do if you do a campaign mode or a story mode? 
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,960
First Language
English
Primarily Uses
RMMV
Somewhere above Main, yes.

I'm not sure this qualifies as a tutorial, but I'll try to explain it in more depth.

make_command_list in Window_TitleCommand is the method which shows all your menu commands. Each command is added via a call to "add_command", which takes up to four arguments: the name of the command, its associated symbol, a flag determining whether it's enabled, and arbitrary extended data (which as far as I can tell is only used to record the skill type ID of skill commands in battle). For example, the default menu:

add_command(Vocab::new_game, :new_game)

add_command(Vocab::continue, :continue, continue_enabled)

add_command(Vocab::shutdown, :shutdown)

 

This shows that the window will have three commands: the first will be called whatever string is set by Vocab::new_game, which is "New Game". Its associated symbol will be :new_game. Second will be "Continue" with the symbol :continue. Whether it's enabled or not will be determined by the flag continue_enabled. Finally is the shut down command, which will be called "Shut Down" and its associated symbol will be :shutdown

 

I actually missed a step as the associated symbol is only the first part of incorporating custom commands. Now that you have your command list:

 

class Window_TitleCommand < Window_Command

  def make_command_list

    add_command("Story Mode" :story_mode)

    add_command("Campaign Mode", :campaign_mode)

    add_command("Options", :options)

    add_command(Vocab::shutdown, :shutdown)

  end

end


you set the handler methods for these symbols in Scene_Title:

class Scene_Title < Scene_Base

  def create_command_window

    @command_window.set_handler:)story_mode, method:)command_story_mode))

    @command_window.set_handler:)campaign_mode, method:)command_campaign_mode))

    @command_window.set_handler:)options, method:)command_options))

    @command_window.set_handler:)shutdown, method:)command_shutdown))

  end

end

set_handler is a method available to any selectable window and determines a method which will be called if the player chooses the command with the given associated symbol. For instance, as you've associated the symbol :story_mode with your "Story Mode" command, you can now call set_handler to have the command with the :story_mode symbol call the method command_story_mode.

Now you need to create methods for the commands to actually perform the things they're intended for. If you look at command_new_game for example, you'll see what happens when a player selects "New Game" in the default title menu.

def command_new_game

    DataManager.setup_new_game

    close_command_window

    fadeout_all

    $game_map.autoplay

    SceneManager.goto(Scene_Map)

  end

 

You'll have to make your own methods for story mode, campaign mode, and options.
 
Last edited by a moderator:

PlexaryDamato

Veteran
Veteran
Joined
Jan 12, 2014
Messages
40
Reaction score
10
First Language
Spanish
Primarily Uses
Could I ask something? Since I want two game modes I thought maybe I could declare a variable that would set equal to either 1 or 2, and depending on which of them is set there would be a conditional branch that would take me to the Campaign Mode start map or let me stay in the Story Mode start map (I start by default in the Story Mode start map). Is there a way to make this happen?

Also, I would want to have save slots for each campaign, which means that if I save my progress on Story Mode when I open Campaign Mode said save won't appear. How do I do that?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,960
First Language
English
Primarily Uses
RMMV
That's a bit more involved. If I get time today I'll explain how to do that, but as a general bit of advice what you're looking to do will involve setting a temporary variable to track which mode was chosen, and edit the setup_new_game method in DataManager so it has an if statement determining what the start map/coordinates are. As for having separate saves, that would involve having a duplicate contents variable in DataManager and, again, branching to see what the mode variable is to determine which contents set to save to/load from.
 

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
First Language
Irish
Primarily Uses
N/A
Could I ask something? Since I want two game modes I thought maybe I could declare a variable that would set equal to either 1 or 2, and depending on which of them is set there would be a conditional branch that would take me to the Campaign Mode start map or let me stay in the Story Mode start map (I start by default in the Story Mode start map). Is there a way to make this happen?

Also, I would want to have save slots for each campaign, which means that if I save my progress on Story Mode when I open Campaign Mode said save won't appear. How do I do that?
Someone actually made a script similar to that here: http://www.rpgmakervxace.net/topic/30853-triple-ending-game-instances/
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,070
Members
137,577
Latest member
SadaSoda
Top