Skip to content
Using NPCs and AI Characters
Garry's Mod

Using NPCs and AI Characters

Bring your Garry's Mod worlds to life with NPCs. Learn to spawn, control, and use the AI Tool for dynamic characters and scenarios.

By ···10 min read·Multi-source verified
1 reading this guide  

Bring your Garry's Mod worlds to life with NPCs. Learn to spawn, control, and use the AI Tool for dynamic characters and scenarios.

2.6. Using NPCs and AI Characters

Non-Player Characters (NPCs) and AI characters add life and interactivity to your Garry's Mod creations, serving as allies, enemies, or simply inhabitants of your world. Understanding how to spawn and manipulate them is key to creating dynamic environments.

Garry's Mod offers several NPCs that can be spawned and controlled using the Spawn Menu. These range from basic human models that can be posed and made to perform simple actions, to more complex AI characters with combat routines or dialogue capabilities. The most common way to access NPCs is through the 'NPCs' tab in your Spawn Menu. Here, you'll find categories like 'Combine', 'Civilians', 'Monsters', and 'Friends'. Each NPC has unique behaviors and properties. For instance, 'Combine Soldiers' will typically attack players on sight, while 'Civilians' might wander aimlessly or flee from danger. Once spawned, you can use the 'Physgun' to move them around or the 'Tool Gun' to adjust their properties. The 'AI Tool' allows for more direct control over an NPC's behavior. With the AI Tool, you can set waypoints for them to follow, ass them targets to attack, or even make them perform specific animations. For example, you could create a patrol route for a guard NPC by placing a series of waypoints around your map. You can also use the AI Tool to change an NPC's allegiance, making them friendly or hostile towards specific teams or players. Some NPCs have unique abilities or weapons that can be utilized. For more advanced AI and custom NPC behaviors, you would typically need to use Lua scripting, creating your own custom NPCs with unique AI routines and interactions. This allows for unparalleled control over their actions and responses. Experimenting with different NPC types and the AI Tool is the best way to understand their capabilities and how they can enhance your builds and scenarios.

Here’s how to use basic NPCs:

  1. Open Spawn Menu: Press 'Q' to open your Spawn Menu.
  2. Navigate to NPCs: Select the 'NPCs' tab.
  3. Choose an NPC: Select an NPC from a category (e.g., 'Combine', 'Civilians').
  4. Spawn the NPC: Left-click in the world to place the NPC.
  5. Use the AI Tool (Optional): Select the 'AI Tool' from the Tool Gun to set waypoints or targets.
  6. Manipulate with Physgun: Use the 'Physgun' to move or position the NPC.

When using NPCs in your creations, consider their role in the overall scene. Are they meant to be a threat, an ally, or simply background elements? Their behavior and placement can significantly impact the atmosphere and interactivity of your builds. For example, placing a group of hostile NPCs in a dark alley can create a sense of danger, while friendly NPCs in a town square can make the area feel more alive. For more complex scenarios, you can combine different types of NPCs to create dynamic encounters. You might have a squad of friendly soldiers defending a position against waves of enemy monsters. The possibilities are vast, and with a little experimentation, you can bring your Garry's Mod worlds to life with intelligent and interactive characters.

100% Human-Written. AI Fact-Checked. Community Verified. Learn how AntMag verifies content