Only the deerclopsspawner component checks for the setting (to allow and queue the spawns in the first place), but Deerclops will still want to leave outside of winter, meaning wandering far to try to go into entity sleep range, and despawning on sleep.
Could probably simply check for TUNING.DEERCLOPS_ATTACKS_OFF_SEASON in the following bits:
local function WantsToLeave(inst) return --not TheWorld.state.iswinter or not (TUNING.DEERCLOPS_ATTACKS_OFF_SEASON or TheWorld.state.iswinter) or ( not inst.components.combat:HasTarget() and inst:IsSated() and inst:GetTimeAlive() >= 120 ) end
-- or simply not registering this listener if that variable is true, but it'd probably be better to check here local function OnStopWinter(inst) --if inst:IsAsleep() then if not TUNING.DEERCLOPS_ATTACKS_OFF_SEASON and inst:IsAsleep() then if not inst.ignorebase then TheWorld:PushEvent("storehassler", inst) end inst:Remove() end end
Or set a variable on spawning in on the Deerclops inst, if the setting is enabled. This would need to be set in LoadPostPass on the deerclopsspawner component as well (or saved on Deerclops, though saving it wouldn't be ideal due to being able to change the setting before launching the server again).
Another weird thing I noticed is that the delay to spawn in is determined by winter length:
function self:OnPostInit() -- Shorten the time used for winter to account for the time deerclops spends stomping around -- Then add one to _attacksperseason to shift the attacks so the last attack isn't right when the season changes to spring _attackdelay = (TheWorld.state.winterlength - 1) * TUNING.TOTAL_DAY_TIME / (_attacksperseason + 1) _worldsettingstimer:AddTimer(DEERCLOPS_TIMERNAME, _attackdelay, TUNING.SPAWN_DEERCLOPS, OnDeerclopsTimerDone)
Which is normally fine, but it becomes weird with this setting, as season length differs between seasons and can be modified.
This could maybe be updated when switching seasons if the setting is enabled (as well as checking for the current season in the post init, but only if the setting is enabled), to match the length of the current season.
Lastly, I also just noticed that there's a recipe validation check for when destroying structures to be sated, but this isn't validated when finding structures on spawning in, through the other prefab functions, or the brain. It's only specifically validated on destroying something.
While this can easily be by design, it might still be worth taking a look. Addressing this would prevent Deerclops from targeting Bee Hives and similar from far away (but you might want to keep that), as they can't be crafted, but will still target Spider dens.
- Set Deerclops to Tons in world settings.
- Have Deerclops spawn naturally outside of winter. Due to NO_BOSS_TIME, you'll have to skip/wait until that time passes.
- Notice how Deerclops will try to leave immediately if not targeting something (including player structures).
-
1
-
1
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now