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.
Custom Menu Commands (Story Mode, Campaign Mode, Options and Shutdown)
RGSS3 Script RequestsYou'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", 😮ptions)
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.
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", 😮ptions)
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.
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.
the method it show you is incomplet what it will do if you do a campaign mode or a story mode?
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", 😮ptions)
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.
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", 😮ptions)
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.
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?
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?
Moving to script requests.
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.
Someone actually made a script similar to that here: http://www.rpgmakervxace.net/topic/30853-triple-ending-game-instances/
Original thread: https://forums.rpgmakerweb.com/threads/custom-menu-commands-story-mode-campaign-mode-options-and-shutdown.38941/