RMMV A way to disable certain menu elements on certain conditions without disabling the entire menu?

Prince_Eric

Villager
Member
Joined
Aug 22, 2019
Messages
16
Reaction score
2
First Language
Russian
Primarily Uses
RMMV
Good day!

In my game there is one certain area where I want to disable Item, Equip and some other menus but still let player have access to the rest (like Options, Save/Load, Quest Journal, etc). The best would be to hide them, but just disabling them would also be fine.

I found this code (can't remember already, where exactly):
def item if $game_switches[51] == true $game_system.se_play($data_system.decision_se) $scene = Scene_Item.new else $game_system.se_play($data_system.cancel_se)
It prevents from using items if switch is on, but I still can access the menu. Maybe there is a way to modify it somehow?
 

TobyYasha

Spaghetti & Coding go hand in hand.
Veteran
Joined
Sep 11, 2019
Messages
186
Reaction score
277
First Language
English
Primarily Uses
RMMZ
Since you don't mind hiding them there's a pretty simple way, although i'm not sure what this "Quest Journal" that you mentioned is, a plugin by chance?
Either way, if it's only the base menu commands you can do so by using this.
$dataSystem.menuCommands

With this command you have access to:
"item", "skill", "equip", "status", "formation", "save"

Example on how to use it:
In a script call you can type, in order to hide the "item" tab.
$dataSystem.menuCommands[0] = false

If you want to re-enable it you can type this instead:
$dataSystem.menuCommands[0] = true

The only thing you would change at most is the number "0" corresponding to the index of the command, which you can check just above the example i posted, the starting index being 0, of course.

One last detailed is that the code you posted is not javascript, i assume it's Ruby?
Hope this helped you!
 

Prince_Eric

Villager
Member
Joined
Aug 22, 2019
Messages
16
Reaction score
2
First Language
Russian
Primarily Uses
RMMV
Since you don't mind hiding them there's a pretty simple way, although i'm not sure what this "Quest Journal" that you mentioned is, a plugin by chance?
Either way, if it's only the base menu commands you can do so by using this.
$dataSystem.menuCommands

With this command you have access to:
"item", "skill", "equip", "status", "formation", "save"
Thank you! It worked!
And yes, Quest Journal is added by Yanfly's plugin.

It's a bit sad that I only can hide default menus (I actually wanted to hide menu added by Stat Allocation plugin as well), but it's not that big of a deal.
My main concern was that character could eat, drink and use equipment while being in a dream world :D This won't happen now thanks to you.

And the code... yeah, probably. It was for... RPG Maker XP, if I recall correctly.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,876
Reaction score
6,680
First Language
English
Primarily Uses
RMMV
It's a bit sad that I only can hide default menus (I actually wanted to hide menu added by Stat Allocation plugin as well)
All of Yanfly's plugins that show on the menu have Plugin Commands to disable and enable them. Just check the documentation.
 

Prince_Eric

Villager
Member
Joined
Aug 22, 2019
Messages
16
Reaction score
2
First Language
Russian
Primarily Uses
RMMV
All of Yanfly's plugins that show on the menu have Plugin Commands to disable and enable them. Just check the documentation.
Thanks for the tip. I guess I've skipped that part.
 

Latest Threads

Latest Profile Posts

grief rpg maker... why oh why did I have to jump through like 30 hoops to (hopefully) have fixed the engine targeting ko'd people during multi hit/random attacks?
I finally finished the wrong clue death scene. So at least the player can see something cool before they get a Game Over. Prolly be less cool if they have to keep watching it repeatedly.
It's important for your party of adventurers to be harmonious and united.

unborn360.png
Me: I'm a good writer.

Also me: Creates skill, item, and equipment names like ...
Salmon Jellybean
Feel-Good Hit of the Summer
Marmalade Spreader #2
Quinoa Power!
Actual Literal Wand

Forum statistics

Threads
131,709
Messages
1,222,399
Members
173,445
Latest member
romey
Top