From 5ee8eb4a2b96b4a9916f85ddec5b43ae24ca93d1 Mon Sep 17 00:00:00 2001 From: salmonik Date: Tue, 3 Nov 2026 23:36:58 +0100 Subject: AI: treat scripted NPCs as neutral; Lamarr neutral Read the server m_NPCState and mark NPC_STATE_SCRIPT actors neutral so cutscene NPCs and scripted pets are not aimbot targets and draw in the neutral colour. Add Lamarr (Kleiner's pet headcrab) to the neutral model list as requested. Also log state changes in the NPC debug line and resolve/log m_NPCState in the server datamap summary. --- CONTEXT.md | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'CONTEXT.md') diff --git a/CONTEXT.md b/CONTEXT.md index 1d365e8..741050d 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -174,6 +174,15 @@ vocabulary / decisions. - Bugbait-controlled antlions are also treated as friendly when their server `m_hFollowTarget` is set, covering antlions that spawned before the global `antlion_allied` state changed. +- Stock NPCs have no `m_Relationship` rows at all: their disposition comes from + the global `CHL2GameRules::InitDefaultRelationships()` table indexed by + `Classify()` (e.g. `CLASS_PLAYER_ALLY -> D_LI`, `CLASS_HEADCRAB -> D_HT`). + That table is not stored per entity, so `relation=-1` is normal and the + model heuristic is the fallback for those NPCs (Kleiner, Combine, ...). +- `m_NPCState` (`FIELD_INTEGER`, server datamap) is read as well: + `NPC_STATE_SCRIPT` (4) marks scripted/passive actors as neutral, so they are + not aimbot targets and draw with the neutral colour. Lamarr + (`models/Lamarr.mdl`) is additionally listed as neutral by model. ## Bones / ESP -- cgit v1.2.3