Skip to content

2. Door Configuration

cjcarw edited this page Sep 21, 2025 · 10 revisions

2. Door Configuration (JSON)

Every door you want the mod to control must have its own .json configuration file inside the BS_KeyRoom/DoorConfigs/ folder.

2.1. Auto-Creating Configs with the Admin Tool

To make creating new door configurations incredibly easy, the mod includes an in-game admin tool.

Steps:

  1. Enable Debug Mode: In your BS_KeyRoom_Settings.json file, make sure debug_build is set to 1 (or true).
  2. Get The Tool: As an admin, spawn the item BS_DoorLocker.
  3. Aim and Generate: With the BS_DoorLocker in your hands, aim at the door you wish to configure and hold down the left mouse button. The action is called "Setup Keycard Door".
  4. Check Your Files: Upon completion, a new .json file will be generated in your DoorConfigs folder. This file will contain the building coordinates, door position, and door index, ready for you to customize.

2.2. Detailed Door JSON Parameters

Below is a comprehensive list of every parameter you can use in a door's JSON file, with a full explanation for each.

{
    "x": 3689.39, "y": 5985.54, "z": 403.74,
    "building_x": 3686.41, "building_y": 5982.14, "building_z": 407.67,
    "door_indices": [ 0, 1 ],
    "Location_Name": "GreenMountain_Barracks_Main",
    "BuildingClassName": "Land_Mil_Barracks5",
    "keycard_class_name": "BS_keycard_lab_red",
    "unlockOnly": 0,
    "use_announcement": 1,
    "announcement_title": "ALERT",
    "announcement_text": "A red keycard has been activated at Green Mountain.",
    "announcement_color_rgba": "255,220,53,69",
    "use_alarm": 1,
    "alarm_sound": "Alarm_Military",
    "alarm_duration": 45,
    "alarm_loop_delay": 1.8,
    "min_unlock_time": 5,
    "max_unlock_time": 10,
    "min_restock_time": 300,
    "max_restock_time": 600,
    "containers_only": 0,
    "min_containers_to_spawn": 1,
    "max_containers_to_spawn": 2,
    "persistCooldownOnRestart": 1,
    "use_safety_teleport": 1,
    "safety_teleport_radius": 50.0,
    "use_custom_teleport_points": 1,
    "custom_teleport_points": [ "3670.0 402.0 5995.0" ],
    "containers": [],
    "doorSpecificLootPools": [],
    "spawn_hacked_crate": 0,
    "hacked_crate_classname": "",
    "hacked_crate_position": "0 0 0",
    "hacked_crate_orientation": "0 0 0",
    "hacked_crate_config_id": ""
}

Parameter Explanations

Core Identification

  • x, y, z: (Float) The world coordinates of the door. Do not modify manually; these are generated by the in-game admin tool.

  • building_x, building_y, building_z: (Float) The world coordinates of the building itself. Do not modify manually.

  • door_indices: (Array of Integers) A list of all door indexes on the building that this configuration will control. A single keycard can open multiple doors at once.

  • Location_Name: (String) A unique name used to identify this specific door in server logs and for cooldown management. This name must be unique across all of your door JSON files.

  • BuildingClassName: (String) The classname of the building. This is retrieved automatically by the admin tool.

  • keycard_class_name: (String) The classname of the item (key, keycard, or any other item) required to open this door.

  • unlockOnly: (0 or 1) If set to 1, using the keycard only unlocks the door but does not physically swing it open. The player must perform a second action to open it. Default is 0.

Announcements & Alarms

  • use_announcement: (0 or 1) If set to 1, sends a global message to all players on the server when the keycard is used. Automatically integrates with Expansion Notifications if that mod is loaded.

  • announcement_title: (String) The title of the global announcement (e.g., "ALERT").

  • announcement_text: (String) The body message of the announcement.

  • announcement_color_rgba: (String) If Expansion mod is used, this sets the color of the notification. The format is a string of four numbers: "Alpha,Red,Green,Blue".

  • use_alarm: (0 or 1) If set to 1, plays a looping alarm sound at the door's location for a set duration.

  • alarm_sound: (String) The name of the SoundSet from the game files that will be played as the alarm.

  • alarm_duration: (Integer) The total duration in seconds that the alarm will continue to sound for.

  • alarm_loop_delay: (Float) The time in seconds between each loop of the alarm sound. A smaller number means the sound repeats more frequently.

Timers

  • min_unlock_time / max_unlock_time: (Integers) Defines the random time range in seconds the system will wait after the card is swiped but before the door opens. A value is chosen randomly between the min and max.

  • min_restock_time / max_restock_time: (Integers) Defines the random time range in seconds the door will remain open before it automatically closes, locks, and despawns all associated loot.

Loot & Containers

  • containers_only: (0 or 1) A special mode. If set to 1, the loot containers for this door will spawn on server start and will never despawn. The door itself will be permanently locked and cannot be opened with a keycard. This is used to create persistent loot rooms that do not require a keycard.

  • min_containers_to_spawn / max_containers_to_spawn: (Integers) The minimum and maximum number of containers that will be chosen to spawn from the containers list. Set both to -1 to make all defined containers spawn every time.

See 3. Advanced Loot System for full details on the containers and doorSpecificLootPools arrays.

Safety & Restarts

  • persistCooldownOnRestart: (0 or 1) If set to 1, the door's open state and its remaining open time will be saved and will resume correctly after a server restart. It is highly recommended to keep this at 1.

  • use_safety_teleport: (0 or 1) If set to 1, the system will check for players inside the room just before the door closes and will teleport them outside to prevent them from getting trapped.

  • safety_teleport_radius: (Float) The radius in meters from the building's center to check for players during the safety teleport.

  • use_custom_teleport_points: (0 or 1) If set to 1, the safety teleport will move players to one of the specific locations defined in custom_teleport_points instead of a random nearby spot.

  • custom_teleport_points: (Array of Vectors) A list of specific X Y Z coordinates where players will be teleported. The coordinates must be formatted as a string: "X_pos Z_pos Y_pos". Note the DayZ coordinate order (X, Z, Y).

Mod Integration (Bastardos Hacked Crates)

  • spawn_hacked_crate: (0 or 1) If set to 1, the system will spawn a hackable crate from the "Bastardos Hacked Crates" mod when the keycard door opens.

  • hacked_crate_classname: (String) The className of the specific hackable crate you want to spawn.

  • hacked_crate_position: (Vector) The world coordinates ("X Y Z") where the hackable crate will spawn.

  • hacked_crate_orientation: (Vector) The orientation ("Pitch Yaw Roll") of the hackable crate.

  • hacked_crate_config_id: (String) The unique ConfigUniqueID from the Hacked Crates mod's configuration. This tells the spawned crate which loot table and settings to use.

Clone this wiki locally