rolle Posted June 24, 2014 Share Posted June 24, 2014 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 https://forums.kleientertainment.com/forums/topic/37797-copied-player_commonlua-crash/ Share on other sites More sharing options...
rolle Posted June 24, 2014 Author Share Posted June 24, 2014 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 characterLUA 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 https://forums.kleientertainment.com/forums/topic/37797-copied-player_commonlua-crash/#findComment-504263 Share on other sites More sharing options...
rolle Posted June 24, 2014 Author Share Posted June 24, 2014 Ops missed first line of log (edit posts??):...ommon/dont_starve/data/scripts/components/sanity.lua:192: attempt to index local 'm' (a nil value) Link to comment https://forums.kleientertainment.com/forums/topic/37797-copied-player_commonlua-crash/#findComment-504264 Share on other sites More sharing options...
Minik435 Posted June 24, 2014 Share Posted June 24, 2014 Can I have a look on line #192 at Sanity.lua?Editing from 5th post. Link to comment https://forums.kleientertainment.com/forums/topic/37797-copied-player_commonlua-crash/#findComment-504276 Share on other sites More sharing options...
debugman18 Posted June 25, 2014 Share Posted June 25, 2014 Can I have a look on line #192 at Sanity.lua?Editing from 5th post. He's trying to reference "m" which according to his error, does not exist. I think you're missing something like this:local m = inst.components.moisture Link to comment https://forums.kleientertainment.com/forums/topic/37797-copied-player_commonlua-crash/#findComment-504316 Share on other sites More sharing options...
DeathDisciple Posted June 25, 2014 Share Posted June 25, 2014 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 https://forums.kleientertainment.com/forums/topic/37797-copied-player_commonlua-crash/#findComment-504322 Share on other sites More sharing options...
rolle Posted June 25, 2014 Author Share Posted June 25, 2014 Thanks death, indeed this was the problem. I want to add a component to the player, but I guess there is a better way to do it. I will look at some samples. Link to comment https://forums.kleientertainment.com/forums/topic/37797-copied-player_commonlua-crash/#findComment-504373 Share on other sites More sharing options...
NikMik Posted June 25, 2014 Share Posted June 25, 2014 Time for a good ol' flow of postinit awesomeness? Link to comment https://forums.kleientertainment.com/forums/topic/37797-copied-player_commonlua-crash/#findComment-504380 Share on other sites More sharing options...
Recommended Posts
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