Select Actor Before Opening Window

MusicTF

Soundtrack Composer
Veteran
Joined
Mar 30, 2015
Messages
102
Reaction score
8
First Language
English
Primarily Uses
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:

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,136
Reaction score
809
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.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I'm back to the bugs.
100 bugs in my coding,
take one down,
fix it up,
132 bugs in my coding.
On the plus side, if all this rioting sparks another Covid outbreak... I will have a whole lot of time to work on my game. Not exactly how I wanted to get that time, but hey I'm a glass is half full... of RM kind of guy. :LZSwink:
A video once in a while won't hurt.
Have a craving for a Nesquik milkshake. No idea why. Haven't had one since I was a kid. lol. I remember them kinda tasting nice, but also leaving a lot of nasty powder at the bottom of the cup.

Forum statistics

Threads
98,070
Messages
949,015
Members
129,341
Latest member
Shinkukae
Top