69 lines
4.1 KiB
Markdown
69 lines
4.1 KiB
Markdown
# Enemy infantry loadouts
|
||
|
||
**Esc → Co10 Escape Reintroduced → HQ** has two percentage settings, each accepting
|
||
0–100 or Random:
|
||
|
||
| Setting | Default | Effect |
|
||
| --- | --- | --- |
|
||
| Anti-air launchers | 7% | One initially loaded faction MANPADS, with FIM-92 fallback |
|
||
| Anti-personnel mines | 60% | Up to two carried PMN-4 mines, subject to inventory space |
|
||
|
||
These are independent per-soldier grant probabilities, not exact population quotas.
|
||
They apply to eligible living, nonplayer military members of mission-owned hostile
|
||
groups, including hostile independent factions. Existing authored equipment is
|
||
preserved. Specialist loadouts that bypass ordinary fitting remain unchanged.
|
||
Changing a value affects soldiers whose initial roll has not happened yet; it does
|
||
not reroll existing soldiers. Mines are inventory loot, not automatically planted.
|
||
|
||
Commands are `/esc hq aa show|set N|set random` and
|
||
`/esc hq mines show|set N|set random`. The old `/esc hq stinger set N` alias now
|
||
means a percentage. Server authentication and the existing settings save/validation
|
||
path apply. Canonical keys are `antiAirChancePercent` and
|
||
`antiPersonnelMineChancePercent`. Old `stingerChanceOneIn` files migrate to the
|
||
nearest integer percentage: 0 → 0%, 1 → 100%, 15 → 7%, 37 → 3%.
|
||
Very small probabilities can round to zero. The canonical key takes precedence.
|
||
Missing settings default to 7% and 60%.
|
||
|
||
## Faction launchers and modder overrides
|
||
|
||
An `ERR_ContentOption` can specify `AntiAirLauncher` as a prefab ResourceName.
|
||
The lookup matches `NativeFactionKey` in `Configs/ERR/ContentRegistry.conf`.
|
||
Otherwise, enabled entries in that faction's native ITEM catalog are checked for
|
||
MANPADS prefab names (Stinger/FIM92, Igla, Strela or MANPAD under Launchers).
|
||
Catalog inspection is bounded to 4,096 entries. Unrecognized naming requires an
|
||
explicit override. USSR/FIA use the installed WCS Igla when no catalog candidate
|
||
exists. Other factions, unavailable resources and confirmed insertion failures
|
||
fall back to the WCS FIM-92; no additional mod dependency was added.
|
||
|
||
The runtime verifies that the replacement physically occupies a weapon slot,
|
||
is a rocket launcher, and has a chambered round or loaded magazine. A newly
|
||
issued unusable replacement is removed only while still in that soldier's
|
||
inventory, with confirmed deletion before the FIM request. Authored equipment
|
||
is never deleted to make room. This verifies equipment and ammunition, not the
|
||
mod's targeting/lock-on behavior in combat.
|
||
|
||
Inventory operations have finite startup checks. Pending operations are not
|
||
repeated or replaced while their result is unknown. Dropping, firing or looting a
|
||
granted launcher does not earn a new one; mine allowance is likewise finite.
|
||
No loose items are spawned when inventory capacity is unavailable.
|
||
`AA PROFILE`, `AA EQUIPMENT`, `AA FALLBACK` and `MINE EQUIPMENT` journal entries
|
||
record selection, grants and failure reasons.
|
||
|
||
## Verification
|
||
|
||
`test_enemy_loadout.py` executes production grant methods with native API doubles:
|
||
all percentage boundaries, preferred success, fallback, exact-item removal,
|
||
pending-operation quarantine, missing/looted items, capture, authored mines and
|
||
finite mine grants. Existing coordinator, admin/menu and settings migration tests
|
||
cover integration. `--project core --smoke enemy-loadout` is a Workbench-only
|
||
fixture for physical inventory, loaded weapons and HQ menu capture.
|
||
|
||
The 2026-09-23 local Workbench fixture completed four assertions with no script
|
||
or runtime failures: persisted percentage settings, a physical test group, loaded
|
||
WCS Igla and fallback FIM-92 plus two carried AP mines, and HQ navigation.
|
||
The native checker still reports installed RHS/WCS localization/resource and
|
||
external prefab-field errors; this is not a clean whole-mod engine report.
|
||
Multiplayer replication and actual missile targeting/firing were not tested.
|
||
|
||
Final local fixture logs: `/tmp/erri-loadouts-native2/logs/logs_2026-09-23_15-29-59`. Source and external-addon fingerprints remained unchanged; runner cleanup was confirmed. Native menu navigation passed, but the engine screenshot omitted the overlay and the separate display capture failed, so visual layout acceptance remains unverified.
|