// ============================================================ // FILE: config.cpp // Place at mod root: YALootBoxes/config.cpp // ============================================================ class CfgPatches { class YALootBoxes { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = { "DZ_Data", "DZ_Scripts" }; }; }; class CfgMods { class YALootBoxes { dir = "YALootBoxes"; picture = ""; action = ""; hideName = 1; hidePicture = 1; name = "YALootBoxes"; credits = ""; author = ""; authorID = "0"; version = "1.0.0"; extra = 0; type = "mod"; dependencies[] = { "Game", "World", "Mission" }; class defs { // 4_World code (PlayerBase, Container_Base, ActionContinuousBase, // ActionData, etc.) must load ONLY into the World script module. // Binding it to gameScriptModule too forces it to compile inside // 3_Game - where those World types don't exist yet - which is what // produced all the "Unknown type" errors and aborted the server. class worldScriptModule { value = ""; files[] = { "YALootBoxes/scripts/4_World" }; }; // 5_Mission bootstrap: a modded MissionServer that self-starts the // lootbox manager. Lives in the Mission module because that's the // only module with a mission-lifecycle entry point (OnInit). class missionScriptModule { value = ""; files[] = { "YALootBoxes/scripts/5_Mission" }; }; }; }; }; // ------------------------------------------------------------ // Lootbox entity classes. // // BINDING: DayZ binds a CfgVehicles class to a script class by // NAME. The three crate classes below do NOT each need their own // script class - instead they all inherit from a shared config // class "YALootBoxes_Base" whose name matches the script class in // YALootBoxes_Lootbox.c. The engine walks the config inheritance // chain upward until it finds a matching script class, so every // crate resolves to the YALootBoxes_Base script type. The old // "simulationModule" line did NOT do this and has been removed. // // BASE CLASS: these inherit from vanilla "Container_Base" (a real // lootable container base). "ContainerObject" used previously is // not a vanilla class. >>> VERIFY against your SDK <<< and, if the // crate spawns with no cargo space, add a Cargo grid definition // (e.g. itemsCargoSize[] = {x,y};) to YALootBoxes_Base below - the // wooden_crate model + Container_Base may need it to hold loot. // // MODEL: wooden_crate.p3d path is a placeholder; replace with a // real p3d you have. >>> VERIFY model path against your SDK <<< // ------------------------------------------------------------ class CfgVehicles { class Container_Base; // Shared, non-spawnable base. Name MUST match the script class // "YALootBoxes_Base" in YALootBoxes_Lootbox.c for binding. class YALootBoxes_Base : Container_Base { scope = 0; vehicleClass = "Containers"; model = "\dz\structures\wood\wooden_crate.p3d"; }; class YALootBoxes_Crate_Military : YALootBoxes_Base { scope = 2; displayName = "Military Crate (Locked)"; }; class YALootBoxes_Crate_Medical : YALootBoxes_Base { scope = 2; displayName = "Medical Crate (Locked)"; }; class YALootBoxes_Crate_Industrial : YALootBoxes_Base { scope = 2; displayName = "Industrial Crate (Locked)"; }; };