Option to take the player to the "Key Items" menu?

greensdream

"GREEN'S DREAM" developer page
Veteran
Joined
Jul 15, 2017
Messages
55
Reaction score
25
First Language
English
Primarily Uses
RMMV
I have a custom menu called by a common event, and in that event I have three options to choose from. In the event I use script calls to take the player to the Equip, Save, and Quit screens respectively [ SceneManager.push(Scene_Equip), etc. ]. My question is this...

Can I add a fourth option to take the player to the "Key Items" screen? When I use [ SceneManager.push(Scene_Item) ], it of course takes me to the item menu. I'd like to have an option that takes the player instead to only the "Key Items" menu without the ability to switch between Item, Weapon, Armor, and Key Items.

If it's impossible or too complicated to take away the ability to switch between Item, Weapon, Armor, and Key Items, then is there at least a way to start on the "Key Items" part of the menu instead of on the "Item" part?
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,180
Reaction score
715
First Language
Dutch
Primarily Uses
RMMV
so far I know, there is none.

I dont know if its possible through SceneManager.push(Scene_Item)
around SceneManager.push(Scene_Item._keyItems) but I cant recall it.

Some people are looking for it, but I don't know if there is really a direct call to it.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,418
Reaction score
671
First Language
Portuguese - Br
Primarily Uses
RMMV
Hi there!
You can try to change the default index when you push Scene_Item.
But I think you have to edit the code:
JavaScript:
const alias = Scene_Item.prototype.start;
Scene_Item.prototype.start = function() {
    alias.call(this);
     if($gameSwitches.value(ID)){
         const symbol = $gameVariables.value(ID);
        this._categoryWindow.selectSymbol(symbol);
    }
};
JavaScript:
const alias = Scene_Item.prototype.start;
Scene_Item.prototype.start = function() {
    alias.call(this);
    this._categoryWindow.selectSymbol('keyItem');
};
In option 1, when the specified switch is on, you will be able the scene item will select the category symbol that you choose.
In this example, I put the symbol inside a variable, so you can change it in your game. They have to be a string and you have to add it to a variable via the script call field in the control variable command.
The default symbols are:
'item'
'weapon'
'armor'
'keyItem' < This is what you want.

Or can put options 2, that will always open the scene item changing the category window to select directly the key items.
Or you can build something different, like

JavaScript:
Scene_Item.prototype.start = function() {
    alias.call(this);
     if($gameSwitches.value(ID)){
        this._categoryWindow.selectSymbol('keyItem');
    /}
};
Copy and paste this and put it into a text file with a .js extension. So all you have to do is put it as a plugin.
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,180
Reaction score
715
First Language
Dutch
Primarily Uses
RMMV
I can use option 2 though, no need for switches and variables.
Didn't knew this thing could be possible which is also relaive easy (when you know it).
 

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

Latest Threads

Latest Profile Posts

So I just spent the weekend...playing my own game. The one I released last year. Yep you heard that right.
Goal for MZ? None... I'm still curious how to finish my VXA project and how it looks like when it actually finished. Which will take at least another two years. Coming late again to the party.
Finding it amusing that people are posting support questions in new threads for an engine that isn't even released yet. Touch and Archeia are the only ones authorised to say anything, and there's only one active thread where they'll be answering questions.
I think my goal for MZ ... is to actually release a game and not have twenty technical demos and debugging projects. Let's see if I can manage that. ;o
I am starting to enjoy writing. I never thought I would enjoy it since my dyslexia was holding me back so much.
Thanks to the community here :)
For those interested chapter 2 and 3 are available to read here:

Forum statistics

Threads
100,652
Messages
978,095
Members
132,261
Latest member
DarthNinjus
Top