I present to you, people of the internet, a STool for spawning NPCs in squads.
I’ll allow you a moment to catch your breath.
Ok, so it’s not that impressive, but the brilliance of it is in the simplicity. Have you ever been screwing around in gm_construct and wished the NPCs were a little more…smart? The AI in the source engine is better than that and all you have to do is assign an NPC a squadname key value and give him some friends to get more tactical actions.
NPCs in squads communicate and coordinate attacks and defense, and will call for help from other squad members or faction members from different squads on the map when engaged by enemies, even if those other NPCs would not normally be in range to engage said threat. This is especially cool with Combine NPCs as they will communicate via radio to report contact and losses. Metropolice are even better, communicating with Overwatch as well.
This STool allows you to place NPCs with the tool gun, meaning you can precisely position them. The default setting will place them facing the same direction as the player, but you can use the Angle Offset slider to rotate the NPC. Setting “Align to World” will ignore player facing direction and align to absolute world angles.
New with version 0.9 are a TON more NPCs including rebels and medics, all types of Combine soldiers and neat Combine goodies, Vortigaunts (who will work with Rebels) and other story NPCs, the ability to align to the world or the player’s view direction and offset from there, and a couple other “goodies.” This is much better than version 0.75 you may have seen on garrysmod.org a few days back.
NPCs I’d still like to get working are striders and combine APCs, but that’s for the 1.0 release. The trouble with striders is that they use air nodes instead of ground nodes to navigate, so they tend to stand around in one place as few maps have air nodes.
NPCs who are assigned a squad name after spawning do not change their behavior. This causes the issue with NPCs like Alyx or Barney who are by default in player_squad and will not attach to another one.
Spawning NPCs on a hill may or may not force them into the ground.
Cool things to try!
Make a Combine Scanner in the same squad as a Combine soldier or metrocop.
Group a few different types of zombies together and scatter them over the map.
Add a vortigaunt or two to your rebel squad.
Add Citizens and their rebel brethren to player_squad.
Spawn Breen at precisely 275 degrees aligned to world for your next “KILL BREEN” save file. (It’s a joke from gmod.org that in retrospect wasn’t that funny.)
EDIT (9/3/2010): Added offset sliders.
** Version 0.9**:
If you’re confused, read the readme first. It probably answers the question you want to ask.