Files
EscapistsReintroduced/docs/ai-equipment-migration.md
T

3.8 KiB

Enemy skill and finite Stinger equipment migration

Adapted from independently authored, user-authorized AI code. Original files remain read-only; no original Escapists helpers, protected-derived EAI_GroupLookup, patched prefabs or asset bytes are imported.

Owned source SHA-256 Reused behavior
escapists-ai/Scripts/Game/EscapistsAI/EAI_StingerEquipment.c b8ce09f2d3ed61e58beadc1f158daed6eceb17b08243f7979b46d8c27e917695 One startup selection, native weapon-proxy insertion, five checks, no replacement after firing/dropping/looting
escapists-ai/Scripts/Game/EscapistsAI/EAI_AIResponseSystem.c b3e1263e986837744a70fbaedaa6e57afae7f2981a21211d3a2066e2c63ac84d First combat-component section's Expert skill clamp and native reset handling only; no convoy spawning, original faction/group hooks or other sections imported
escapists-ai/Scripts/Game/EscapistsAI/EAI_AIConfig.c 8c320d3163d443b43e50547734702484c8ad51f2cffe88cf6dfd33aaf339ec01 stingerChanceOneIn, default 15 and valid range 0..10000

The successor HQ owns ERR_EnemyEquipment. Registration supplies exact physical groups; two seconds after group registration, at most five scans discover initialized members. Entries retain exact actor/group identity, with 128 group and 2048 actor limits. Per-actor inventory submission is finite. Accepted pending operations are never repeated; unresolved completion at the fifth check ends processing permanently for that actor. Explicit failure may retry before the fifth check. A success callback ends issuance even if the item was dropped before it could be observed. A late callback after Stop cannot restart this service, although native accepted insertion itself is not cancellable through this API.

The exact allowed launcher is {3DF204EEE0534EF2}Prefabs/Weapons/Launchers/FIM92_Stinger/Launcher_FIM92_Stinger.et, owned by WCS Armaments. The successor requests insertion into PURPOSE_WEAPON_PROXY, preserving native slot constraints and other equipment. It creates no loose ammunition or replenishment; actual prefab loadout and operational AI firing need native validation.

Expert minimum binds only after initialization to an eligible, living, nonplayer member of a registered military enemy group in the active successor mission. Native SetAISkill and ResetAISkill enforce that scoped floor; higher skills are preserved. No perception/target knowledge is changed. Unregistration or Stop clears the binding and restores the skill captured at first binding. Convoy-gunner Cylon specialization is not implemented here because no production convoy-gunner registration exists yet.

Settings migrate through the existing additive-default reader and import helper. Existing valid ten-key/six-key files preserve their values and obtain 15 for missing stingerChanceOneIn; explicitly present malformed values remain invalid. /esc hq stinger show|set N changes only actors that have not rolled yet: 0 disables, 1 selects every eligible actor, 2..10000 selects one in N. The existing ten native menu fields are preserved; this extra key is available through text commands. Unsupported convoy/simulation/start keys are still reported as deferred by the importer, never exposed as working settings.

tests/test_enemy_equipment.py executes actual eligibility, callback, insertion, scoped skill and coordinator bodies against native API doubles. It covers pending nonduplication, success after item removal, finite rejected/failed requests, timeout quarantine, capture, absence, wrong mode/faction/player/client/editor, native resets, higher skills, restoration, delayed group membership, registration dedupe, terminal stop and bounded scans. These are policy regressions, not native inventory or multiplayer proof. Expanded external runtime qualification remains separate.