Guide

Codelock Raid

Which tools can break the code locks on Hunter Mods objects (gun racks, auto storage, auto loadout, hatches, bunkers), how long it takes and how often it works.

The idea

Hunter Mods objects like the Auto Gun Rack, Auto Storage, Auto Loadout, the tunnel hatch and the bunker can be locked with a code lock. This guide is about breaking those locks with tools. Everything is set in one file:

ServerProfile\Hunter_Mods\Codelock\HM_Settings_Codelock.json

Objects are split into 3 tiers. Each tool can raid one tier, so you decide which tools open which objects.

How a raid works

  1. 1The player holds a raid tool in their hands (it can't be ruined) and looks at a locked object.
  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.
  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.

It works on the vanilla code lock, the Expansion code lock and the CodeLock mod, whichever your server uses.

The settings

SettingWhat it does
raidingToolsThe list of tools that can raid. Each tool has the 5 settings below.
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.
tier1ObjectsListThe objects (exact classnames) tier 1 tools can raid.
tier2ObjectsListThe objects tier 2 tools can raid.
tier3ObjectsListThe objects tier 3 tools can raid.
successRaidMessageMessage when the raid works.
failedRaidMessageMessage when the raid fails.

The default setup

Out of the box, each tier has a slow tool that breaks after one try and a faster one that lasts two tries and works more often:

ToolTierOne tryTool damageChance
Pipe160 seconds100 %25 %
Screwdriver130 seconds50 %50 %
Hacksaw2120 seconds100 %25 %
Lockpick260 seconds50 %50 %
SledgeHammer3180 seconds100 %25 %
Crowbar390 seconds50 %50 %
TierObjects
1Auto Gun Racks (HM_Auto_Gun_Rack_Black, _Green, _Tan)
2Auto Storage and Auto Storage II, every colour (HM_Auto_Storage_..., HM_Auto_Storage_2_...)
3HM_Auto_Loadout, HM_Hatch (Bunker Tunnels), HM_Bunker (Bunker Hideout)

Examples

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 }

Make an object harder to raid: move its classname to a higher tier list. For example, move the Auto Storage classnames from tier2ObjectsList to tier3ObjectsList so only tier 3 tools open them.

Make an object impossible to raid: take its classname out of all three lists.

The object lists use exact classnames. A new colour or a child class of an object isn't covered until you add its classname too.