Garry's Mod

Garry's Mod

822 ratings
NPC Battle Cleanup
2
3
5
2
2
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Build, Fun
File Size
Posted
Updated
31.205 KB
5 Jun, 2020 @ 9:35pm
31 Jan, 2023 @ 6:07pm
38 Change Notes ( view )

Subscribe to download
NPC Battle Cleanup

In 2 collections by Xalalau
Xalaserver Base
54 items
Brasil - Supremacia
172 items
Description
-----------------------------------------------------------
BRASIL, Junte-se: https://discord.gg/ytkXGNU
GMBR, criadores BR de addons e vídeos e tudo.
-----------------------------------------------------------



Introduction
Hello, there!

NPC Battle Cleanup (NBC) is an elegant and very light addon inspired by this old mod. It's designed to react to game events by automatically cleaning up battle remains, which cause lag and chaos.

Btw there's a new alternative called Realistic Battle Cleanup if you don't want the map too clean.

Features
  • It works without any requirements;
  • Supports presets;
  • Supports singleplayer and multiplayer;
  • Lets you control the remotion delay;
  • Kills all live NPCs from disconnected players;
  • Removes decals from the map (blood, gunshots, explodion marks...);
  • Removes corpses, leftovers and debris from dead NPCs;
  • Removes weapons and items dropped by dead NPCs and/or dead/live players;
  • Respects GMod's Keep Corpses option (ai_serverragdolls 1).

Removal Support
  • All the default HL2 SENTs and SWEPs;
  • Addons with generic class names;
  • Compatible with TFA;
  • M9K;
  • CW2;
  • ArcCW;
  • ARC9;
  • VJ Base.

When you find an entity (weapon, item, gib...) that isn't being removed, usually it’s not a bug, but a custom class name that needs special treatment. That's why I list some important compatible addons, like VJ Base, right above. I studied them and did the correct/new checks.

So, if you want cleanup support for some entity or addon related to "battles against NPCs", ask in the comments and leave some information / links / videos - anything that helps me quickly identify what needs to be done.

Here is the code[github.com].
I appreciate reports, ideas and help.

Removing custom entities

Unfortunately I didn't expose the entity lists in the menu, so you need to edit them directly in the Lua file like this:

1) Unsub from this addon;
2) Download it from GitHub[github.com] (Code -> Download zip);
3) Extract the folder inside your garrysmod/addons folder;
4) Edit the tables from lua/autorun/server/sv_nbc.lua as you wish.

Alternative Addon

Even though NPC Battle Cleanup works well I recommend another addon called "Immersive Battle Cleanup" as an alternative since its development is active.

https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=2890177857

As you all know I'm not providing feature updates here anymore.

Thank you!
239 Comments
moor 1 Aug @ 11:55pm 
okay
Xalalau  [author] 1 Aug @ 4:06pm 
Mostly
moor 1 Aug @ 3:33am 
does this remove npc gibs ?
♫MusicMen225♫ 18 Jun @ 12:45pm 
No worry :) For example, there's DrGBase, it's one of the more popular for custom NPCs. That's honestly the only other one I use besides VJ Base so I don't really know of many other ones.
Xalalau  [author] 18 Jun @ 7:51am 
Could you list these bases here? I don't play a lot of GMod anymore these days.
♫MusicMen225♫ 18 Jun @ 6:52am 
Damn. That's actually a pretty nice surprise, considering I thought this was no longer going to be developed per the description. Hope to see the rewrite whenever it's out then! Although, any plans for support of other NPC bases or is that not really planned? This works well for default and VJ Base NPCs but other bases not so much.
Xalalau  [author] 17 Jun @ 8:57pm 
Hey, thanks! I actually have a rewrite plan to improve this addon - mainly to remove corpses more effectively and expose configuration options so players can define what should be deleted themselves. Keeping everything locked inside the Lua file wasn’t the best design choice.
♫MusicMen225♫ 17 Jun @ 3:00am 
Honestly? I know there's an alternative addon and this isn't being kept up to date, but this is still the best addon for NPC cleanup out of all that I have seen so far. It's also nice that this doesn't remove player collisions with ragdolls, or at least as far as I'm aware anyway. Thanks for making this even if you don't work on it anymore, it's a great addon that I will definitely want to keep using for years into the future :3
Serial Designation N 31 Mar @ 2:18pm 
does it support Drg Base NPCS?
Domawesome04 25 Mar @ 10:59am 
Finally, I can play campaign maps with good frame rate