[Solved]How to select last?

AgentN107

Bringer of laughter
Member
Joined
Aug 21, 2018
Messages
24
Reaction score
3
First Language
English
Primarily Uses
RMVXA
Hello i'm a new scripter and I have looked far and wide for this but had no luck. I am trying to make it so when the select a comand it opens a window then when they back out of the second window it is still selected on that command. I found in the menu and item menu have something in there code called select last but couldn't figure how it works
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
select_last simply selects the last index used by that command window..

If you made the command window (first) as a child of Window_Command, it should actually already be staying on that last command, unless you actually destroyed the window when you select a command.
 

AgentN107

Bringer of laughter
Member
Joined
Aug 21, 2018
Messages
24
Reaction score
3
First Language
English
Primarily Uses
RMVXA
If by destory you mean it closes the command window then yes.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Can you show us the exit/cancel code of your second window?
 

AgentN107

Bringer of laughter
Member
Joined
Aug 21, 2018
Messages
24
Reaction score
3
First Language
English
Primarily Uses
RMVXA
is this what your looking for
 

Attachments

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Lets get this clear, please correct me if Im wrong:

-Window_Journal is the first window
-Selecting an option (Log, Study etc) transfers you to a new scene
-Because its a new scene, when you cancel, it returns to the scene with Window_Journal but since we transferred thru scenes, it goes back to the first option of Window_Journal

If all those are true, what you need to do is make a class variable for Window_Journal (a variable with @@ before it), we will use this to save the last index selected on any Window_Journal instance. You can also opt to use a global variable or make an instance variable inside Game_System (so that its saved with the save file by default)

When you OK an option in the Window_Journal, you set the class variable to be equal to the index of that option. Then on the initialization method of Window_Journal, you check if the class variable has a value, if yes, call the select method passing that value, else call select on the first index.

PS: Make sure you take care when using the words Window and Scene because on your OP I thought you're just opening various Windows within the same scene but based on your posted code, you're actually opening a new Scene instead. That changes the situation greatly
 
Last edited:

AgentN107

Bringer of laughter
Member
Joined
Aug 21, 2018
Messages
24
Reaction score
3
First Language
English
Primarily Uses
RMVXA
That is correct. That got it working apparently I had the pieces figured out from looking at some of the base codings I just didn't understand it enough to put the pieces in the right places thank you so much for the help.
PS. oops forgot there was a difference between Window and Scene will keep that in mind next time I ask for help
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
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'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,574
Latest member
nikisknight
Top