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
1,483
Reaction score
984
First Language
English
Primarily Uses
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,600
Reaction score
2,359
First Language
French
Primarily Uses
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
1,483
Reaction score
984
First Language
English
Primarily Uses
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?
 

Celianna

Tileset artist
Global Mod
Joined
Mar 1, 2012
Messages
10,532
Reaction score
5,539
First Language
Dutch
Primarily Uses
RMMV
Moving to script requests.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
1,483
Reaction score
984
First Language
English
Primarily Uses
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,282
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

Jamaica? No, Aunty. I said, I'm on RPG Maker :*/
Lunar New Year is over :( but it's time to get back to work!
I keep giving myself deadlines because I'm so excited to finish something but I notice areas where I'm rushing the story and that's what's gonna weaken my overall project, gotta stop that
My new level features a Jellyfish character who cannot love, because he electrocutes everything he touches.
I prefer single roommates. After a hard day, all you want is sleep. I went to bed at 12. I was awakened at 2 because of my roommate laughing and whispering and stuff with her boyfriend on the phone. I didn't want to yell at her so I had to bear that cringy lovey dovey convo for half an hour, before I got so bored that I fell asleep again.

Forum statistics

Threads
93,690
Messages
914,644
Members
123,287
Latest member
Jackosmiles
Top