Project Zomboid

Project Zomboid

30 ratings
Claim Occupied & Non-Residential Buildings as Admin
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
50.458 KB
21 Jan, 2022 @ 4:34am
1 Change Note ( view )

Subscribe to download
Claim Occupied & Non-Residential Buildings as Admin

Description
This mod is redundant as of game version ≥ 41.68

If you're an admin, you can claim buildings as a safehouse, regardless of them being currently occupied, marked as non-residential, or both.

Compatibility & Troubleshooting
  • This mod is not compatible with Claim Non-Residential Buildings, because it uses the same base code from Fenris_Wolf-tt. This mod is just an expanded version of aforementioned.
  • If your safehouse resets after server's restart, ensure that you shutting it down properly, with the /quit command.
  • If your safehouse resets after your character leaves it, make sure that your SafeHouseRemovalTime server option has a value less than 597. This value uses in-game hours, which is then converted to milliseconds, and the max value of a signed int in Java is 2147483647.
  • Tested with v41.65
How does it work?
Originally posted by Fenris_Wolf-tt:
When you bring up the lua popup menu in a building, the java engine returns a string reason why you can't claim it. It then disables that option in the menu, and sets that reason to the tooltip.
The code in the paste checks all the items in the menu, finds the safehouse claim option and checks what the tooltip is. If the reason is non-residential it re-enables the option.
When the claim is actually done on a building the java engine checks again if that building can be claimed. The bypassClaimChecks() function in the code snippit skips the part of java that performs that and just registers the x/y bounding box of the building which is what java does if the checks pass.
Workshop ID: 2726596901
Mod ID: claimSH
22 Comments
Kafkatrap 31 Mar, 2023 @ 4:51pm 
@Doppelgänger i believe living in non-residential buildings is a setting included in the vanilla sandbox options now?

However, i don't believe there is a mod that lets you set buildings you can spawn in as safehouses (or at least i haven't found one despite hours of searching) For those of us that use additional spawn point mods, that would be an immensely useful feature.

Perhaps that could be a feature in the next version of this mod, or a new mod? Just an idea.
Mcloutier87 4 Feb, 2023 @ 5:34pm 
just saying but this is an option in the config so no reason for a mod
inosk0pedjfk 4 Jan, 2023 @ 10:21pm 
does this work with the fire house or police stations?
SpetsnazSS 21 Aug, 2022 @ 5:51am 
Dont seem to work on the latest builds hope you sort it out soonish.
Doppelgänger  [author] 15 Jun, 2022 @ 6:55pm 
I believe 41.68 broke this mod. I will revisit it once NPCs or animals come out.
Burbank 15 Jun, 2022 @ 4:01pm 
Doesn't seem to work, still says occupied.
Talon 30 May, 2022 @ 8:04pm 
Not sure, but doesn't seem to work - trying to claim an elementary school, which is not a spawn (the message is "occupied", not spawn zone).
Bones 3 May, 2022 @ 2:32pm 
Hey, so I've been trying to work this mod for awhile, and cant seem to bypass the functionality of claiming over occupied. I'm still barred on that reason, and cant seem to figure out a bypass.
Tuesday 25 Apr, 2022 @ 12:45am 
Thank you very a lot
Doppelgänger  [author] 24 Apr, 2022 @ 9:34pm 
@Tuesday
/setaccesslevel userName admin
More at https://pzwiki.net/wiki/Dedicated_Server