Jump to content

Mod causing "Dedicated Server Failed to Start" (first time modding)


Recommended Posts

Hi all!
So I decided to make a custom food item for me and my friends, and thought that it should be pretty simple for a first time trying to create my own mod but bruh I was so wrong. I ran into many issues over the last 24h and just can't make it to work properly, so I hope someone more experienced can help me (I looked everywhere on the forum and outside of the forum and nothing seems to work for me or I'm really dumb).

For the mod code I reused code from other mods that I thought had a similar thing going on - new, custom food item with a new recipe (but using ingredients that are already in the game). I'm attaching the files to the topic. 

The part that's giving me the most issues - using ktools that for some reason don't work for me at all, the command window shows up for a split second and then disappears completely. At first I tried launching it with the win32 version, then I tried to use the source code with CMake but it gave me so many errors that it made my head hurt (even tho I had installed Visual Studio 2013 C++ package, ImageMagick etc, still wasn't working and I'm not good with programming so I gave up). 

I specifically need krane to produce the build.bin and all the other stuff that should be in /anim folder, so I tried just copying .zip files from other mods or game folders, replacing atlas-0.tex with my custom texture, zipping it again and renaming the build with Mattstools build renamer but it did nothing for me. 

My mod shows up on the mod list but when I try to launch my server it gives me this lovely message:

image.thumb.png.1d72151445f3d90ebf4ef4fa31a15ba1.png

To be honest I don't know what I'm doing anymore and need some guidance. Any help will be highly appreciated. I'm including a server log with the errors too.
Let me know if I should include anything else or I need to provide more information.

unknown.png

unknown.png

zuberek mod 2.zip server_log.txt

Link to comment
Share on other sites

Update: So i managed to use the krane tool and get some understanding of what actually isn't working.
So as far as I understand even such items as food need to have anim folder and inside there should be a zip with the .bin files etc, and I have my .scml in my exported folder but the game autocompiler isn't doing anything and idk what's wrong anymore.

zuberek mod 2 - update.zip

Link to comment
Share on other sites

Sorry if this is a bit wordy, I want to get as much info in here as I could as to help you understand the issue fully if you care to get further into modding, otherwise feel free to skim past the details.

So with your crash, you see how the crash log says "[string "scripts/mods.lua"]:642: bad argument #1 to ipairs (table expected, got string)" This means that the file "scritps/mods.lua" had an error at line 642 because the function "ipairs" expected a table but was given a string. this is a file in the game's databundles, so I looked at that file on line 642 and saw it was the code responsible for taking a mods "PrefabFiles" variable and adding any prefabs in it. So I looked at your modmain.lua and found the issue, you put "PrefabFiles = ("zuberek")" which is a string, where the game is trying to use that variable as a table, a table by the way is in a way a variable that holds a list of varaibles,

So to fix the crash just replace the "PrefabFiles = ("zuberek")" with "PrefabFiles = {"zuberek"}", the curly brackets tell lua that it is a table so it will use it as such and not crash.


As for your ANIM issue, the scml files can be a bit tricky, it wont work if you rename everything and give it a go because some part still expects the old names, I think if you just change the file name of the scml and change the entity name (open the scml file and look on the right in the animations section it should be the higher one that has the item name) then it works fine as a low-effort fix. For a proper fix I would recommend re-making it which is easy enough if you don't need to make a actual animation, make a new scml file and set the folder as it's root folder, click and drag the png from the top right to have the bottom of the image a bit over the cross-section of the lines, in the animations section rename the top one to the item name and the lower one to "idle" and then you just need to save it and the scml file is good to go.
Either option that you choose, I then would run the autocompiler that comes with "Don't Starve Mod Tools" and if it works it should show a progress bar of sorts in the command window, once it closes you should have the ANIM files of the items all good to go in the folder where they need to be already.

  • Like 1
Link to comment
Share on other sites

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
 Share

×
×
  • Create New...