Cargo locks don't friggin work

So my main transport vehicle is basically the angriest hatchback ever conceived. I got really tired of having some random lah-dee-dah just waltz up and take stuff out of my car and getting a -100 morale penalty for taking it back, so I put some cargo locks on the hatch. Both of them.

Well I just had some random lah-dee-dah just waltz behind the car and open the hatch right in front of me. Even made a point to deliberately ignore the unlocked cargo racks directly attached to them to open the hatch and take the parts I was just about to install. Now I have a -100 morale penalty for taking it back.

My mobile fortress I keep all my other stuff in has a single door on it. It’s a hatch with a cargo lock. I spent upwards of three months building the vehicle. (Do you have any idea how much food that requires?) If I can’t even lock THAT, then at some point I’m just going to start going Postal on sight.

Is there something I’m not doing here? Cause I’ve tried absolutely everything I can think of, barring installing a freakin wall around the trunk every time I park, which would take at least 5 hours.

Tested this, forgot to update first, so this is as of 10 days ago (8050).

Spawned a vehicle, removed cargo containers and installed hatches because you specifically referenced hatches.

Installed cargo locks on half of the hatches (left side) and not on the others. Opened hatches for easy access.

Dropped identical items in every hatch. Spawned NPCs.

After ten NPCs, 8 stole items from the unlocked hatches and 1 ran away and 1 tried to rob and beat me. No one stole from the locked hatches.

Repeated test, placing locks on ALL hatches. 10 out of 10 spawned NPCs left, not bothering to try and steal anything.

EDIT: Nothing I can see has changed in recent updates with cargo locks or AI behavior regarding them, so I’m not sure why you’re having a problem. It works for me.

I had one of the doors open. Maybe that’s why? Maybe if a door is open, it counts the whole vehicle as open? Or it might be because there are unlocked cargo racks attached to them?

Cause I saw the guy walk behind the car and open it. I waited there standing in the doorway after he asked me for an inhaler and watched to see if the locks would work. He opened it and walked off with 2 reinforced headlights, a steel plate, and some other miscellaneous items from the passenger seat. I just updated the game a few days ago, too.

I even checked to make sure the locks weren’t broken. Whole car was pristine.

I think I see the problem here.

Cargo Locks, from what I understand, only lock that one specific Cargo Container they are added to. That means that those Hatches and everything stored in them are protected. They do not protect doors/hatches from opening, nor do they protect other Cargo Containers inside your Vehicle from being robbed.
In order to protect your whole vehicle, you most likely have to add a cargo lock to every single Cargo Container.

Does that happen to solve the issue? :slight_smile:

The cargo racks were empty. Everything was in the hatches that were locked. Or at least, most of what was taken was.

So what I’m hearing is if I have a cargo container inside the vehicle that isn’t locked (because generally you lock DOORS in real life), they can open the locked hatch to get to it and thus take everything in the hatch anyway.

If I’m understanding you correctly, the answer is no. Cargo locks function independently from one another. A locked hatch should protect items in the hatch. Nothing outside of that square should affect whether or not THAT hatch is secure.

I’m a bit perplexed by this. I know that Cargo locks don’t work if the hatch was installed AFTER the cargo lock (though I’m not sure that’s even possible anymore). Maybe that’s the issue?

I’d try removing and reinstalling them to see if that fixes anything.

The problem, of course, is that the AI is supposed to do a check to see if the tile is locked before taking an object from that tile. So the issue most likely lies in the fact that the tile is not being read as locked. Because I don’t know much about the code, the best I can figure is that installing the parts again would offer a chance for the tile to properly be flagged as locked.

Well, I did directly repair one of them with another set instead of uninstalling it and installing the new one. Maybe that’s the snag.

I certainly hope so, because I’d really rather not have to track down 20 alarm clocks to be able to lock every container in the other vehicle.

Well . . . You need a cargo lock for every tile that you want to be locked. So, you’ll probably still need a lot of clockworks. Literally the only thing I’ve ever used clockworks for.

So, I quickly downloaded 8075, made a new world and started testing.

The Base setup, no additional mods and so on. When everything was loaded, I gave myself debug-traits and spawned in 3 Beetles, which I then proceeded to modify:

  • I removed all cargo containers from the beetles. This included Doors, Seats and trunks.
  • I then added 4 hatches to every beetle.
    -1 Beetle had a cargo lock on every single hatch. 1 Beetle had Cargo locks on exactly half of its hatches, with 2 hatches (1 being locked, the other ‘unlocked’) being next to each other so they open and close together. 1 Beetle had no locks whatsoever.
  • I filled every hatch with 4 Items: 1 Inhaler, 1 Lighter, 1 MRE, 1 Sheet Metal. I chose relatively random and diverse items, just to make sure that the npcs would take >something<.

After everything was set up, i started spawning in npcs. When someone stole something, I refilled the hatch and spawned in another. I did that for 10 rounds. This is the result:

The Hatches with the green boxes around them had cargo locks, the others did not. As you can also see, I had a varying degree of ‘open hatches’ on the beetles, some of them were actually opened by the npcs during the tests too.
Every single hatch with cargo locks were not looted during testing. All npcs, if they took something, only did so in unlocked hatches. There was no difference between a fully closed car, a fully opened car or a partially opened car from what I was able to tell.

That means that the Cargo locks work as promised in 8075. That being said, considering that Unicorn tried it in 8050 and it worked as well, AND there weren’t any changes to cargo locks in recent versions…well, the issue is with you, for some reason.

Just to be clear, again: You had cargo locks on ALL your hatches, and npcs stole from the LOCKED hatches, yes?
Did you happen to install the cargo locks, then uninstalled the hatches and reinstalled them? You ARE able to uninstall the Cargo containers and the Cargo locks will remain on that part, so that could possibly caused something. This can easily happen if you installed the Cargo locks while you had, for example, regular hatches, and then removed them in order to install heavy duty hatches for example. Just another Idea.

P.S.: Maybe your mobile base simply doesn’t want to work for a ⑨ :stuck_out_tongue: Touhou jokes ftw.

…So they’re able to OPEN the hatches, but not TAKE anything from them? That’s…not how locks work. I guess I’ll have to install a security system or chimes on the tank or something. I really, REALLY don’t want people getting in there.

In any case, it has happened twice since. One of them held me up and opened the hatch to get to me, instead of using the passenger door. She also somehow didn’t care when that the car was doing a buck twenty. Normally that kills people, but she just stayed there on the car, even after she turned hostile. She couldn’t hurt me because I’m kitted out like freakin Lancelot and she didn’t even have a weapon to hold me up with, but she did attack me.

Then I saw someone on the way back and deliberately parked in front of him to see what he would do. He deliberately went and opened the hatch, even though the door was closer to him and the unlocked cargo racks on the back of the car were completely full. I closed it on him and he kept re-opening it, too. He didn’t give a single shit about all the things right next to him, he had to open that hatch.

Note that they’re not cargo containers, they’re racks. Containers require a frame, racks don’t. The racks have never been locked, I don’t even know if they can be locked, I haven’t tried. Locks aren’t easy to get, so I’m picky about where I put them. I have replaced the passenger seat with a cargo container, which is not locked.

And this was after I reinstalled both hatch locks. I guess I haven’t reinstalled the hatches, no, but the fact that they’re deliberately ignoring unlocked containers and doors to open locked ones is extremely confusing. I’ll put a lock on the container inside the car and see what happens.

They are heavy duty hatches, though, so technically I have already reinstalled them once.

I can toss you the save file if you want.

UPDATE: I cannot install a cargo lock on the cargo space inside the car, nor the racks outside of it. I CAN install them on floor trunks, and normal trunks.

It’s in the name. They are called CARGO locks for a reason, not ‘Locks’ or ‘Door Locks’. They protect the places where you store stuff, but they do not in any way, shape or form protect your doors from being opened. Oh, and yes: Only some cargo containers are actually lockable. They have a specific tag to allow the installation of the cargo locks. I have no clue how they decided what’s lockable and what isn’t though.

It is odd that the npcs prefer opening that hatch though. Maybe something odd in the npc code, with a hatch ahving a higher priority due to the fact that there might be ‘more loot’ behind it or something or another.

I could give you one thing to…well, protect the insides of your car. A small makeshift mod i quickly made up just now.
Basically, I added a makeshift ‘door lock’ vehicle part which is installed and removed in 6 seconds ; like the cargo locks it only requires the lock set, no additional tools or anything else. Once installed, it acts like a (very weak) obstacle, means, neither you, npcs or monsters can actually move through it. You can, technically, still open the doors where it is installed - but you still wouldn’t be able to get through that tile without removing or destroying the lock.
Another issue is that you can (currently) install is everywhere, on aisles, seats, cargo containers, boards, you get the idea. Couldn’t change that because there doesn’t seem to be an available specification that targets only doors.
All in all, it is extremely makeshift, and I wager it can be very annoying to install and uninstall those locks every time to get through, but that’s the best i can do for you at the moment. On the plus side, I’m assuming that npcs wouldn’t be able to accidentally ‘open’ the door where the lock is installed, because it should count as an obstacle, so they wouldt try to find a way around it. That means they cant just open the door, see you sleeping 2 tiles away and shoot you in your sleep.!jioyWCBL!nF9JuNbhsq-tUq2INt2YMsh1GEXsTsTxIHqD9kLKYWc

Sorry, this is all I can do for you. Hope it helps you.

Well that’s really nice of you, thank you. I’ll give it a try.

Still seems like a strange oversight. I still have no idea why they didn’t take anything at all from the racks outside the car. There were guns and ammo and parts and food and everything in them.

In any case, I at least don’t think I’ll have to worry about being shot in my sleep. I’m covered head to toe in Kevlar and steel. They shouldn’t hurt me much, unless they’re packing an M82.

I learned that last part from the Antimateriel Turret over by the prison.

Again, thank you.