Tutorial / Admin panels > AI
NPC AI
See every NPC on the map, switch NPC AI on or off, edit, heal, freeze or remove NPCs, and set profiles for NPC tags.
What it does
NPC AI lists every NPC on the map, nearest first, with its health, order, tag and distance. Right-click an NPC to go to it, bring it, edit it, heal it, freeze its AI, release its orders, kill it or remove it.
The switches at the top control NPCs server-wide: turn all AI off, make NPCs ignore players, stop orders from the AI tools, and set the NPC difficulty.
The NPC tags section gives each tag a profile: a job, an attitude to players, running away or giving up, and a weapon. Every NPC with the tag gets the profile, also after it respawns.
Where to find it
Q menu > KGX's Admin Toolbox > AI > NPC AI.
Admins can use it. Other players can use it if they are given NPC AI (NPC list, AI switches, NPC editor) in Settings > Player Access.
The panel
AI switches
| Option | What it does | Default |
|---|---|---|
| AI off (every NPC stands still: ai_disabled) | Sets ai_disabled: every NPC stands still |
Off |
| NPCs ignore players (ai_ignoreplayers) | Sets ai_ignoreplayers |
Off |
| NPCs carry out orders from the AI tools (kgxat_ai_orders) | Off: orders from Commander, Patrol & Guard and AI Paths stop being carried out | On |
| NPC difficulty (skill) | Easy, Normal or Hard (sets skill to 1-3) |
The server's current skill |
NPC list
| Column | What it shows |
|---|---|
| NPC | Name and entity number; "(frozen)" when its AI is frozen |
| Health | Health / max health |
| Order | Its current order, or "-" |
| Tag | Its NPC tag, or "-" |
| Distance | Distance from you |
Right-click an NPC for Go to, Bring, Edit..., Heal, Freeze / unfreeze AI, Release orders, Kill and Remove. Double-click an NPC to go to it.
| Button | What it does |
|---|---|
| Refresh | Reloads the list and the switches |
| Release every NPC's orders | Every NPC goes back to its own AI |
| Heal every NPC | Heals every NPC to its max health |
| Remove every NPC (not the map's) | Removes every spawned NPC after a confirmation. NPCs that came with the map stay. |
Edit... opens the same window as the NPC Editor tool: health, max health, weapon, accuracy, squad, size, AI frozen, and the AI Brain fields (name, tag, job, seconds between tasks, runs away, gives up, self-destruct).
NPC tags
| Option | What it does |
|---|---|
| Tags list | Columns Tag, NPCs (how many have it) and Route / post (what Patrol & Guard binds to it). "(no profile)" after a tag means no profile is saved. Click a tag to load it. |
| Tag | The tag name |
| Job (AI Brain) | Unchanged, Idle, Police, Lockpicker, Bomber, Hacker, Collector, Prop resetter, Pest |
| Attitude to players | Unchanged, Friendly, Neutral, Hostile, Afraid |
| Runs away when badly hurt | Unchanged, Yes, No |
| Gives up to players when badly hurt | Unchanged, Yes, No |
| Weapon (when it has none) | Unchanged, Pistol, .357 Magnum, SMG, AR2 (pulse rifle), Shotgun, Crossbow, RPG, Crowbar, Stun stick |
| Save the tag's profile | Saves the profile and applies it to every NPC with the tag |
| Apply again to every NPC with this tag (replaces their orders) | Applies the profile and the tag's route or post again, also over orders given by hand |
| Delete the tag's profile | Deletes the profile |
How to use it
Freeze every NPC for a moment
- Tick AI off (every NPC stands still: ai_disabled).
- Untick it to let them move again.
Clean up spawned NPCs
- Click Remove every NPC (not the map's).
- Confirm with Remove.
Find and fix one NPC
- Find it in the list; the nearest NPC is on top.
- Right-click it and pick Edit....
- Change what you need and click Save.
Make a tag of friendly police
- Give NPCs a tag, for example
guards, with the NPC Editor, an NPC Spawner or a Talking NPC with a real NPC body. - In NPC tags, type
guardsin Tag, set Job (AI Brain) to Police and Attitude to players to Friendly. - Click Save the tag's profile. The tagged NPCs show "Job: Police" on their card.
Settings and commands
| Setting | What it does | Default |
|---|---|---|
kgxat_ai_orders |
1 = NPCs carry out orders from the AI tools | 1 |
ai_disabled |
Game setting: 1 = NPC AI off | 0 |
ai_ignoreplayers |
Game setting: 1 = NPCs ignore players | 0 |
skill |
Game setting: NPC difficulty 1-3 |
Tips and limits
- The list shows at most 300 NPCs.
- Tag profiles are saved per map in
data/kgx_admin_toolbox/aitags_<map>.json, at most 64 profiles. - Tags use letters, digits, _ and -, up to 32 characters, in lower case.
- The profile's weapon is given only to NPCs that have no weapon.
- Apply again... with an empty Tag field applies to every tagged NPC.
- Orders given by hand (Commander, AI Paths) are kept when a profile is saved. Only Apply again... replaces them.
- AI off, ignore players, difficulty, and the three "every NPC" buttons are written to the Action Log, as are saved and deleted tag profiles.