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
- 1The player holds a raid tool in their hands (it can't be ruined) and looks at a locked object.
- 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.
- 3The player gets the "Destroy Codelock" action (standing or crouching). One try takes the tool's
raidTimerInSeconds. - 4At the end of each try the tool always loses
damageToTool% of its health. If that brings it to 0, the tool is gone. - 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
| Setting | What it does |
|---|---|
raidingTools | The list of tools that can raid. Each tool has the 5 settings below. |
toolClassname | The tool's classname. The player holds it in their hands. |
tier | Which list this tool can raid: 1 for tier1ObjectsList, 2 for tier2ObjectsList, 3 for tier3ObjectsList. Only that one tier. |
raidTimerInSeconds | How many seconds one try takes. |
damageToTool | How much health the tool loses per try, in %. 100 breaks it after one try, 50 after two. |
raidChance | Chance one try breaks the lock, in % (0 to 100). 25 means about 1 try in 4 works. |
tier1ObjectsList | The objects (exact classnames) tier 1 tools can raid. |
tier2ObjectsList | The objects tier 2 tools can raid. |
tier3ObjectsList | The objects tier 3 tools can raid. |
successRaidMessage | Message when the raid works. |
failedRaidMessage | Message 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:
| Tool | Tier | One try | Tool damage | Chance |
|---|---|---|---|---|
| Pipe | 1 | 60 seconds | 100 % | 25 % |
| Screwdriver | 1 | 30 seconds | 50 % | 50 % |
| Hacksaw | 2 | 120 seconds | 100 % | 25 % |
| Lockpick | 2 | 60 seconds | 50 % | 50 % |
| SledgeHammer | 3 | 180 seconds | 100 % | 25 % |
| Crowbar | 3 | 90 seconds | 50 % | 50 % |
| Tier | Objects |
|---|---|
| 1 | Auto Gun Racks (HM_Auto_Gun_Rack_Black, _Green, _Tan) |
| 2 | Auto Storage and Auto Storage II, every colour (HM_Auto_Storage_..., HM_Auto_Storage_2_...) |
| 3 | HM_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:
{ "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.