Hide/Show formation menu?

Hello.

I want to hide the Formation Menu UNTIL a part of the game. With the System 2 i can hide it from the start but... only that?
in MV you can do this setting a variable as a condition for the scene using yanfly engine, but idk if its possible in MZ.

Thanks.
one alternative would be to have the formation menu present but disabled.
that is the common default solution because it needs neither script nor plugin - there is an event command to enable and disable formation access, and that can be changed as often as you want during your game.
Using http://www.yanfly.moe/wiki/Main_Menu_Core_VisuStella_MZ

Go to Plugin Manager > VisuMZ_1_MainMenuCore > Command Window List > 10 "formation" > JS: Show > Paste this in:
OPTION 1: Switch will allow formation to show as long as Formation Access is enabled.
Code:
return $gameSwitches.value(1, true) ?
this.needsCommand("formation") : false;

OPTION 2: Switch will allow formation to show; Formation Access enable will allow access, while Formation Access disable will grey it out.
Code:
return $gameSwitches.value(1, true);

Change switch to which ever number you want to use.
Code:
return $gameSwitches.value(1, true)
Just for info: this will work, but $gameSwitches.value only expects 1 argument (switch ID), so it can be written as:
JavaScript:
return $gameSwitches.value(1);
Just for info: this will work, but $gameSwitches.value only expects 1 argument (switch ID), so it can be written as:
JavaScript:
return $gameSwitches.value(1);
😅 Thank you!
one alternative would be to have the formation menu present but disabled.
that is the common default solution because it needs neither script nor plugin - there is an event command to enable and disable formation access, and that can be changed as often as you want during your game.
Yes, now i remember to try this time ago, but doesn't works with visustella mainmenu plugin.

Using http://www.yanfly.moe/wiki/Main_Menu_Core_VisuStella_MZ

Go to Plugin Manager > VisuMZ_1_MainMenuCore > Command Window List > 10 "formation" > JS: Show > Paste this in:
OPTION 1: Switch will allow formation to show as long as Formation Access is enabled.
Code:
return $gameSwitches.value(1, true) ?
this.needsCommand("formation") : false;

OPTION 2: Switch will allow formation to show; Formation Access enable will allow access, while Formation Access disable will grey it out.
Code:
return $gameSwitches.value(1, true);

Change switch to which ever number you want to use.
Works perfect, thanks! 😂

Original thread: https://forums.rpgmakerweb.com/threads/hide-show-formation-menu.143278/