[VXAce][Zerbu Engine - Extra Starting Position Option] Make the option be above "Quit".

Discussion in 'RGSSx Script Support' started by CarlosDavilla, Oct 18, 2019.

Thread Status:
Not open for further replies.
  1. CarlosDavilla

    CarlosDavilla The Insolent One Veteran

    Messages:
    55
    Likes Received:
    5
    First Language:
    Portuguese
    Primarily Uses:
    RMVXA
    Hi.

    So, I'm using the Extra Starting Position Option script from Zerbu to test some proof of concept and I wanted to know if it's possible to move the title screen command to be above the "Quit" option, or even maybe put it wherever position I wanted in the list, because the default position is at the bottom of the list, and that's kinda counterintuitive for the concept I wanted to make.

    I basically wanted to do this:
    [​IMG]

    So, can you guys help me in this one?
    Thanks in advance.
     
    #1
  2. ZirconStorms

    ZirconStorms VX & VX Ace Scripts Veteran

    Messages:
    334
    Likes Received:
    108
    First Language:
    English
    Primarily Uses:
    RMVXA
    Title command code here (aka make_command_list) is no longer aliased, be careful with using other Window_TitleCommand scripts.

    Code:
    #============================================================================
    # Zerbu Engine - Extra Starting Position Option
    # (Edited by ZirconStorms, credit optional.)
    #----------------------------------------------------------------------------
    # This script adds an extra "New Game" type option to the menu that allows you
    # to specify a different starting location. This is good for creating
    # playable tutorials.
    #============================================================================
    
    #============================================================================
    # (module) ZE_Extra_Starting_Position_Option
    #============================================================================
    module ZE_Extra_Starting_Position_Option
     ZE_ESPO = {
    #------------------------------------------------------------------------
    # Options
    #------------------------------------------------------------------------
    # This is the text that will appear on the title screen.
    #------------------------------------------------------------------------
    :NAME => "Tutorial",
    #------------------------------------------------------------------------
    # This is the number for the map the player should start on when the
    # extra option is selected.
    #------------------------------------------------------------------------
    :MAP => 3,
    #------------------------------------------------------------------------
    # This is the X and Y position the player should start at when the
    # extra option is selected.
    #------------------------------------------------------------------------
    :MAP_X => 0,
    :MAP_Y => 0,
     }
    end
    
    #============================================================================
    # Window_TitleCommand
    #============================================================================
    class Window_TitleCommand
     include ZE_Extra_Starting_Position_Option
     #--------------------------------------------------------------------------
     def make_command_list
        add_command(Vocab::new_game, :new_game)
        add_command(Vocab::continue, :continue, continue_enabled)
        add_command(ZE_ESPO[:NAME], :espo)
        add_command(Vocab::shutdown, :shutdown)
      end
     #--------------------------------------------------------------------------
    end
    
    #============================================================================
    # Scene_Title
    #============================================================================
    class Scene_Title
     include ZE_Extra_Starting_Position_Option
     #--------------------------------------------------------------------------
     # alias method: create_command_window
     #--------------------------------------------------------------------------
     alias ze_espo_create_command_window create_command_window
     def create_command_window
    #---
    ze_espo_create_command_window
    @command_window.set_handler(:espo, method(:command_espo))
    #---
     end
    
     #--------------------------------------------------------------------------
     # new method: command_espo
     #--------------------------------------------------------------------------
     def command_espo
    #---
    DataManager.create_game_objects
    #---
    $game_party.setup_starting_members
    #---
    $game_map.setup(ZE_ESPO[:MAP])
    #---
    $game_player.moveto(ZE_ESPO[:MAP_X], ZE_ESPO[:MAP_Y])
    $game_player.refresh
    #---
    Graphics.frame_count = 0
    #---
    close_command_window
    fadeout_all
    #---
    $game_map.autoplay
    #---
    SceneManager.goto(Scene_Map)
    #---
     end
    end
     
    #2
  3. CarlosDavilla

    CarlosDavilla The Insolent One Veteran

    Messages:
    55
    Likes Received:
    5
    First Language:
    Portuguese
    Primarily Uses:
    RMVXA
    Thanks @ZirconStorms , but that didn't really help much considering I've other title commands that aren't in the new make_command_list that you've made. The "Options" command added by the Sixth's Global Setting Addon and the "Continue" command added by the CSCA Autosave Plus.
    So, I've had to make my own.
    Basically speaking I've just added a add_command(Vocab::shutdown, :shutdown) below the add_command(ZE_ESPO[:NAME], :espo) command and deleted any other entry that had the shutdown title command. I don't know if it was the right thing to do but it solved my problem.

    [​IMG]
    I guess the thread can be closed now, unless someone has a better way to solving this.
     
    #3
  4. ZirconStorms

    ZirconStorms VX & VX Ace Scripts Veteran

    Messages:
    334
    Likes Received:
    108
    First Language:
    English
    Primarily Uses:
    RMVXA
    Not exactly a nice way to word that. SPECIFY the scripts you want any requests to be compatible with next time.
     
    #4
    CarlosDavilla likes this.
  5. CarlosDavilla

    CarlosDavilla The Insolent One Veteran

    Messages:
    55
    Likes Received:
    5
    First Language:
    Portuguese
    Primarily Uses:
    RMVXA
    Yes, you're right on that. I'm terribly sorry for not being more clearer.
    Is there a way to make these three scripts run together? Like I said, if there's a better alternative, I'll be happy to fix it right away since I've made a backup of the modifications I've made.
     
    #5
  6. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,512
    Likes Received:
    5,122
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    next time, you can do something like this
    Code:
      alias aliased_make_command make_command_list
      def make_command_list
        aliased_make_command # <-- no overwrite
        hash = { 
          :name => "Command Name"
          :symbol => :symbolhere, 
          :enabled=> true, 
          :ext=> nil
        }
        @list.insert(@list.size - 2, hash) # <-- the key is here
      end
    
     
    #6
  7. CarlosDavilla

    CarlosDavilla The Insolent One Veteran

    Messages:
    55
    Likes Received:
    5
    First Language:
    Portuguese
    Primarily Uses:
    RMVXA
    I don't think I understand what I'm supposed to do with this, Theo.
    Like, I just have to put the command name, but what are the symbols? Like, :shutdown? :new_game? Will it even work with the ones that are not from the base scripts?
    And what is :ext?
    The list.size needs to be altered to 6, right? Since I'm using six commands.
    Do I have to alter anything else? If that's it, then I'm going to try it out.
     
    #7
  8. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,512
    Likes Received:
    5,122
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    Sorry, I meant that for @ZirconStorms
    In your case, @CarlosDavilla

    Keep the original Zerbu's script, then add this patch below the script
    Code:
    class Window_TitleCommand
     def make_command_list
      ze_espo_make_command_list
      hash = { :name => ZE_ESPO[:NAME], :symbol => :espo, :enabled => true, :ext => nil)
      @list.insert(@list.size - 1, hash)
     end
    end
    
    Zerbu's script may need to be placed below all the scripts that alters title screen menu though

    I'm not exactly sure if it's
    Code:
    @list.size - 1
    OR
    @list.size - 2
    you can try.
     
    #8
    CarlosDavilla likes this.
  9. CarlosDavilla

    CarlosDavilla The Insolent One Veteran

    Messages:
    55
    Likes Received:
    5
    First Language:
    Portuguese
    Primarily Uses:
    RMVXA
    Nice, it worked just fine. Thanks once again, Theo.

    Though I've had to change the parenthesis for a bracket at the end of the 4th line, since using like you shared caused a CTD.
    It should look like this now:

    Code:
    class Window_TitleCommand
     def make_command_list
      ze_espo_make_command_list
      hash = { :name => ZE_ESPO[:NAME], :symbol => :espo, :enabled => true, :ext => nil }
      @list.insert(@list.size - 1, hash)
     end
    end
    But hey, it worked nonetheless. Thanks for the help guys.
    The thread can now be closed.
     
    #9
  10. slimmmeiske2

    slimmmeiske2 Little Red Riding Hood Moderator

    Messages:
    5,749
    Likes Received:
    4,181
    Location:
    Belgium
    First Language:
    Dutch
    Primarily Uses:
    RMXP

    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.

     
    #10
Thread Status:
Not open for further replies.

Share This Page