Kadafi 0 Posted June 19, 2014 (edited) Command Disabler By : Kadafi Version : 1.2 Change Logs : 2014.06.19 - Started and Finished script 2014.06.20 - Added Formation, Save, and Escape Commands 2014.06.20 - Updated the Script Structures Introduction : This script can disable almost all of the commands in every scene by just turn ON / OFF the switch. Disabling Command like a boss! \m/ Features : Disable any commands in menus or even battlesScreenshots : Download : Script Special Thanks : TheoAllen KilloZapit Edited June 20, 2014 by Kadafi Share this post Link to post Share on other sites
Maliki 33 Posted June 19, 2014 The skeptic in me just has to ask: Which commands can it NOT disable? Share this post Link to post Share on other sites
Kadafi 0 Posted June 19, 2014 Almost all the commands are ENABLED by default. This script works like turn on a switch to make a command DISABLED. Just turn off the switch back to re-enabled it. Share this post Link to post Share on other sites
Maliki 33 Posted June 19, 2014 Ok. I looked through your script a bit and didn't see a switch for the dreaded Party Command, Escape. I'm using a custom battle system with a self-made preemptive/surprise attack snippet. I'd love to flip a switch that could disable escape for the first turn of a surprise attack. Can your script be made to help with that? Share this post Link to post Share on other sites
Kadafi 0 Posted June 19, 2014 Ok. I looked through your script a bit and didn't see a switch for the dreaded Party Command, Escape. I'm using a custom battle system with a self-made preemptive/surprise attack snippet. I'd love to flip a switch that could disable escape for the first turn of a surprise attack. Can your script be made to help with that? Done. Now the script has been updated. Share this post Link to post Share on other sites
Kayzee 4,033 Posted June 20, 2014 (edited) You know if you wanted to, you could probably just override Window_Command's add_command and make it look up a hash for the switch number or something. Just an idea. Maybe like this? module Command_Switches Switch_Hash = { :Window_MenuCommand_item => 1 # Main Menu's item command } end class Window_Command < Window_Selectable alias_method :add_command_switch_base, :add_command def add_command(name, symbol, enabled = true, ext = nil) command_switch = Command_Switches::Switch_Hash[(self.class.name + "_" + symbol.to_s).to_sym] enabled = false if command_switch && !$game_switches[command_switch] add_command_switch_base(name, symbol, enabled, ext) end end I haven't tested that though. And maybe the hash keys could be better. I donno. Edited June 20, 2014 by KilloZapit Share this post Link to post Share on other sites
TheoAllen 830 Posted June 20, 2014 (edited) I would like to go with command name though. Not all script users know the :symbol. module Command_Switches Switch_Hash = { "Game End" => 1 # Game End switch } end class Window_Command < Window_Selectable alias_method :add_command_switch_base, :add_command def add_command(name, symbol, enabled = true, ext = nil) switch_id = Command_Switches::Switch_Hash[name] enabled = !$game_switches[switch_id] if switch_id add_command_switch_base(name, symbol, enabled, ext) end end Basically, you just need to put key hash same as command name Edited June 20, 2014 by TheoAllen Share this post Link to post Share on other sites
Kayzee 4,033 Posted June 20, 2014 That works, but it might be tricky if you use the same name in different windows for diffrent scenes... How much that is actualy a problem I am not sure. Anyway I have used null symbols in my menus before so I guess it's better using the name anyway. Share this post Link to post Share on other sites
TheoAllen 830 Posted June 20, 2014 That works, but it might be tricky if you use the same name in different windows for diffrent scenes...There is a little "trick" though. "Name" and "Name " are different string only just because of space Share this post Link to post Share on other sites
Kadafi 0 Posted June 20, 2014 You know if you wanted to, you could probably just override Window_Command's add_command and make it look up a hash for the switch number or something. Just an idea. Maybe like this? module Command_Switches Switch_Hash = { :Window_MenuCommand_item => 1 # Main Menu's item command } end class Window_Command < Window_Selectable alias_method :add_command_switch_base, :add_command def add_command(name, symbol, enabled = true, ext = nil) command_switch = Command_Switches::Switch_Hash[(self.class.name + "_" + symbol.to_s).to_sym] enabled = false if command_switch && !$game_switches[command_switch] add_command_switch_base(name, symbol, enabled, ext) end end I haven't tested that though. And maybe the hash keys could be better. I donno. I would like to go with command name though. Not all script users know the :symbol. module Command_Switches Switch_Hash = { "Game End" => 1 # Game End switch } end class Window_Command < Window_Selectable alias_method :add_command_switch_base, :add_command def add_command(name, symbol, enabled = true, ext = nil) switch_id = Command_Switches::Switch_Hash[name] enabled = !$game_switches[switch_id] if switch_id add_command_switch_base(name, symbol, enabled, ext) end end Basically, you just need to put key hash same as command name Thank you for the suggestions. Now the script has been updated~ Share this post Link to post Share on other sites
Kayzee 4,033 Posted June 20, 2014 (edited) One problem I see is the battle item menu and the main menu item menu have the same name... Though, actualy it may make sense to disable both at once. That works, but it might be tricky if you use the same name in different windows for diffrent scenes...There is a little "trick" though. "Name" and "Name " are different string only just because of space I don't see how that would help, unless you want to manualy rename all the duplicates. Actualy it might be more woth while to make a hash of hashes for each menu and/or scene. But yeah that would get rather complicated. It's rather nice that someone can add and delete keys for any script they want to install easily while only using the menu name. Edited June 20, 2014 by KilloZapit Share this post Link to post Share on other sites