Tutorial / Tools > AI
NPC Editor
Edit everything about an NPC on one page: loadout, model, look, combat, death & loot, type options and AI.
What it does
NPC Editor opens the NPC Editor page for the NPC you aim at (UPDATE v3.6.21.6.1). A turning preview of the NPC is on the left, with the buttons; the settings are in tabs on the right: General, Loadout, Look, Combat, Death & loot, Type options and AI.
Admins can also Save to map: the NPC comes back after every restart with everything set on the page.
Right click freezes or unfreezes the NPC's AI without opening the page. Reload heals it to full.
Where to find it
Q menu > KGX's Admin Toolbox > AI > NPC Editor.
Admins can use it. Other players can use it only if they are given the tool in Settings > Player Access. The same page also opens from AI > NPC AI (right-click an NPC > Edit...).
Given to a player: their own NPCs nearby. They get General, Loadout, Look (not the model), holding its position, the body and weapon drop, and AI. The rest is greyed out: it needs admin or the NPC AI panel. Toward players needs the NPC Relationships tool too.
Controls
| Key | What it does |
|---|---|
| Left click | Open the NPC Editor page for the aimed NPC |
| Right click | Freeze or unfreeze the aimed NPC's AI |
| Reload | Heal the aimed NPC to full |
The buttons
| Button | What it does |
|---|---|
| Apply | Saves every tab and keeps the page open; the page comes back with the result (a new model's skins and body groups show then). |
| Save & close | Saves every tab and closes the page. |
| Copy settings | Remembers this page's settings. |
| Paste settings | Puts the copied settings on this NPC: health, weapon, look, combat, death & loot, type flags and AI. The model, body groups and the kind's own options are not pasted. |
| Save to map | Admins. Saves the NPC with every setting here; World > Permanent Entities lists it. Not shown for NPCs that are part of the map. |
| Remove from the map save | Admins, NPCs saved to the map. It stays for now but does not come back after a restart. While it is saved, Apply keeps the map save up to date. |
Under the preview: its kind, health, and whether it is saved to the map.
The tabs
General
| Option | What it does | Range |
|---|---|---|
| Name | The name shown on its look-at card | 32 characters |
| Health / Max health | Its health | 1-1000000 |
| Size | Model scale | 0.25-3 |
| Squad | NPCs with the same squad name fight together. Empty = no squad. | Letters, digits, _ and -, 32 characters |
| Tag | Binds it to the route or guard post with the same tag (AI > Patrol & Guard) and to the tag's profile (AI > NPC AI > NPC tags). Empty = no tag. | Letters, digits, _ and -, 32 characters |
Loadout
| Option | What it does |
|---|---|
| Weapon | (keep: ...), None (take it away), or any NPC weapon |
| Accuracy | (keep), Poor, Average, Good, Very good, Perfect |
| Drops its weapon when it dies | Off: the weapon goes with it |
NPCs carry one weapon and never run out of ammo. Grenades, manhacks and ammo-giving are under Type options.
Look
| Option | What it does |
|---|---|
| Model | Admins. Type a model path or pick one from Pick a model (every NPC and player model). A model made for another kind of creature can look or move wrong. Skin and body groups start fresh with a new model. |
| Skin | Its skin, if the model has more than one |
| Body: ... | One slider per body group of the model (heads, hats, gear) |
| Color | Any color; the last bar makes it see-through. Players' NPCs never go fully invisible. |
| Material | A material over the whole model, or empty for its own. Pick a material lists the usual ones; admins can type any path. |
| Blood | As spawned, Red, Yellow, Green, Sparks (machine), Antlion, Zombie, Antlion worker, No blood |
The preview shows the model, skin, body groups, color and material before you apply.
Combat
| Option | What it does | Range |
|---|---|---|
| Toward players | As spawned (puts back how it felt before), Friendly, Neutral (ignores players), Hostile, Afraid (runs away). Stays when the AI > NPC Relationships rules run again. | |
| Holds its position | It fights but does not walk | |
| God mode | Admins. It takes no damage (Kill in AI > NPC AI still works) | |
| Damage it takes (x) | Admins. 1 = normal, 0.5 = half, 2 = double | 0-20 |
| Damage it does (x) | Admins. Its bullets, melee and grenades | 0-20 |
| Health back per second | Admins. Up to its max health | 0-10000 |
| Sight distance | Admins. How far it sees and shoots; 0 = as spawned | 0-32768 |
Death & loot
| Option | What it does | Range |
|---|---|---|
| Its body fades away | The body fades after a while | |
| Loot table | Admins (or the NPC AI panel with the Money tool), as are the next three rows. Picks from a loot table (World > Create Storage > Loot tables) go into a bag at its body | |
| Loot picks, at least / at most | Admins. How many picks | 0-30 |
| Cash it drops, at least / at most | Admins. Cash on the ground (needs the economy on) | 0-1000000000 |
| Money for whoever kills it | Admins. Straight into the killer's wallet (needs the economy on) | 0-1000000000 |
| Comes back after (seconds) | Admins. It comes back where it stood when you last pressed Apply, with these settings. 0 = it stays dead. At least 10 seconds when it drops loot or money. | 0-3600 |
NPCs saved to the map always come back after a restart; while the map is running, Comes back after brings them back after they die too. For a saved NPC the page shows the map save's time and hold, and only an admin's Apply changes the map save.
At most 30 loot bags from NPCs are on the map at once; the oldest go first. Clean up map cancels NPCs waiting to come back (saved NPCs come back with the map save).
Type options
Every NPC (admins): | Option | What it does | |---|---| | Quiet | No idle sounds until it fights | | Drops a health kit when it dies | | | Players cannot push it out of the way | |
Per kind: | NPC | Options | |---|---| | Citizens and rebels | Medic: heals players, Gives ammo to players, Ammo it gives (SMG, pistol, pulse rifle, shotgun, .357, crossbow bolts, rockets, grenades, SMG grenades), Ammo it gives each time (1-500), Players cannot command it | | Combine soldiers | Grenades (0-99), Tactics: Normal, Pressure (rushes in), Pressure until close | | Metro Police | Manhacks it can throw (0-5) |
AI
| Option | What it does | Range |
|---|---|---|
| AI frozen | It stands still and does nothing | |
| Job | None, Idle, Police, Lockpicker, Bomber, Hacker, Collector, Prop resetter, Pest | |
| Seconds between tasks (0 = AI Brain setting) | Pause between two tasks of its job | 0-600 |
| Runs away when badly hurt | AI Brain setting, Yes or No | |
| Gives up to players when badly hurt | AI Brain setting, Yes or No | |
| Self-destruct: explodes when it dies | Radius 220, 90 damage |
The jobs
| Job | What it does |
|---|---|
| None | Does what its kind does |
| Idle | Stands where it is and does nothing on its own |
| Police | Friendly to police jobs; goes to robberies and attacks the robber; attacks who attacks it |
| Lockpicker | Picks the locks of locked property doors close by; the owner is told |
| Bomber | Puts Door Explosives on locked property doors close by, then runs |
| Hacker | Hacks keypads close by (their doors open) |
| Collector | Picks up what item spawners make (weapons, health kits) |
| Prop resetter | Puts moved map props back where they belong, one at a time |
| Pest | Follows a player around and gets in the way |
Jobs work only while the NPC has no order from Commander, Patrol & Guard or AI Paths.
How to use it
Make a boss
- Aim at the NPC and left click.
- General: Max health 2000, Health 2000, Size 1.5. Loadout: a weapon, Accuracy Perfect.
- Combat: Damage it does 2, Health back per second 10. Death & loot: a loot table and Money for whoever kills it 500.
- Click Apply and check the preview, then Save & close.
A guard that is always there
- Place the NPC where it should stand and left click it.
- Combat: Toward players Hostile, tick Holds its position.
- Click Save to map. After a restart it is back, with the same settings.
Give ten NPCs the same settings
- Set up one NPC and click Copy settings.
- Left click the next NPC and click Paste settings. Repeat.
A medic citizen
- Left click a citizen. Type options: tick Medic: heals players.
- Combat: Toward players Friendly. Apply.
Tips and limits
- Changes apply to that NPC. Without Save to map they are gone after a restart (a tag on a permanent NPC is kept, as before).
- Type options and spawn flags take effect from now on; a few kinds read some of them only when they spawn.
- Comes back after waits at most 64 NPCs at once.
- Reload sets health to max health; it never lowers it.
- Job settings for the whole server are in AI > AI Brain.
- Every save is written to the Action Log.