Temporarily Disable Inventory Access?

Hi! I just wanted to ask if it was possible to disable access to the Inventory Window temporarily, perhaps graying the command out until a certain switch is off/on? Something similar to the "Change Save Access" command would be just fine.


I'm making a game that has some parallel processing events at certain times, and my inventory as a lot of key items that cause common events to happen. Allowing the player to use these common event items during these scenes would disrupt the process, and I feel that this should be a restriction. It'll be less buggy that way.


Thank you so much to anyone who has any answers! 🙂
"Scenes" really should be autorun, not parallel process - if you're talking cutscenes.  That stops the player from doing anything while it's running, and as soon as it's over, they can continue on again.  If you're doing a cutscene as a parallel process, the player could leave the map midway.


However, if you meant something else and you really do need them to run as parallel process and want to disable the Item menu, add the following to a new slot under Materials:

Code:
class Window_MenuCommand < Window_Command
  def add_main_commands
    add_command(Vocab::item,   :item,   $game_switches[15])
    add_command(Vocab::skill,  :skill,  main_commands_enabled)
    add_command(Vocab::equip,  :equip,  main_commands_enabled)
    add_command(Vocab::status, :status, main_commands_enabled)
  end
end

I have used switch 15 above to enable the Item menu.  If 15 is already used for you, just allocate a different switch, name it (so you won't accidentally use it for something else), and change the number used in the script.  Turn it on when you want Items to be enabled, and off when you don't.
Thank you! That's exactly what I've been looking for!


And yes, most of my cutscenes are on Autorun. Right now, however, I've created a Five Nights at Freddy's-style night system which relies on Parallel Processes to function; it's constantly selecting a randomized variable between the set amount, and depending on the circumstances, one of the two current characters will run to the door and attack you. (Obviously, you've got the doors for defense.) Unfortunately, there is a timing system as well, and allowing the certain item scenes to play would disrupt that system and possibly allow you to cheat it. And I can't disable access to the menu at all, because your power gauge exists there too. So... it started out as a complicated problem, but I didn't expect the fix to be this simple. I really appreciate you! Thanks again!


P.S. Sorry if I wasn't very clear with "scenes". The nights are more like minigames than anything. 🙂


P.P.S. Can I just say that your Remember Event Position script is epic?

Original thread: https://forums.rpgmakerweb.com/threads/temporarily-disable-inventory-access.65859/