Jump to content

The old Krampusnacht mod - help fix it?


Recommended Posts

So, the old Krampusnacht mod by @Bryce seems to not be working. Basically, the only acceptable outcome is that you die and die permanently. If the night ends and you're alive, or you die and respawn on a Meat Effigy/Touch Stone, the game crashes. Logs are uploaded below. 

 

"Log Died Valiantly" - Only case of the game not crashing as the game concludes before the night cycle does.

"Log Kramp I win" - The Krampusnacht are defeated. Game crashes as soon as the night cycle ends (and not immediately after killing the Krampusnacht). 

"Log Kramp Meat Effigy" - Character dies but, in this scenario, is respawned by a Meat Effigy/Touch Stone (tested both) to earlier in the day. Game crashes immediately afterwards character stands up from respawning.

 

I'm using no mods and have had the same experience in two different worlds/characters. 

 

The common return error is:

...mmon/dont_starve/data/scripts/standardcomponents.lua:369: attempt to compare number with nil

So, being the nub I am, I tried to find this line that it's referring to and had very little luck.

 

Can someone offer some help? 

Log Died Valiantly.txt

Log Kramp I win.txt

Log Kramp Meat Effigy.txt

Link to comment
Share on other sites

Analysis. Your logs contain "stale component" references prior to the crash. Each of those references is on a line containing "inst.Physics". The crash itself is casued by a "nil" returned from "inst.Physics:GetMass()". Conclusion. "inst.Physics" is no longer available at the time when krampus tries to do the "exit" state. The code along the execution of this state make no checks whether the "inst.Physics" is still available. This is not a problem by itself as it still works for the normal krampus.

 

In krampus nacht, the request to change state comes from krampusnachter.lua, line 185:

if v and not v.components.kidnapper.shouldkidnap then    v:DoTaskInTime(math.random() * 2, function() v.sg:GoToState("exit") end)

This state change is executed at the end of  Krampusnacht, for each krampus that is NOT trying to abduct you, even the dead ones. The condition above should exclude those. Try changing it to:

if v and not v.components.kidnapper.shouldkidnap and v.components.health and not v.components.health:IsDead() then

It it still crashes after this, you can try removing the "v:DoTaskInTime".

Link to comment
Share on other sites

Analysis. Your logs contain "stale component" references prior to the crash. Each of those references is on a line containing "inst.Physics". The crash itself is casued by a "nil" returned from "inst.Physics:GetMass()". Conclusion. "inst.Physics" is no longer available at the time when krampus tries to do the "exit" state. The code along the execution of this state make no checks whether the "inst.Physics" is still available. This is not a problem by itself as it still works for the normal krampus.

 

In krampus nacht, the request to change state comes from krampusnachter.lua, line 185:

if v and not v.components.kidnapper.shouldkidnap then    v:DoTaskInTime(math.random() * 2, function() v.sg:GoToState("exit") end)

This state change is executed at the end of  Krampusnacht, for each krampus that is NOT trying to abduct you, even the dead ones. The condition above should exclude those. Try changing it to:

if v and not v.components.kidnapper.shouldkidnap and v.components.health and not v.components.health:IsDead() then

It it still crashes after this, you can try removing the "v:DoTaskInTime".

 

Testing. Thank you so much for the help - I'd have taken a few months to learn enough to figure this out. 

 

Tested and it works. Thanks a lot, @maxik. I'll reupload the bug-fixed version so people can enjoy it again (credited to you, if you don't mind). 

Link to comment
Share on other sites

Glad it works.

 

I dont mind to be mentioned as helping to fix it, but @Bryce is the original author.

Of course. I just need to investigate another bug that I noticed someone else post about in the original thread regarding Caves. 

 

Okidoki, Caves works perfectly - though I'm not sure how Krampusnacht initiating whilst the player is in Caves would affect the game. Guess someone else can report the issue if it is one.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...