Customizing NPC Properties
Non-Player Characters (NPCs) are the backbone of many Garry's Mod scenarios, from combat encounters to roleplaying interactions. While you can spawn them directly, customizing their properties allows for far greater control over their behavior, appearance, and capabilities, transforming them from generic entities into unique characters or formidable foes.
Once you've spawned an NPC using the "NPCs" tab in the spawn menu, you can modify its properties using the Tool Gun. Aim at the NPC and press your right mouse button to bring up the context-sensitive menu for that NPC. This menu will vary depending on the type of NPC, but common customization options include:
General Properties:
- Health: Adjust the NPC's maximum health points. You can make them incredibly durable or fragile.
- Armor: Some NPCs can have armor values applied, providing an additional layer of damage resistance.
- Team: Ass the NPC to a specific team (e.g., Combine, Rebel, Player). This affects their AI behavior, such as who they will attack.
- Model: For certain NPCs, you can change their appearance by selecting a different model. This is particularly useful for creating variations of standard enemies or for roleplaying.
AI and Behavior:
The AI of NPCs can be sificantly tweaked:
- Aggression: Control how quickly an NPC becomes hostile towards players or other factions.
- Combat Behavior: Some NPCs have options to control their combat style, such as whether they take cover, flank, or use specific weapons.
- Friendliness: You can make NPCs friendly towards players, turning them into allies or followers.
- Pathfinding: While less common to directly edit, the underlying pathfinding AI determines how NPCs navigate the map.
Specific NPC Types and Their Customizations:
Different NPC types offer unique customization options:
- Combine Soldiers: You can often change their weapon loadouts, armor types, and even their rank or squad desation.
- Zombies: Adjust their speed, damage, and how they react to sound or sight.
- Friendly NPCs: For NPCs that can be made friendly, you might find options to control their follow distance or whether they engage in combat.
Using the NPC Tool (Advanced):
For more complex scenarios, the "NPC Tool" in the "Tools" tab offers even deeper customization. This tool allows you to:
- Set Patrol Paths: Define specific routes for NPCs to follow.
- Create Triggered Events: Make NPCs react to specific triggers, such as entering an area or hearing a sound.
- Spawn NPCs with Specific Loadouts: Pre-configure their weapons and equipment before they spawn.
Example Scenario: Creating a Custom Guard Post
- Spawn a Combine Soldier.
- Using the Tool Gun, set its health to maximum and ass it to the "Combine" team.
- Change its weapon to a shotgun for increased threat.
- Use the NPC tool to set a patrol path around a desated area.
- Optionally, spawn another Combine Soldier and set it to be friendly, making it a guard dog for your post.
By understanding and utilizing these customization options, you can create dynamic and engaging encounters, populate your worlds with believable characters, and build complex AI-driven scenarios that go far beyond simple prop placement.