Jump to content

Game Crash During Map Generation


Toko

Recommended Posts

This is my first attempt at modding ANYTHING so I'm pretty much lost looking at the LUA codings and error log. Thanks to this tutorial I've made fair progress in an hour.

 

The game loads, my custom character mod is enabled, his graphics and description all appear perfectly on the character select screen. Click start and the map generation animation starts up. About halfway through it just crashes. No popup errors or anything, just BLIP, no more game window.

 

I've checked the log file and have gotten these script errors:

LUA ERROR stack traceback:        =[C] in function 'assert'        C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(467,1) in function 'PopulateWorld'        C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(832,1) in function 'DoInitGame'        C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(1022,1) in function 'cb'        C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/saveindex.lua(709,1)        =[C] in function 'SetPersistentString'        C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/saveindex.lua(85,1) in function 'Save'        C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/saveindex.lua(737,1)        =[C] in function 'SetPersistentString'        C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/saveindex.lua(740,1) in function 'OnGenerateNewWorld'        C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(1031,1) in function 'cb'        C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/screens/worldgenscreen.lua(168,1) in function 'cb'        C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/frontend.lua(409,1) in function 'DoFadingUpdate'        C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/frontend.lua(461,1) in function 'Update'        C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/update.lua(46,1)scripts/frontend.lua(723,1) SCRIPT ERROR! Showing error screen	

Referencing the first few gamelogic.LUA errors, it looks like the game is trying to load and insert Wilson into the world

gamelogic.lua(467,1): assert(wilson, "could not spawn player character")gamelogic.lua(832,1):  local wilson = PopulateWorld(savedata, profile, playercharacter, next_world_playerdata)

Again this is my first attempt at anything like this, so I'm surprised I made it this far without any huge problems. If anyone can help me out that would be amazing. Thank you!

Link to comment
Share on other sites

whoops I linked the tutorial thread instead of Dana's tutorial

 

@Blueberrys

scripts/mainfunctions.lua(122,1) Can't find prefab cha	...amapps/common/dont_starve/data/scripts/gamelogic.lua:467: could not spawn player character
Link to comment
Share on other sites

All of the files are where they should be according to the tutorial, so having another line of coding telling me it can't find my prefab.LUA isn't helping. I don't know the coding so I don't know what I'm supposed to move or change in order to allow the game to find the file, when it's apparently exactly where it's supposed to be :S

Link to comment
Share on other sites

@Toko,

 

It looks like you were referencing the base game version of gamelogic.lua rather than the DLC version there... line 467 of RoG's gamelogic.lua is

        wilson = SpawnPrefab(playercharacter)

playercharacter is should be a string with the prefab name of your character.  Your log seems to imply that the prefab name being passed is "cha", which I imagine isn't what it's supposed to be.

 

 

edit: if it is supposed to be cha, then you need to have the file "cha.lua" in the "scripts/prefabs" directory of your mod.

Link to comment
Share on other sites

@Toko Check in your cha prefab file, make sure you have something like this near the end:

return MakePlayerCharacter("wod", prefabs, assets, fn)

prefabs and assets should be a valid table with coorosponding values, and fn should be a valid function to initialize the prefab (character, in this case).

Link to comment
Share on other sites

@Toko,

 

It looks like you were referencing the base game version of gamelogic.lua rather than the DLC version there... line 467 of RoG's gamelogic.lua is

        wilson = SpawnPrefab(playercharacter)

playercharacter is should be a string with the prefab name of your character.  Your log seems to imply that the prefab name being passed is "cha", which I imagine isn't what it's supposed to be.

 

 

edit: if it is supposed to be cha, then you need to have the file "cha.lua" in the "scripts/prefabs" directory of your mod.

 

I was in the base gamelogic.LUA and I see the line you mention in the RoG gamelogic.

The string name in the modmain.LUA is 'Charley' and the prefab file was name Cha.LUA

GLOBAL.STRINGS.CHARACTER_NAMES.Cha = "Charley"

I changed the prefab file to Charley.LUA and it still crashed, however ):

Link to comment
Share on other sites

@Toko Check in your cha prefab file, make sure you have something like this near the end:

return MakePlayerCharacter("wod", prefabs, assets, fn)

prefabs and assets should be a valid table with coorosponding values, and fn should be a valid function to initialize the prefab (character, in this case).

 

I do have that line and "wod" is changed to "Cha", unless it should be changed to the string name "Charley" also. The prefab and all the assets are named 'Cha'. Should I be changing PlayerCharacter to Charley?

Link to comment
Share on other sites

Cha.LUA

 

just call it cha.lua.  Uppercase file extensions is so 1980s DOS like.  Capitalization can also cause problems on systems where the filesystem is case-sensitive. Not actually sure how Lua handles that,  but better to be safe.

 

In fact, for convention's sake, you should probably change all references to "Cha" to be "cha".

 

FWIW, Lua isn't an acronym, it's just the Portuguese word for "moon."

Link to comment
Share on other sites

just call it cha.lua.  Uppercase file extensions is so 1980s DOS like.  Capitalization can also cause problems on systems where the filesystem is case-sensitive. Not actually sure how Lua handles that,  but better to be safe.

 

In fact, for convention's sake, you should probably change all references to "Cha" to be "cha".

 

FWIW, Lua isn't an acronym, it's just the Portuguese word for "moon."

 

ah jeez, it won't even let me enable the mod now. I suppose at this point I'm better off starting over with the fresh templates, aren't I

Link to comment
Share on other sites

Oh! I missed one instance of changing "Cha" to "cha". The game finally loaded!!! :D

 

 

 

Buuuut my character doesn't show up. He has achieved invisibility, an interesting dilemma.

Link to comment
Share on other sites

I see what I did. I misunderstood the part of the tutorial where I needed to edit the build.bin in the /anim folder. I thought I needed to change the file itself from 'build' to 'cha'. Changed it back and I'm good to go. There he is!!!

 

1e2d0b67f211f51a794db59c310b4c51.png

 

Thanks so much for your help, both of you!

Link to comment
Share on other sites

then it cant find the animationfile with the charactertemplate. have u renamed the build in the animationfile, as explained in the tutorials? and have u added the file to the assets at the top of the characters prefab file?

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