The placeholder model path (dz\structures\wood\wooden_crate.p3d) does not exist,
so boxes spawned invisible with no selection geometry - hence not visible and no
action (nothing to look at/target). Server logic was fine (8 boxes, proximity
msgs fired). YALootBoxes_Base now uses the vanilla SeaChest model
(\DZ\gear\camping\sea_chest.p3d) plus a 10x10 Cargo grid so the crate renders,
is targetable, and can hold loot. Verified model + texture paths exist locally.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Structure / module placement:
- Add scripts/5_Mission/YALootBoxes_MissionServer.c: a modded MissionServer
that self-starts the manager in OnInit(). No init.c edit required anymore.
- config.cpp: bind 5_Mission to missionScriptModule (4_World stays on
worldScriptModule). Core logic correctly stays in 4_World; only the
mission-lifecycle bootstrap lives in 5_Mission.
Config create/read/write:
- LoadAll now writes populated defaults for ALL four JSON files when missing
(previously only main_config.json was generated; box_types/loot_lists/
spawn_locations were left empty, so a fresh install spawned nothing).
- Add default-data factories (YALB_MkReq/MkFail/MkLoot/MkLoc/MkBoxType) and
DefaultBoxTypes/DefaultLootLists/DefaultSpawnLocations builders mirroring
configfiles.readme. The mod is now self-provisioning on first run.
Docs:
- Prefix.cpp: refreshed folder-layout summary; dropped stale init.c /
simulationModule notes.
- Manager.c: bootstrap comment now points to the 5_Mission self-start.
- README.md: add Install & first-run section.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Root causes from the script log of a failed boot:
- config.cpp bound the 4_World scripts to BOTH gameScriptModule and
worldScriptModule. Compiling 4_World code inside 3_Game made PlayerBase,
Container_Base, ActionContinuousBase and ActionData unknown types, which
cascaded to YALootBoxes_Base and aborted the Game module. Now bound to
worldScriptModule only.
- Static YALB_ConfigLoader.LogLevel collided with a framework type named
LogLevel (CommunityFramework/DabsFramework). Renamed to ActiveLogLevel.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- config.cpp: fix script/config binding. Crates now inherit a shared
YALootBoxes_Base config class (name-matches the script class) instead of
relying on the non-binding simulationModule line. Base class changed from
non-existent ContainerObject to vanilla Container_Base.
- Lootbox.c: same base class change; replace never-called GetActions
override with the engine-correct SetActions()/AddAction().
- ActionOpen.c: BROKEN_BONE now uses player.SetBrokenLegs(eBrokenLegs.
BROKEN_LEGS) instead of bogus GetHealthDamageManager().SetFracture();
DecreaseHealth health-type arg empty-string changed to "Health" (3 sites).
- Config.c: restructure loot lists from a string-keyed map to a flat array
of YALB_LootList{type,entries} for reliable JSON deserialization;
GetLootListForType updated to linear scan; position made a ref array;
document failEffects.chance as a weight, not a probability.
- loot_lists.json (configfiles.readme): match new array schema.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Renamed code prefix LB_ -> YALB_ across all four script files
- Renamed source files LootboxSpawner_*.c -> YALootBoxes_*.c
- Deleted three empty 0-byte stub files (_BoxTypes/_LootLists/_SpawnLocations)
- Fixed folder case scripts/4_world -> scripts/4_World to match config.cpp
- Verified box_types.json className values match CfgVehicles class names
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>