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.)
Laatst bewerkt door super crown negev; 11 jan 2016 om 21:59
< >
1-6 van 6 reacties weergegeven
moomoohk  [ontwikkelaar] 14 jan 2016 om 12:21 
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.
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  [ontwikkelaar] 23 jan 2016 om 8:27 
Origineel geplaatst door (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).
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 :)
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!
< >
1-6 van 6 reacties weergegeven
Per pagina: 1530 50