Don't Starve Together

Don't Starve Together

Personal Chesters
Feature request
Regarding making personal chesters private, i.e. can be opened only by owner, following seems to work (relies on Ownership mod to enforce that):
--- modinfo.lua +++ modinfo.patch.lua @@ -28,4 +28,15 @@ server_filter_tags = { "personalchesters", } ---configuration_options = {} \ No newline at end of file +configuration_options = { + { + name = "ownership", + label = "Ownership Restriction?", + options = + { + {description = "Enable", data = true}, + {description = "Disable", data = false} + }, + default = false, + }, +} --- modmain.lua +++ modmain.patch.lua @@ -11,6 +11,8 @@ local STRINGS = GLOBAL.STRINGS STRINGS.NAMES.PERSONAL_CHESTER = "Personal Chester" STRINGS.NAMES.PERSONAL_CHESTER_EYEBONE = "Personal Eye Bone" +local ownership = GetModConfigData("ownership") + -- An eyebone is given every time player is spawned/loaded. It's not saved local function GiveEyebone(inst) local eyebone = GLOBAL.SpawnPrefab("personal_chester_eyebone") @@ -21,6 +23,7 @@ local function GiveEyebone(inst) inst.components.inventory:GiveItem(eyebone) inst.components.inventory.ignoresound = false eyebone.components.named:SetName(inst.name.."'s Eye Bone") + eyebone.ownership = ownership return eyebone end end @@ -151,6 +154,7 @@ local function PersonalChester(inst) end inst.eyebone.owner = inst + inst.eyebone.ownership = ownership if OnLoad_prev then --- scripts/prefabs/personal_chester_eyebone.lua +++ scripts/prefabs/personal_chester_eyebone.patch.lua @@ -7,6 +7,7 @@ local assets = } local SPAWN_DIST = 30 +local ownershiptag = 'uid_private' local function OpenEye(inst) inst.isOpenEye = true @@ -110,6 +111,10 @@ local function RebindChester(inst, chester) if chester ~= nil then if inst.owner then chester.components.named:SetName(inst.owner.name.."'s Chester") + if inst.ownership then + chester:AddTag(ownershiptag) + chester:AddTag("uid_" .. inst.owner.userid) + end end inst.AnimState:PlayAnimation("idle_loop", true) OpenEye(inst)

This solves only opening the chester (and looting him), it's still possible to grief by attacking him or taking the eyebone from the ground.
< >
Se afișează 1-4 din 4 comentarii
Dragon Wolf Leo  [dezvoltator] 13 dec. 2015 la 2:44 
Added. Thanks.
Hey you think you can add an option for Hutch too? He's the Fish Chester found in caves.
Serp 14 aug. 2016 la 7:04 
Befriend spiders from webber will attack all personal chesters, including the one from webber.
Same if you wear the spiderhat.
I don't think this is intended?
are you able to make a craft option, instead of it spawning in the world with you
< >
Se afișează 1-4 din 4 comentarii
Per pagină: 1530 50