Jump to content

copied player_common.lua: crash


Recommended Posts

Hi,

I want to change some things in prefabs/player_common.lua. So first I just copied the file from data/scripts/prefabs. However this makes the game crash hard after loading animations. I haven't touched anything. Anyone knows why?

Link to comment
Share on other sites

From the log:

 

LUA ERROR stack traceback:
        F:/Steam/steamapps/common/dont_starve/data/scripts/components/sanity.lua(192,1) in function 'GetMoistureDelta'
        F:/Steam/steamapps/common/dont_starve/data/scripts/components/sanity.lua(209,1) in function 'Recalc'
        F:/Steam/steamapps/common/dont_starve/data/scripts/components/sanity.lua(21,1) in function '_ctor'
        F:/Steam/steamapps/common/dont_starve/data/scripts/class.lua(98,1) in function 'cmp'
        F:/Steam/steamapps/common/dont_starve/data/scripts/entityscript.lua(285,1) in function 'AddComponent'
        F:/Steam/steamapps/common/dont_starve/data/../mods/Dont Dont Sleep/scripts/prefabs/player_common.lua(180,1) in function 'fn'
        F:/Steam/steamapps/common/dont_starve/data/scripts/mainfunctions.lua(126,1)
        =[C] in function 'SpawnPrefab'
        F:/Steam/steamapps/common/dont_starve/data/scripts/mainfunctions.lua(160,1) in function 'SpawnPrefab'
        F:/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(467,1) in function 'PopulateWorld'
        F:/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(837,1) in function 'DoInitGame'
...
        =[C] in function 'SetPersistentString'
        F:/Steam/steamapps/common/dont_starve/data/scripts/saveindex.lua(85,1) in function 'Save'
        F:/Steam/steamapps/common/dont_starve/data/scripts/saveindex.lua(737,1)
        =[C] in function 'SetPersistentString'
        F:/Steam/steamapps/common/dont_starve/data/scripts/saveindex.lua(740,1) in function 'OnGenerateNewWorld'
        F:/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(1041,1) in function 'cb'
        F:/Steam/steamapps/common/dont_starve/data/scripts/screens/worldgenscreen.lua(168,1) in function 'cb'
        F:/Steam/steamapps/common/dont_starve/data/scripts/frontend.lua(409,1) in function 'DoFadingUpdate'
        F:/Steam/steamapps/common/dont_starve/data/scripts/frontend.lua(461,1) in function 'Update'
        F:/Steam/steamapps/common/dont_starve/data/scripts/update.lua(46,1)
scripts/frontend.lua(723,1) SCRIPT ERROR! Showing error screen
...amapps/common/dont_starve/data/scripts/gamelogic.lua:468: could not spawn player character
LUA ERROR stack traceback:
        =[C] in function 'assert'
        F:/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(468,1) in function 'PopulateWorld'
        F:/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(837,1) in function 'DoInitGame'
        F:/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(1032,1) in function 'cb'
        F:/Steam/steamapps/common/dont_starve/data/scripts/saveindex.lua(709,1)
        =[C] in function 'SetPersistentString'
        F:/Steam/steamapps/common/dont_starve/data/scripts/saveindex.lua(85,1) in function 'Save'
        F:/Steam/steamapps/common/dont_starve/data/scripts/saveindex.lua(737,1)
        =[C] in function 'SetPersistentString'
        F:/Steam/steamapps/common/dont_starve/data/scripts/saveindex.lua(740,1) in function 'OnGenerateNewWorld'
        F:/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(1041,1) in function 'cb'
        F:/Steam/steamapps/common/dont_starve/data/scripts/screens/worldgenscreen.lua(168,1) in function 'cb'
        F:/Steam/steamapps/common/dont_starve/data/scripts/frontend.lua(409,1) in function 'DoFadingUpdate'
        F:/Steam/steamapps/common/dont_starve/data/scripts/frontend.lua(461,1) in function 'Update'
        F:/Steam/steamapps/common/dont_starve/data/scripts/update.lua(46,1)
Link to comment
Share on other sites

My guess is, you're using brute force override of game files, but you're using a base game file with a ROG setup/save. So basically m is null because your file does not know of moisture component, and ROG sanity component expects your player prefab to have moisture component.

 

The solution you're likely looking for is to use data/DLC0001/prefabs/player_common.lua instead of data/prefabs/player_common.lua

 

However that is a horrible idea, as this case has already proven that doing such things is breaking compatibility of your code with DLCs, not to mention other mods. You should really use mod api to perform whatever changes you want, if at all possible.

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...