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.
Regular
Joined
Sep 11, 2019
Messages
194
Reaction score
304
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
Regular
Joined
Jul 2, 2014
Messages
12,606
Reaction score
11,088
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

Hello everyone im back haha, so im planning to Restart my RPGMAKER project next year when i get new gear to work, But currently im working in Trading card games, if anyone is interested in this world please visit my website :

From there you will be able yo access to my social network profiles or my Discord server.
Good luck to everyone :)
Going back through and fixin' up the dialogue.
Thanks to @Iron_Brew for helping me with this one. Makes you think.
Jaminham.PNG
Experimenting with MV-style spriting, made a round guy :)

image.png
Don’t forget to catch Advent Day #3 compiled right here! Hmm. Let’s make today’s question…what is your favorite dish served at your holiday dinner?
All of the male sprites in New Dawn for the are built off of the third sprite I ever made on top of the first sprite base I made nearly a year ago, and now I'm making the female sprite base, and just by virtue of the amount of elapsed time and the number of sprites I've made since then, I think I'm going to have to revise all of my male sprites at some point.

Forum statistics

Threads
136,727
Messages
1,269,204
Members
180,442
Latest member
ZikaDasAlmas
Top