Don't Starve Together

Don't Starve Together

[Moon-follower]---Rhine
Connection lost
My friend choose this char and got to the moon island after that the server crashes everytime he joins. Here is log:

[00:01:34]: Client authenticated: (KU_-SfmZB4O) магистр преломления
[00:01:35]: [Steam] SendUserConnectAndAuthenticate for '76561198261300880'
[00:01:35]: [Steam] Authenticated client '76561198261300880'
[00:01:36]: There is no active event to validate against.
[00:01:36]: [Shard] Read save location file for (KU_-SfmZB4O)
[00:02:37]: Resuming user: session/2EF02F235623F56B/A7NPP9O8PC8O/0000000166
[00:02:37]: Spawning player at: [Load] (448.88, 0.00, -598.89)
[00:02:49]: [string "-- 原码师的遗产 致敬传奇萌新接..."]:217: attempt to call global 'HasFriendlyLeader' (a nil value)
LUA ERROR stack traceback:
-- 原码师的遗产 致敬传奇萌新接单王

-- 首先需要确保你的模组的modmain.lua文件中有以下代码
-- Make sure you have the following code in your modmain.lua file of your mod
local function OnEatSweetTea(inst, eater)
if eater and eater:HasTag("rhine") then
-- 检查是否是Rhine在吃sweettea
-- Check if it's Rhine who is eating sweettea
if eater.components.sanity then
-- 如果Rhine有sanity组件,恢复额外的15san
-- If Rhine has a sanity component, restore an extra 15 sanity
eater.components.sanity:DoDelta(15)
end
end
end

-- 使用AddPrefabPostInit来hook sweettea的onfinished事件
-- Use AddPrefabPostInit to hook the onfinished event of sweettea
AddPrefabPostInit("sweettea", function(inst)
if inst.components.edible then
inst.components.edible:SetOnEatenFn(OnEatSweetTea)
end
end)

--[[
AddComponentPostInit("sanityaura", function(SanityAura)
local oldGetAura = SanityAura.GetAura
function SanityAura:GetAura(observer)
local val = oldGetAura(self, observer)
if val < 0 and observer:HasTag("rhine") then
return val/2
else
return val
end
end
end)
]]

local function ModifyShadowCreatureBrain(inst)
if inst and inst.brain then
local brain = inst.brain
local oldOnStart = brain.OnStart
brain.OnStart = function(self)
oldOnStart(self)

-- 检查玩家是否为Rhine
local player = self.inst.spawnedforplayer
if player ~= nil and player.prefab == "rhine" then
-- 修改影怪的跟随行为参数,将索敌距离增加1.5倍
local oldFollowNode = self.bt.root:FindNodeByName("Follow")
if oldFollowNode then
local followAction = oldFollowNode.action
if followAction and followAction.minfollow then
followAction.minfollow = followAction.minfollow * 1.5
followAction.medfollow = followAction.medfollow * 1.5
followAction.maxfollow = followAction.maxfollow * 1.5
end
end

-- 修改影怪的攻击行为,优先攻击名为"rhine"的玩家
local oldAttackNode = self.bt.root:FindNodeByName("Attack")
if oldAttackNode then
local attackNodeChildren = oldAttackNode.children
if attackNodeChildren then
for _, childNode in ipairs(attackNodeChildren) do
if childNode.name == "ChaseAndAttack" then
local oldChaseAndAttackAction = childNode.action
if oldChaseAndAttackAction then
oldChaseAndAttackAction.shouldattackfn = function(self)
return self.inst.components.shadowsubmissive:ShouldSubmitToTarget(self.inst.components.combat.target)
or (self.inst.components.combat.target and self.inst.components.combat.target:HasTag("rhine"))
end
end
end
end
end
end
end
end
end
end

AddBrainPostInit("shadowcreaturebrain", ModifyShadowCreatureBrain)



AddPrefabPostInit("staff_lunarplant", function(inst)
-- 在这里添加组件
inst:AddComponent("planardamage")

-- 设置基础伤害
inst.components.planardamage:SetBaseDamage(TUNING.STAFF_LUNARPLANT_PLANAR_DAMAGE)
inst:DoPeriodicTask(0.2, function()
local owner = inst.components.inventoryitem ~= nil and inst.components.inventoryitem.owner or nil
if owner ~= nil then
if o
[00:02:49]: [string "-- 原码师的遗产 致敬传奇萌新接..."]:217: attempt to call global 'HasFriendlyLeader' (a nil value)
LUA ERROR stack traceback:
-- 原码师的遗产 致敬传奇萌新接单王
scripts/simutil.lua:37 in () ? (Lua) <31-42>
=(tail call):-1 in () (tail) <-1--1>
scripts/components/combat.lua:236 in () ? (Lua) <229-252>
=(tail call):-1 in () (tail) <-1--1>
scripts/components/combat.lua:226 in (field) fn (Lua) <225-227>
scripts/scheduler.lua:186 in (method) OnTick (Lua) <164-216>
scripts/scheduler.lua:409 in (global) RunScheduler (Lua) <407-415>
scripts/update.lua:240 in () ? (Lua) <224-298>
< >
Showing 1-3 of 3 comments
铃铛蔷薇  [developer] 21 Aug, 2024 @ 5:43am 
Okay, someone has reported this problem before, but it didn't send a log, we will fix the error as soon as possible, thank you for the log!
铃铛蔷薇  [developer] 21 Aug, 2024 @ 8:39am 
We've fixed the problem!
The error results show that it is the non-Rhine character who attracts the hatred of the spider_moon and triggers the crash caused by an invalid function.
If there are more crashes, please send a log, and we will fix it as soon as possible! Thank you——!(*^▽^*)
Thanks
< >
Showing 1-3 of 3 comments
Per page: 1530 50