Action (the real "no action" cause): - DayZ does not auto-discover custom actions; ActionConstructor holds a hardcoded list and AddAction() silently drops anything missing from it. Added a modded ActionConstructor that registers YALB_ActionOpenLootbox, so the open action finally attaches to the box. - Switched the action target condition CCTObject -> CCTCursor (the look-at pattern vanilla uses for world-object interactions). Restart stacking: - Spawn boxes with CreateObjectEx + ECE_NOPERSISTENCY_WORLD so they are never saved to the world DB and don't survive restarts. - Added CleanupOrphanedBoxes(): on init, scan each spawn location and delete any leftover YALootBoxes_Base before spawning (clears boxes persisted before this change). Logging: - DebugLogLevel changed from a string to a numeric field (0=off 1=ERROR 2=WARN 3=INFO 4=DEBUG 5=VERBOSE), clamped at load. Removed the string parser. NOTE: existing main_config.json has a string value and must be regenerated. Config docs: - Each generated JSON now includes a "_comment" array describing every field and its range (ignored by the loader). README + configfiles.readme updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
134 lines
No EOL
5.7 KiB
Text
134 lines
No EOL
5.7 KiB
Text
// ============================================================
|
|
// These are REFERENCE/DEFAULT files. The mod auto-generates
|
|
// these on first run at: $profile:YALootBoxes\*.json
|
|
// Edit them there - do NOT edit inside the .pbo.
|
|
// ============================================================
|
|
|
|
|
|
// ------------------------------------------------------------
|
|
// FILE: main_config.json
|
|
// ------------------------------------------------------------
|
|
// On first run the mod also writes a "_comment" array into each generated
|
|
// file describing every field and its range. (Delete the json to regenerate.)
|
|
{
|
|
"MaxActiveLootboxes": 30, // max boxes alive at once (1-100; capped by spawn_locations count)
|
|
"GlobalCheckIntervalSeconds": 60, // seconds between despawn/respawn checks (10-600)
|
|
"DefaultDespawnMinutes": 15, // fallback lifetime if a box type omits despawnMinutes (1-1440)
|
|
"OpenChannelDurationSeconds": 5, // hold-to-open time in seconds (1-30)
|
|
"ProximityMessageRangeMeters": 3.0,// range of the "Requires: X" hint, meters (1-20)
|
|
"DebugLogLevel": 3 // 0=off 1=ERROR 2=WARN 3=INFO 4=DEBUG 5=VERBOSE
|
|
}
|
|
|
|
|
|
// ------------------------------------------------------------
|
|
// FILE: box_types.json
|
|
// ------------------------------------------------------------
|
|
{
|
|
"BoxTypes": [
|
|
{
|
|
"className": "YALootBoxes_Crate_Military",
|
|
"type": "military",
|
|
"requiredItems": [
|
|
{ "classname": "BoltCutters", "displayName": "Bolt Cutters" },
|
|
{ "classname": "Crowbar", "displayName": "Crowbar" }
|
|
],
|
|
"openChance": 0.65,
|
|
"itemDamageOnOpen": 8.0,
|
|
"despawnMinutes": 15,
|
|
"failEffects": [
|
|
{ "type": "EXPLOSIVE", "chance": 0.15, "damage": 45.0, "radius": 2.5 },
|
|
{ "type": "HEALTH", "chance": 0.25, "damage": 15.0 },
|
|
{ "type": "BLEEDING", "chance": 0.30, "bleedSources": 2 },
|
|
{ "type": "SICKNESS", "chance": 0.15, "agent": "Salmonella" },
|
|
{ "type": "BROKEN_BONE", "chance": 0.15 }
|
|
]
|
|
},
|
|
{
|
|
"className": "YALootBoxes_Crate_Medical",
|
|
"type": "medical",
|
|
"requiredItems": [
|
|
{ "classname": "Hacksaw", "displayName": "Hacksaw" }
|
|
],
|
|
"openChance": 0.80,
|
|
"itemDamageOnOpen": 4.0,
|
|
"despawnMinutes": 15,
|
|
"failEffects": [
|
|
{ "type": "SICKNESS", "chance": 0.50, "agent": "Influenza" },
|
|
{ "type": "HEALTH", "chance": 0.30, "damage": 8.0 },
|
|
{ "type": "BLEEDING", "chance": 0.20, "bleedSources": 1 }
|
|
]
|
|
},
|
|
{
|
|
"className": "YALootBoxes_Crate_Industrial",
|
|
"type": "industrial",
|
|
"requiredItems": [
|
|
{ "classname": "Crowbar", "displayName": "Crowbar" },
|
|
{ "classname": "WeldingMask", "displayName": "Angle Grinder" }
|
|
],
|
|
"openChance": 0.50,
|
|
"itemDamageOnOpen": 12.0,
|
|
"despawnMinutes": 20,
|
|
"failEffects": [
|
|
{ "type": "EXPLOSIVE", "chance": 0.20, "damage": 60.0, "radius": 3.0 },
|
|
{ "type": "BROKEN_BONE", "chance": 0.25 },
|
|
{ "type": "BLEEDING", "chance": 0.30, "bleedSources": 2 },
|
|
{ "type": "HEALTH", "chance": 0.25, "damage": 20.0 }
|
|
]
|
|
}
|
|
]
|
|
}
|
|
|
|
|
|
// ------------------------------------------------------------
|
|
// FILE: loot_lists.json
|
|
// ------------------------------------------------------------
|
|
{
|
|
"LootLists": [
|
|
{
|
|
"type": "military",
|
|
"entries": [
|
|
{ "classname": "AKM", "chance": 0.10, "minCount": 1, "maxCount": 1 },
|
|
{ "classname": "Mag_AKM_30Rnd", "chance": 0.40, "minCount": 1, "maxCount": 3 },
|
|
{ "classname": "PlateCarrierVest","chance": 0.20, "minCount": 1, "maxCount": 1 },
|
|
{ "classname": "TacticalHelmet", "chance": 0.15, "minCount": 1, "maxCount": 1 },
|
|
{ "classname": "Ammo_762x39", "chance": 0.50, "minCount": 1, "maxCount": 2 }
|
|
]
|
|
},
|
|
{
|
|
"type": "medical",
|
|
"entries": [
|
|
{ "classname": "Morphine", "chance": 0.30, "minCount": 1, "maxCount": 1 },
|
|
{ "classname": "SalineBagIV", "chance": 0.25, "minCount": 1, "maxCount": 2 },
|
|
{ "classname": "VitaminBottle", "chance": 0.50, "minCount": 1, "maxCount": 3 },
|
|
{ "classname": "Bandage", "chance": 0.60, "minCount": 2, "maxCount": 5 },
|
|
{ "classname": "TetracyclineAntibiotics", "chance": 0.20, "minCount": 1, "maxCount": 2 }
|
|
]
|
|
},
|
|
{
|
|
"type": "industrial",
|
|
"entries": [
|
|
{ "classname": "WeldingMask", "chance": 0.15, "minCount": 1, "maxCount": 1 },
|
|
{ "classname": "Battery_Car", "chance": 0.30, "minCount": 1, "maxCount": 1 },
|
|
{ "classname": "SparkPlug", "chance": 0.40, "minCount": 1, "maxCount": 2 },
|
|
{ "classname": "MetalPipe", "chance": 0.50, "minCount": 1, "maxCount": 4 },
|
|
{ "classname": "DuctTape", "chance": 0.45, "minCount": 1, "maxCount": 2 }
|
|
]
|
|
}
|
|
]
|
|
}
|
|
|
|
|
|
// ------------------------------------------------------------
|
|
// FILE: spawn_locations.json
|
|
// ------------------------------------------------------------
|
|
{
|
|
"SpawnLocations": [
|
|
{ "name": "NWAF_Hangar1", "position": [4985.3, 320.5, 2456.8], "boxType": "military" },
|
|
{ "name": "NWAF_Hangar2", "position": [5102.7, 318.9, 2401.2], "boxType": "military" },
|
|
{ "name": "Tisy_Bunker_A", "position": [1606.4, 280.1, 14383.9],"boxType": "military" },
|
|
{ "name": "Berezino_Hospital", "position": [7245.1, 12.4, 13889.6], "boxType": "medical" },
|
|
{ "name": "Zelenogorsk_Clinic", "position": [2543.9, 8.2, 5234.7], "boxType": "medical" },
|
|
{ "name": "Tractor_Plant_1", "position": [9821.2, 145.6, 8421.3], "boxType": "industrial" },
|
|
{ "name": "Tractor_Plant_2", "position": [9890.5, 142.1, 8390.7], "boxType": "industrial" }
|
|
]
|
|
} |