diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-03 23:07:40 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-03 23:07:40 +0100 |
| commit | 3249caf17de0dcab005398995ef3e611b3f81131 (patch) | |
| tree | 159ed49a5010d330e52322572026e0bcd046717a /CONTEXT.md | |
| parent | AI: debug-log NPC relation changes (diff) | |
| download | hl2h-3249caf17de0dcab005398995ef3e611b3f81131.tar.gz hl2h-3249caf17de0dcab005398995ef3e611b3f81131.zip | |
AI: fix relationship lookup; classify citizen/hacked turrets
m_Relationship is DEFINE_UTLVECTOR (FIELD_CUSTOM), not FIELD_EMBEDDED, so the
datamap scan always returned -1 and every NPC fell back to the model
heuristic. Resolve it as FIELD_CUSTOM with an embedded fallback.
Floor turrets never add relationship rows when friendly: CNPC_FloorTurret
overrides Classify() to CLASS_PLAYER_ALLY for citizen-built
(SF_FLOOR_TURRET_CITIZEN) and Alyx-hacked turrets. Read m_spawnflags and
m_bHackedByAlyx from the server instead.
Widen the datamap offset window (0x4..0x4000) for derived-class fields and
log the new offsets plus turret state in the NPC debug line.
Diffstat (limited to '')
| -rw-r--r-- | CONTEXT.md | 7 |
1 files changed, 7 insertions, 0 deletions
| @@ -157,6 +157,13 @@ vocabulary / decisions. | |||
| 157 | - This makes map-scripted friendly turrets and other relationship overrides | 157 | - This makes map-scripted friendly turrets and other relationship overrides |
| 158 | dynamic instead of model-name guesses. When no row exists, the old model | 158 | dynamic instead of model-name guesses. When no row exists, the old model |
| 159 | heuristic is used. | 159 | heuristic is used. |
| 160 | - `m_Relationship` is declared with `DEFINE_UTLVECTOR`, so its datamap entry | ||
| 161 | is `FIELD_CUSTOM` (not `FIELD_EMBEDDED`). Resolving it as embedded silently | ||
| 162 | returned `-1` for every NPC. | ||
| 163 | - Floor turrets are special: citizen-built turrets (`SF_FLOOR_TURRET_CITIZEN`, | ||
| 164 | spawnflags `0x200`) and Alyx-hacked turrets (`m_bHackedByAlyx`) report | ||
| 165 | `CLASS_PLAYER_ALLY` from their overridden `Classify()` and never add a | ||
| 166 | relationship row. They are classified from those server fields instead. | ||
| 160 | - Bugbait-controlled antlions are also treated as friendly when their server | 167 | - Bugbait-controlled antlions are also treated as friendly when their server |
| 161 | `m_hFollowTarget` is set, covering antlions that spawned before the global | 168 | `m_hFollowTarget` is set, covering antlions that spawned before the global |
| 162 | `antlion_allied` state changed. | 169 | `antlion_allied` state changed. |
