Garry's Mod

Garry's Mod

[CTOOLS] NPC Spawner
 Denne tråd er blevet fastgjort, så den er sikkert vigtig
Ѫ  [udvikler] 7. juli 2021 kl. 5:44
FAQ
- How do I use this tool?
Press Left Mouse Button to start creating an area where NPCs will be spawned.
Press the button to confirm the area. Now you can change the angle NPCs will be spawned at.
Left click again to confirm the angle.

Now, when your area is completely ready, you can press Right Mouse Button to spawn NPCs.
You can place infinite amount of areas before you do this.
For example, you can made one area of hostile NPCs and another one of friendly NPCs, and then spawn them at once so they appear evenly across the map.

For your convenience, spread and random parameters were bound to the Mouse Wheel.
When creating area, use Up and Down Mouse Wheel to change the spread multiplier. It will increase or decrease the size of the grid.
Or hold the Shift Key to change randomness of NPC spawn instead.


- When I use this tool, my server lags and crashes, help
Garry's Mod runs on 17 years old engine, obviously you don't want to spawn millions of NPCs.
Just try spawning 50 citizen NPCs the normal way and see how low your FPS becomes.
This tool is not for fun, it just makes the gmod experience better.


- NPCs that I'm trying to spawn throw serverside errors or don't work...
Some of the workshop NPC addons are poorly coded. There's no way to make the tool work with them.
NPCs should be actually NPCs or NextBots (i.e. pass npc:IsNPC() or npc:IsNextBot()) check).
SNPCs, VJBase and similar NPCs will work just fine.


- What are spawn flags? How do I use them?
Spawn flags adjust NPC behaviour, they are hardcoded in engine and supposed to be used by developers only. Use them only if you know how they work.
Note that some of these flags are necessary for some NPCs and will be forced anyway.
Some flags will not work for some NPCs.


- What if the area I created partially in the wall? Will it spawn NPCs in that wall?
No, it will ignore places where NPC spawn is impossible.
It's safe to use the tool everywhere, there's no need to avoid twisted corridors.


- Can I dupe or save created areas?
No, there's no data or entities to save or to be duped.
Spawn areas exist only in memory, therefore you can't use this tool with default gmod duplicator, AdvDupe, PermaProp or saves.


- What is Custom Squad and how do I use it?
All NPCs in games powered by Source Engine can be assigned to squads.
Squads allow you to group NPCs for their further cooperation.
Members of squad cover each other, move together, share information, and take turns at attacking their enemies.

In Garry's Mod most NPCs are being assigned to specific squads when spawning by default.
For example most of the combine NPCs will be assigned to squad called "overwatch".
Whereas Nova Prospekt guards and shotgunners will have their own squad - "novaprospekt".

If you don't specify custom squad, all NPCs you spawn with the tool will be assigned to their default squads.
For instance, if you place two groups of the NPCs in different map areas, and warn one of these group, the other one will know about your presence.
You should consider that when creating long battles or events.

For more details visit Official Valve Wiki.
Sidst redigeret af Ѫ; 15. juli 2021 kl. 7:52
< >
Viser 1-9 af 9 kommentarer
Halberd 27. juli 2021 kl. 14:15 
on the thumbnail are those reskins of magnusson and kliener or is it just photoshop
TappyOka 31. juli 2021 kl. 12:19 
Can someone tell me what this LUA error implicates? The addon works fine, but this message keeps on popping up.

[[CTOOLS] NPC Spawner] lua/weapons/gmod_tool/stools/ctools_npc.lua:887: bad argument #1 to 'pairs' (table expected, got nil)
1. pairs - [C]:-1
2. UpdateData - lua/weapons/gmod_tool/stools/ctools_npc.lua:887
3. func - lua/weapons/gmod_tool/stools/ctools_npc.lua:997
4. FillViaFunction - gamemodes/sandbox/gamemode/spawnmenu/controlpanel.lua:100
5. FillViaTable - gamemodes/sandbox/gamemode/spawnmenu/controlpanel.lua:89
6. ActivateTool - lua/includes/modules/spawnmenu.lua:287
7. Open - gamemodes/sandbox/gamemode/spawnmenu/spawnmenu.lua:118
8. Run - gamemodes/sandbox/gamemode/spawnmenu/spawnmenu.lua:253
9. unknown - gamemodes/base/gamemode/cl_spawnmenu.lua:11
10. unknown - lua/includes/modules/concommand.lua:54
Halberd 2. okt. 2021 kl. 21:32 
Post the errors on the "bugs" discussion idiot
Dr. Unusual 20. okt. 2021 kl. 20:17 
Oprindeligt skrevet af ACA The Comedy Coomer:
Post the errors on the "bugs" discussion idiot
That was completely uncalled for
selest19 31. jan. 2022 kl. 15:39 
any idea how to use custom models there are no yt videos on it and the small thing is no help
geckos in tanks 18. nov. 2022 kl. 7:56 
how to use custom models.

mke sure model is compatable as npc.
1. left click and copy model to clipboard
2. paste in custom model.
3. click of box.
4. if it works the npc should be a custom model if not the npc will spawn as a selected npc.

rinse and reapeat if anything gos wrong.
Elisol28 2. maj 2023 kl. 12:21 
How can I make them follow me and try to attack me?
noketheking 5. nov. 2023 kl. 17:51 
is there something im missing nothing happens after i set the area and right click.
noketheking 5. nov. 2023 kl. 19:10 
Oprindeligt skrevet af noketheking:
is there something im missing nothing happens after i set the area and right click.
holy crap its like making that comment allowed it to work wtf
< >
Viser 1-9 af 9 kommentarer
Per side: 1530 50