Select Actor Before Opening Window

Discussion in 'RGSSx Script Support' started by MusicTF, Jan 13, 2016.

  1. MusicTF

    MusicTF Soundtrack Composer Veteran

    Messages:
    102
    Likes Received:
    8
    First Language:
    English
    So in my game I have a job system, and I'm creating a window for choosing jobs.  What I'm trying to do is be able to select which actors jobs to mess with BEFORE opening the job window, like in the status window or equipment window.  I've added a jobs command to the command window in the main menu, and I've set the handler to command_personal.  Right now the command just puts the cursor on the actors, but when you select it doesn't do anything.  I have no idea how to edit command_personal or the methods it calls to open my custom window.  How do I?

    Thanks in advance!
     
    Last edited by a moderator: Jan 13, 2016
    #1
  2. Sixth

    Sixth Veteran Veteran

    Messages:
    2,130
    Likes Received:
    798
    First Language:
    Hungarian
    Primarily Uses:
    RMVXA
    You can see this method in 'Scene_Menu':

    def on_personal_ok case @command_window.current_symbol when :skill SceneManager.call(Scene_Skill) when :equip SceneManager.call(Scene_Equip) when :status SceneManager.call(Scene_Status) end end
    Since you already made your new command button for your job setup, you can either edit it directly there by following the same format (adding new 'when :your_symbol' line, plus the method to run), or you can alias that method and put that code somewhere between Materials and Main in the script slots.

    I would advise against editing default scripts directly. You might forget about what you did sometime and can end up bug-hunting because of it for a long time.

    Here is the alias way:

    class Scene_Menu < Scene_MenuBase alias add_job_sel8874 on_personal_ok add_job_sel8874 if @command_window.current_symbol == :class # Example symbol # Just an example, write whatever you want to run here SceneManager.call(Scene_Class) end endend
    Change the :class symbol I used to your own symbol and replace the example method to whatever you want.
     
    #2

Share This Page