I need a debugger 'Kill All' Button

I'm hoping somebody can help me with this. I want the 'F9' button to kill all the enemies on the screen during playtesting, so that I can level up my character, get items, and resume the story without having to fight at all. Sort of like how the Change Enemy State event can apply the Defeated state to the Entire Troop of enemies, only instead, it will only kill all the enemies during playtesting and when the F9 button is pressed in 'any moment within the battle'.

If anybody can supply me with a quick script or such, I would greatly appreciate it. 🙂
I had a quick go at this, but ran into problems - with so many windows for party action, battler action, target, it was hard to make it actually detect the F9 hit, and when I did get to do it while the battle action was going on, it caused a crash because it was trying to execute preselected actions on an enemy that no longer existed.


Would you be content with a Fight | Escape | Kill All selection when the battle first begins?
Yanfly's Debug Extension has this option (as well as a wealth of other useful hotkeys).
Here is what I came up with. If it's useful to you, great. It may not work if you are using any custom battle scripts. This just gives you the Kill All option as I mentioned above. Enabling F9 would take more time than I have available.

Spoiler
Code:
class Window_PartyCommand < Window_Command  #--------------------------------------------------------------------------  # * Create Command List  #--------------------------------------------------------------------------  alias shaz_kill_all_make_command_list make_command_list  def make_command_list    shaz_kill_all_make_command_list     add_command('Kill All',    :kill_all, $TEST) if $TEST  endendclass Scene_Battle < Scene_Base  alias shaz_kill_all_create_party_command_window create_party_command_window  def create_party_command_window    shaz_kill_all_create_party_command_window     @party_command_window.set_handler(:kill_all, method(:kill_all)) if $TEST  end  def kill_all    $game_troop.members.each do |enemy|      if enemy.alive?        enemy.die        enemy.add_state(1)      end    end    @party_command_window.deactivate    BattleManager.process_victory  endend
Yeah, I suggest using Yanfly Debug Extension as well. The things you can do with it are amazing and everything you'll need for test-plays.

  • make a common event to provide +1 level to party members and call it whenever you want (just an idea)
  • Give yourself any database item/weapon/armor
  • change any switches/variables on the spot
  • warp to any map (choose what tile too)
  • force-run any event on your current map
  • force-run any battle troop from the database
  • Setup hotkeys for common events and actions
  • and so much more
I tried the Yanfly Debug Extension and I absolutely loved its features, 😀   but a big downside for me would be the 10 second loading time it takes to access the debugging interface. 🤔

I checked out your script, Shaz, and I'm pretty happy with it so far! I'm quite impressed you managed to make it in less than an hour. I'm just a beginner programmer and trying to figure this out would've taken me an entire day, hehe..! Thanks a lot! 🤣

All in all, thanks for all the helpful replies, guys. I really appreciate them. With my fairly limited programming knowledge, I'll try to find some more ways to modify some code to make game design easier for me. 😛

P.S. Shaz, do you want me to credit you for this piece of code or are you fine with no credits? I'd be happy to credit you if you really want me to.
nah, I don't need credit for half a dozen lines that won't be in the released game anyway 🙂


Oh, and you SHOULD remove (or at least comment out) the script before you release your game, because if you don't, the Kill All option will still be there, just disabled. And it wouldn't be fair to taunt your players like that 😉 In fact, I'm going to alter that little bit of script so it WON'T show it if you do accidentally forget to remove it before release. So if you want, you can grab the new version and replace what you've got.


This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/i-need-a-debugger-kill-all-button.18621/