How to add a new command line to title screen?

Status
Not open for further replies.

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,359
Reaction score
7,672
First Language
German
Primarily Uses
RMMV
I want to know how to add a new command line to the title screen (in addition to "new game", "continue" and "shutdown").


It should execute a scenemanager.call and then return to the title screen.


More specifically it should call the language select from the SES External Text add-on:


http://pastebin.com/732n2WRf


And no, Yanfly's system options are NOT a solution as they replace one of the commands, they don't add to the same level.
 

Evgenij

Veteran
Veteran
Joined
Aug 28, 2013
Messages
349
Reaction score
100
First Language
German
Primarily Uses
N/A
You first need to add the command to the Window_TitleCommand class and after that add a handler method to the Scene_Title class:

#--------------------------------------------------------------------------# Add the visible language command to the title command window#--------------------------------------------------------------------------class Window_TitleCommand < Window_Command  #--------------------------------------------------------------------------  # * Create Command List  #--------------------------------------------------------------------------  def make_command_list    add_command(Vocab::new_game, :new_game)    add_command(Vocab::continue, :continue, continue_enabled)     # Replace "Vocab" with your vocabular for the scene    add_command("Vocab", :language)        add_command(Vocab::shutdown, :shutdown)  endend#--------------------------------------------------------------------------# Create Handler-Method for the new command#--------------------------------------------------------------------------class Scene_Title  #--------------------------------------------------------------------------  # * Create Command Window  #--------------------------------------------------------------------------  alias :old_create_command_window          :create_command_window  def create_command_window    old_create_command_window    @command_window.set_handler:)language, method:)command_language))  end   def command_language close_command_window    SceneManager.call(Scene_LanguageSelect)  endend*edit*

added the close_command_window call, thx to solistra.
 
Last edited by a moderator:

Solistra

Veteran
Veteran
Joined
Aug 15, 2012
Messages
593
Reaction score
247
Primarily Uses
I'm surprised anyone is still using that script, honestly -- I should probably encourage Enelvon to update it sometime. Anyway, that suggestion is good, I just wanted to point out that there's actually no need to create a command_language method, as you can just use a lambda to provide all of the functionality you need.

You'll still need that Window_TitleCommand portion that eugene222 posted, by the way.

Code:
class Scene_Title  alias :ses_multilang_st_ccw :create_command_window  def create_command_window(*args, &block)    ses_multilang_st_ccw(*args, &block)    @command_window.set_handler :language, -> do      close_command_window      SceneManager.call(Scene_LanguageSelect)    end  endend
That also closes the command window before calling the scene like every other command in the title window -- that seems to be the common convention.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,359
Reaction score
7,672
First Language
German
Primarily Uses
RMMV
Thanks to both

I'm surprised anyone is still using that script, honestly -- I should probably encourage Enelvon to update it sometime.
There aren't many alternatives if you want to make a multi-language game...
 

Solistra

Veteran
Veteran
Joined
Aug 15, 2012
Messages
593
Reaction score
247
Primarily Uses
That's true enough. I was just surprised to see someone using it due to its relative age and Enelvon's general absence from the RMW community (she's still around, though, so I'll see if I can convince her to update External Text or, alternatively, if she would mind if I start maintaining it myself).
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,359
Reaction score
7,672
First Language
German
Primarily Uses
RMMV
OK, I have an additional problem with the title line.

As said above, the line is for the multilanguage add-on, and that means I couldn't use the simple vocag of the original snippet above.

I changed it to use the get_text-function of the external text to get a language-specific vocab:

class Window_TitleCommand < Window_Command #-------------------------------------------------------------------------- # * Create Command List #-------------------------------------------------------------------------- def make_command_list add_command(Vocab::new_game, :new_game) add_command(Vocab::continue, :continue, continue_enabled) add_command(SES::ExternalText.get_text("Language"), :language) add_command(Vocab::shutdown, :shutdown) endendUnfortunately, this results in a junk symbol at the end of that vocab - the regular vocabs are correctly replaced with the language settings without problems, only the variant with the get_text has the problem.I assume that it might be a problem in the SES-Script in that function, but I'm not sure if changes there are still possible without causing other problems.

An alternative might be to add new vocabs to the original vocab module to allow for the same structure I'm using there, but again I'm not familiar enough with that section to know if that is a good idea or not...

multilanguagejunk.png
 

cabfe

Cool Cat
Veteran
Joined
Jun 13, 2013
Messages
2,353
Reaction score
2,549
First Language
French
Primarily Uses
RMVXA
That's slightly different from what you want to achieve, but for my game I skipped that requirement (change language in the title screen) by making the script call ( SceneManager.call(Scene_LanguageSelect) ) right after you select Start new game, in an "intro" map.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,359
Reaction score
7,672
First Language
German
Primarily Uses
RMMV
Unfortunately, I'll need the get_text at other places as well, not only for the lanuage selection screen.


I can't use workarounds everywhere, so I prefer to get the original bug identified and solved.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,359
Reaction score
7,672
First Language
German
Primarily Uses
RMMV
Enelvon updated the External Text script to solve the junk symbol problem.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

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
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,018
Members
137,563
Latest member
MinyakaAeon
Top