Jump to content

Recommended Posts

This is my first time making a mod so bear with me. Whenever I try to load into a server with my character mod enabled I get a "dedicated server failed to start" message as well an "error occurred while trying to start the game" message (twice for some reason)

I have checked both the server log and the client log, but I don't really know what I'm looking for. I can tell somethings gone wrong with my code (specifically in the server log) but I don't know what exactly is the problem with it, or what I'm supposed to do in order to fix it.

It confuses me since the only thing I've done other than the basic stat editing is try to give them a perk which causes them to regen sanity while wearing a straw hat (starting small)

I think its worth mentioning I don't have any other server mods enabled, just the character one.

womy.zip client_log.txt server_log.txt

Hi hi hi hi hi. You comment the "then" of the if in the line 48 of scirpts/prefasbs/womy.lua

local function OnEquipHat(inst)
    if data.item.prefab -- "strawhat" then <-- you comment the "then"
	    inst.components.sanity:StartRegen(TUNING.STRAWHATHEAL, 3)
    end		
	
end

So, here the correction:

local function OnEquipHat(inst)
    if data.item.prefab then -- "strawhat" 
	    inst.components.sanity:StartRegen(TUNING.STRAWHATHEAL, 3)
    end		
	
end

And in the log:

		.
  		.
  		.
[00:00:07]: error calling LoadPrefabFile in mod womy (Extended Sample Character): 
[string "scripts/mainfunctions.lua"]:160: Error loading file prefabs/womy
[string "../mods/womy/scripts/prefabs/womy.lua"]:50: 'then' expected near 'inst'
LUA ERROR stack traceback:
        =[C] in function 'assert'
  		.
  		.
  		.

As a tip, when the game throws a error, search the last "traceback" in the log file, if that traceback doesn't give you much information about where the error is, then look at the second-to-last traceback, before some long, weird text that looks like this:

[00:00:36]: 		K: 	year_of_the_gobbler	 V: 	default	
[00:00:36]: 		K: 	year_of_the_pig	 V: 	default	
[00:00:36]: 		K: 	year_of_the_snake	 V: 	default	
[00:00:36]: 		K: 	year_of_the_varg	 V: 	default	
[00:00:36]: 	K: 	playstyle	 V: 	survival	
[00:00:36]: 	K: 	random_set_pieces	 V: 	table: 000000005142CF00	
[00:00:36]: 		K: 	1	 V: 	Sculptures_2	
[00:00:36]: 		K: 	2	 V: 	Sculptures_3	
[00:00:36]: 		K: 	3	 V: 	Sculptures_4	
[00:00:36]: 		K: 	4	 V: 	Sculptures_5	
[00:00:36]: 		K: 	5	 V: 	Chessy_1	
[00:00:36]: 		K: 	6	 V: 	Chessy_2	
[00:00:36]: 		K: 	7	 V: 	Chessy_3	
[00:00:36]: 		K: 	8	 V: 	Chessy_4	
[00:00:36]: 		K: 	9	 V: 	Chessy_5	
[00:00:36]: 		K: 	10	 V: 	Chessy_6	
[00:00:36]: 		K: 	11	 V: 	Maxwell1	
[00:00:36]: 		K: 	12	 V: 	Maxwell2	
[00:00:36]: 		K: 	13	 V: 	Maxwell3	
[00:00:36]: 		K: 	14	 V: 	Maxwell4	
[00:00:36]: 		K: 	15	 V: 	Maxwell6	
[00:00:36]: 		K: 	16	 V: 	Maxwell7	
[00:00:36]: 		K: 	17	 V: 	Warzone_1	
[00:00:36]: 		K: 	18	 V: 	Warzone_2	
[00:00:36]: 		K: 	19	 V: 	Warzone_3	

I hope it has been helpful (◠‿◠)

  • Like 1
50 minutes ago, FerniFrenito said:

Hi hi hi hi hi. You comment the "then" of the if in the line 48 of scirpts/prefasbs/womy.lua

local function OnEquipHat(inst)
    if data.item.prefab -- "strawhat" then <-- you comment the "then"
	    inst.components.sanity:StartRegen(TUNING.STRAWHATHEAL, 3)
    end		
	
end

So, here the correction:

local function OnEquipHat(inst)
    if data.item.prefab then -- "strawhat" 
	    inst.components.sanity:StartRegen(TUNING.STRAWHATHEAL, 3)
    end		
	
end

And in the log:

		.
  		.
  		.
[00:00:07]: error calling LoadPrefabFile in mod womy (Extended Sample Character): 
[string "scripts/mainfunctions.lua"]:160: Error loading file prefabs/womy
[string "../mods/womy/scripts/prefabs/womy.lua"]:50: 'then' expected near 'inst'
LUA ERROR stack traceback:
        =[C] in function 'assert'
  		.
  		.
  		.

As a tip, when the game throws a error, search the last "traceback" in the log file, if that traceback doesn't give you much information about where the error is, then look at the second-to-last traceback, before some long, weird text that looks like this:

[00:00:36]: 		K: 	year_of_the_gobbler	 V: 	default	
[00:00:36]: 		K: 	year_of_the_pig	 V: 	default	
[00:00:36]: 		K: 	year_of_the_snake	 V: 	default	
[00:00:36]: 		K: 	year_of_the_varg	 V: 	default	
[00:00:36]: 	K: 	playstyle	 V: 	survival	
[00:00:36]: 	K: 	random_set_pieces	 V: 	table: 000000005142CF00	
[00:00:36]: 		K: 	1	 V: 	Sculptures_2	
[00:00:36]: 		K: 	2	 V: 	Sculptures_3	
[00:00:36]: 		K: 	3	 V: 	Sculptures_4	
[00:00:36]: 		K: 	4	 V: 	Sculptures_5	
[00:00:36]: 		K: 	5	 V: 	Chessy_1	
[00:00:36]: 		K: 	6	 V: 	Chessy_2	
[00:00:36]: 		K: 	7	 V: 	Chessy_3	
[00:00:36]: 		K: 	8	 V: 	Chessy_4	
[00:00:36]: 		K: 	9	 V: 	Chessy_5	
[00:00:36]: 		K: 	10	 V: 	Chessy_6	
[00:00:36]: 		K: 	11	 V: 	Maxwell1	
[00:00:36]: 		K: 	12	 V: 	Maxwell2	
[00:00:36]: 		K: 	13	 V: 	Maxwell3	
[00:00:36]: 		K: 	14	 V: 	Maxwell4	
[00:00:36]: 		K: 	15	 V: 	Maxwell6	
[00:00:36]: 		K: 	16	 V: 	Maxwell7	
[00:00:36]: 		K: 	17	 V: 	Warzone_1	
[00:00:36]: 		K: 	18	 V: 	Warzone_2	
[00:00:36]: 		K: 	19	 V: 	Warzone_3	

I hope it has been helpful (◠‿◠)

While that was a problem, I'm still getting the same crashes even after fixing it.

I completely removed the strawhat line of code yet it still just won't work.

What I find even stranger though is I downloaded a completely fresh install of the character template, didn't modify it, put it in the game, yet it's doing exactly the same dedicated server crash as the one I did modify.

And I don't really know what lines of code the crash logs are referring to when it tells me there's an error, plus the game just isn't even generating crash logs anymore which is strange.

I really do appreciate the help, it's impossible to learn something like this without someone more experienced to help.

I can't be of much help because I've never set up a dedicated server myself, so I'll leave you with some forum posts that seem to address your same problem, since your server log indicates an error in main.lua. You probably have more errors than just that one, as your log also mentions an error in modoverride.lua, and there are forum posts about that, too. But let's take it one step at a time, right? I hope this information is helpful. I'll also attach you the link to the server creation guide; one user found that reconfiguring everything from scratch worked for them. If you don't see any progress, you could try the same thing.

Server won't start: "DoLuaFile Could not load lua file scripts/main.lua"

Dedicated server installation - Error loading main.lua

[GUIDE] How to setup dedicated server with cave on Linux

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...