Guide

Code Lock

Pick which code lock players use on Hunter Mods objects, and set which tools can raid it, how long it takes and how often it works.

Introduction

These Hunter Mods objects can be locked with a code lock:

Everything about those locks is set in one file. Restart the server after you change it:

ServerProfile\Hunter_Mods\Codelock\HM_Settings_Codelock.json

HM_Settings_Codelock.json119 lines
{
    "codelockMode": 0,
    "raidingTools": [
        {
            "toolClassname": "Pipe",
            "tier": 1,
            "raidTimerInSeconds": 60,
            "damageToTool": 100.0,
            "raidChance": 25.0
        },
        {
            "toolClassname": "Screwdriver",
            "tier": 1,
            "raidTimerInSeconds": 30,
            "damageToTool": 50.0,
            "raidChance": 50.0
        },
        {
            "toolClassname": "Hacksaw",
            "tier": 2,
            "raidTimerInSeconds": 120,
            "damageToTool": 100.0,
            "raidChance": 25.0
        },
        {
            "toolClassname": "Lockpick",
            "tier": 2,
            "raidTimerInSeconds": 60,
            "damageToTool": 50.0,
            "raidChance": 50.0
        },
        {
            "toolClassname": "SledgeHammer",
            "tier": 3,
            "raidTimerInSeconds": 180,
            "damageToTool": 100.0,
            "raidChance": 25.0
        },
        {
            "toolClassname": "Crowbar",
            "tier": 3,
            "raidTimerInSeconds": 90,
            "damageToTool": 50.0,
            "raidChance": 50.0
        }
    ],
    "raidHours": [
        {
            "Weekday": "Sunday",
            "StartHour": 0,
            "StartMinute": 0,
            "DurationMinutes": 1440
        },
        {
            "Weekday": "Monday",
            "StartHour": 0,
            "StartMinute": 0,
            "DurationMinutes": 1440
        },
        {
            "Weekday": "Tuesday",
            "StartHour": 0,
            "StartMinute": 0,
            "DurationMinutes": 1440
        },
        {
            "Weekday": "Wednesday",
            "StartHour": 0,
            "StartMinute": 0,
            "DurationMinutes": 1440
        },
        {
            "Weekday": "Thursday",
            "StartHour": 0,
            "StartMinute": 0,
            "DurationMinutes": 1440
        },
        {
            "Weekday": "Friday",
            "StartHour": 0,
            "StartMinute": 0,
            "DurationMinutes": 1440
        },
        {
            "Weekday": "Saturday",
            "StartHour": 0,
            "StartMinute": 0,
            "DurationMinutes": 1440
        }
    ],
    "tier1ObjectsList": [
        "HM_Auto_Gun_Rack_Black",
        "HM_Auto_Gun_Rack_Green",
        "HM_Auto_Gun_Rack_Tan"
    ],
    "tier2ObjectsList": [
        "HM_Auto_Storage_Rust",
        "HM_Auto_Storage_Camo1",
        "HM_Auto_Storage_Camo2",
        "HM_Auto_Storage_Black",
        "HM_Auto_Storage_Grey",
        "HM_Auto_Storage_Green",
        "HM_Auto_Storage_Carbon",
        "HM_Auto_Storage_2_Rust",
        "HM_Auto_Storage_2_Camo1",
        "HM_Auto_Storage_2_Camo2",
        "HM_Auto_Storage_2_Black",
        "HM_Auto_Storage_2_Grey",
        "HM_Auto_Storage_2_Green",
        "HM_Auto_Storage_2_Carbon"
    ],
    "tier3ObjectsList": [
        "HM_Auto_Loadout",
        "HM_Hatch",
        "HM_Bunker"
    ],
    "successRaidMessage": "Raid succeeded!",
    "failedRaidMessage": "Raid failed!"
}

codelockMode

Which code lock players can attach on these objects:

codelockModeCode lock
0Vanilla Digital Lock (also compatible with the LB Master Better Code Lock mod)
1Code Lock mod by Room Service
2Expansion Code Lock from Bundle or Base Building

How raiding works

Players can break a code lock with tools. Objects are split into 3 tiers and each tool raids one tier, so you decide which tools open which objects.

  1. 1The player holds a raid tool in their hands (it can't be ruined) and looks at an object with a code lock.
  2. 2The object has to be in the tier list that matches the tool's tier. A tier 2 tool only works on tier 2 objects, not tier 1 or tier 3.
  3. 3The player gets the "Destroy Codelock" action (standing or crouching). One try takes the tool's raidTimerInSeconds. Outside the raid hours the action stops right away.
  4. 4At the end of each try the tool always loses damageToTool % of its health. If that brings it to 0, the tool is gone.
  5. 5Then the chance is rolled (raidChance). If it works, the code lock is removed and the object is unlocked. If not, the player sees the fail message and can try again.

Every successful raid is written to the HM log with the player's Steam ID, the object and its position.

raidingTools

The list of tools that can raid. Each tool has these 5 settings:

SettingWhat it does
toolClassnameThe tool's classname. The player holds it in their hands.
tierWhich list this tool can raid: 1 for tier1ObjectsList, 2 for tier2ObjectsList, 3 for tier3ObjectsList. Only that one tier.
raidTimerInSecondsHow many seconds one try takes.
damageToToolHow much health the tool loses per try, in %. 100 breaks it after one try, 50 after two.
raidChanceChance one try breaks the lock, in % (0 to 100). 25 means about 1 try in 4 works.

The default tools:

ToolTierOne tryTool damageChance
Pipe160 seconds100 %25 %
Screwdriver130 seconds50 %50 %
Hacksaw2120 seconds100 %25 %
Lockpick260 seconds50 %50 %
SledgeHammer3180 seconds100 %25 %
Crowbar390 seconds50 %50 %

Let a tool raid more than one tier: add it once per tier. Here the Crowbar works on tier 2 and tier 3:

raidingTools2 lines
{ "toolClassname": "Crowbar", "tier": 2, "raidTimerInSeconds": 60, "damageToTool": 25.0, "raidChance": 75.0 },
{ "toolClassname": "Crowbar", "tier": 3, "raidTimerInSeconds": 90, "damageToTool": 50.0, "raidChance": 50.0 }

When players can break code locks with tools, on the server's clock. Missing or empty means always.

SettingDefaultWhat it does
Weekday"Sunday"The day the raid time starts: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday or Saturday.
StartHour0The hour it starts, 0 to 23.
StartMinute0The minute it starts, 0 to 59.
DurationMinutes1440How long raiding stays allowed, in minutes. 1440 is a whole day. It can go past midnight.

tier1ObjectsList, tier2ObjectsList, tier3ObjectsList

The objects each tier of tools can raid. The defaults:

ListObjects
tier1ObjectsListAuto Gun Racks (HM_Auto_Gun_Rack_Black, _Green, _Tan)
tier2ObjectsListAuto Storage and Auto Storage II, every color (HM_Auto_Storage_..., HM_Auto_Storage_2_...)
tier3ObjectsListHM_Auto_Loadout, HM_Hatch (Bunker Tunnels), HM_Bunker (Bunker Hideout)
  • Make an object harder to raid: move its classname to a higher tier list.
  • Make an object impossible to raid: take its classname out of all three lists.
  • Use exact classnames. A new color of an object isn't covered until you add its classname too.

successRaidMessage, failedRaidMessage

The messages the player sees when a raid works, and when it doesn't. Write whatever you want.