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,718
Reaction score
6,537
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 Posts

Latest Profile Posts

Ooops ended up trying out making my own A2 tile page instead of testing doors everywhere. Went well so far I think.
I guess I'm done making a blue squirrel's life difficult for posting new threads on different forums.
That's just for today so don't get used to this, squirrel-ish friend! :p
Got new hard drive, now trying to install the softwares I lost to the dead drive, and more than half of them won't install because they're already installed on the dead drive, and uninstallers won't run because they can't find where their programs are installed. So I take it having a drive die on you screws you in more ways than just data loss. >:\
PC got fixed finally. Back online again. Turns out I have no business trying to self repair pcs because it was getting to like 176F / 80C. Shop installed a totally new cooling system and now it runs fine and is super quiet.
When you're making major progress, but have to stop to go to work.

Forum statistics

Threads
131,485
Messages
1,220,209
Members
173,225
Latest member
ZecaVn
Top