Garry's Mod

Garry's Mod

Zombie/NPC Invasion+
[bug] too many npcs spawning
There's a problem with the npc's spawning too much. Even though I set it to at least a 35 limit, it still continuously spawns like at least 100. I think the problem is that the npcs spawn in the range where they are supposed to spawn, and as you move around, they will spawn in range but wouldn't despawn the other npcs before it.

(i'm literally too lazy to retype it again, so yeah.)
Last edited by super crown negev; 11 Jan, 2016 @ 9:59pm
< >
Showing 1-6 of 6 comments
moomoohk  [developer] 14 Jan, 2016 @ 12:21pm 
If you could provide any more details that would really help me figure out the issue.
Upload a screenshot of your profile configuration.
If you see any errors in the console then let me have a look at those too.
Max Shadow 15 Jan, 2016 @ 11:18am 
I think this happens because the NPC can't be recognized with the same name it had when it was spawned, so the script can't remove it. This happens with custom npcs that are just reskined hl2 npcs. For example, if I spawn a "npc_black_metrocop", once spawned he will be a "npc_metrocop" with a different skin. The script can't find any "npc_black_metrocop", so it can't delete it. This doesn't happen with scripted npcs or nextbots, as they have a different entity name.

To solve this, DON'T spawn reskined custom NPCs directly, just spawn the original npc and write the full path of the custom model in the "Model" textbox. You can see the full path of a npc model with the tool "Entity inspector". It worked for me. Perhaps you should post this info in the main addon description, moomoohk.
moomoohk  [developer] 23 Jan, 2016 @ 8:27am 
Originally posted by (ARG) Max Shadow:
I think this happens because the NPC can't be recognized with the same name it had when it was spawned, so the script can't remove it. This happens with custom npcs that are just reskined hl2 npcs. For example, if I spawn a "npc_black_metrocop", once spawned he will be a "npc_metrocop" with a different skin. The script can't find any "npc_black_metrocop", so it can't delete it. This doesn't happen with scripted npcs or nextbots, as they have a different entity name.

To solve this, DON'T spawn reskined custom NPCs directly, just spawn the original npc and write the full path of the custom model in the "Model" textbox. You can see the full path of a npc model with the tool "Entity inspector". It worked for me. Perhaps you should post this info in the main addon description, moomoohk.

If only I would have read this sooner :D

I just figured out there was an issue myself last night and wrote up a fix. The update is live.

Everything should work just as expected now. You can spawn reskinned NPCs and everything.

The way I fixed it is by saving the entity ID of each NPC spawned by ZINV in a list and then filtering that list instead of searching by class name (which won't work for reskinned/modified NPCs).
Max Shadow 23 Jan, 2016 @ 10:13am 
Yeah, that should do the trick. It's always good to have everything stored in a list somewhere :P Keep up the good work man :)
super crown negev 23 Jan, 2016 @ 2:46pm 
apologies for not describing this earlier, i was using the enhanced combine npcs so i was a little confused by all this. anyway thanks dude!
< >
Showing 1-6 of 6 comments
Per page: 1530 50