Garry's Mod

Garry's Mod

Horde : Wave Survival Gamemode
Cpt.Haxray 30 Apr, 2022 @ 8:49pm
[VJ Base] Advice to fix Enemies killing each other
Since a lot of people have been struggling with this issue, there is a relatively simple fix when it comes to VJ Base NPCs.

First, Install Notepad ++ onto your PC if you haven't already as it makes viewing/editing Lua files much easier.

Download the NPC packs that are offering problems, and use Gmad(Located in Gmod/Bin) to decompile the addons.

Navigate through the folders until you find where the enemy lua files are stored. Generally this will be in lua/entities. Once you see folders named after enemy names, you're in the right spot.

Each Enemy will generally have a shared.lua and a inti.lua file inside their receptive folder. Open up the Init file with Notepad ++.

Near the top of the document will generally be a line named ENT.VJ_NPC_Class, followed by a =, and a bunch of "Class_example" in between brackets. VJ NPCs use this list of classes to decide who is an ally.

Simply add a "Class_Horde" in the list of bracketed class types to each NPC you want to use. Alternatively you could copy the whole class string from one file and apply it to every single one, but Class_Horde is quicker and more efficient.

Unsub from the Workshop addon and use your decompiled version(Friends can still use the workshop version for content, but you need to use your newly decompiled version), and now the NPCs should no longer be targeting each other.

I dont know how VJ base works but it might be possible to target the ENT.VJ_NPC_Class line in some way with lua, allowing horde to force VJ base enemies to automatically be on the same team while avoiding performance issues, but im not a programmer so i dont know if this is possible.