Garry's Mod

Garry's Mod

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

Subscribe to download
NPC Battle Cleanup

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

TOOL DEV STATUS: BUG FIXES ONLY

From 04/12/2021 onwards I'll only be providing fixes for this tool, so I can focus on other projects.

Thank you all for your support and dedication so far.




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://steamcommunity.com/sharedfiles/filedetails/?id=2890177857

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

Thank you!
219 Comments
Pentax_JN May 25 @ 9:29pm 
this is the exactly that i wanted Thx bro
Omarb10legends Apr 9 @ 4:09pm 
the one support swep we needed. MW is not here, unfortunate. but gread addon nontheless
Xalalau  [author] Mar 7 @ 11:24am 
There's support. The addon must have updated.
PLAGUE DOCTOR Mar 7 @ 7:49am 
no vj base support :steamthumbsdown:
John Jan 22 @ 8:47am 
:steamthumbsup:
Xalalau  [author] Jan 19 @ 5:20am 
Wdym?
TacoDark Jan 19 @ 4:51am 
its funny as hell that someone posted this in a different addon
El Radioheadoso Dec 20, 2023 @ 9:41am 
[NPC Battle Cleanup] lua/autorun/server/sv_nbc.lua:422: bad argument #1 to 'SetCreator' (Entity expected, got nil)
1. error - [C]:-1
2. ArgAssert - lua/gpm/utils.lua:152
3. SetCreator - packages/player-extensions/init.lua:15
4. NPCDeathEvent - lua/autorun/server/sv_nbc.lua:422
5. v - lua/autorun/server/sv_nbc.lua:541
6. unknown - lua/includes/modules/hook.lua:96
V2 Oct 3, 2023 @ 7:46pm 
isn't this in the base game only its 40X slower and it only cleans up the bodys not everything else
lunatyx Sep 20, 2023 @ 1:16pm 
does it clean up any ragdoll, even active ragdolls that are considered living and not actually a corpse?