Jump to content

Character Mod Crashes, Cannot Use in DST


Recommended Posts

Ok, so I finally finished making my first mod for DST, (give or take a few body part image files that I haven't gotten to yet, and about a thousand lines of custom speech quotes) and I went to open it up to see how it worked with the game and if anything would need to be changed, and it says the mod has crashed.

I worked off of an extended character template, (this one, actually: http://forums.kleientertainment.com/topic/46849-tutorial-using-extended-sample-character-template/) and I know it's compatible with DST, as I made a copy of the mod, and worked off of that one while still keeping the original, and the original is compatible.

I know this is an issue with the coding, except I do not know where the issue is. I followed a video tutorial exactly, (the one provided on the site the link above goes to) and added what I was told to put where when I asked for help with custom perks, so I do not know what is wrong. (unless the coding for the perks were put in the wrong places)

I know it is not an issue with the mod file's location; I have it located where all the other downloaded mods are, in:

program files(x86)/steam/steamapps/common/Don't Starve Together/mods 

I have opened up both my edited mod and the original mod's .lua files (everyone one I could find) and put the codes side by side for comparison to see if anything was different that shouldn't have been, but I couldn't find anything.

I feel like it might be something with the modinfo.lua or modmain.lua, as the mod information I put in there does not seem to show up in the mod description when viewing it in the game (for example, the author and compatibility are listed as 'unknown', and the name of the mod is the name of the entire file holding all the images and coding, not the name I put down in modinfo.lua)

I would post coding on here for people to look at, but I do not know what to post, and do not want to post every single .lua file I have. That's a lot. I will post whatever you need me to though.

so if you think you know the problem, that would be a tremendous amount of help! If you need to look at any files, tell me and I will post all that I have within that file.

so sorry for asking for so much help for something; I am afraid I do not know what I am doing, as this is my first mod, and my first experience with coding in general lol. But working on this mod has already been so helpful, and I've learned a lot, so I'm getting there!

Thank you so much for reading, and if you can contribute, I would REALLY appreciate it! :)

Link to comment
Share on other sites

Search here how to find the log. When you find the log, copy the part of the log which indicate the error (not all the line) and copy (in a spoiler) the part of the mod where the error is (if you can't fix it alone of course). For example, if the error is in line 152 in modmain, copy your modmain in spoiler. And attach your mod as a zip, so this way, if the log + file isn't enough someone could take a look at the mod itself.

 

General rule is : error log screen is useful but sometime doesn't give you all the information, or any information at all. Text log screen are usually more precise about what is wrong and so are more helpful.

Link to comment
Share on other sites

10 hours ago, Lumina said:

 When you find the log, copy the part of the log which indicate the error (not all the line) and copy (in a spoiler) the part of the mod where the error is (if you can't fix it alone of course). For example, if the error is in line 152 in modmain, copy your modmain in spoiler. And attach your mod as a zip, so this way, if the log + file isn't enough someone could take a look at the mod itself.

is this it? I followed the directions and found this; it repeats this a couple more time further down the log, but it essentially says the same thing:

Spoiler

[00:01:06]: loaded modindex    
[00:01:06]: Error loading mod: Benny_DST_Mod!
 [string "../mods/Benny_DST_Mod/modinfo.lua"]:12: unexpected symbol near '='
    
[00:01:06]: ModIndex: Beginning normal load sequence.
    
[00:01:06]: Error loading mod: Benny_DST_Mod!
 [string "../mods/Benny_DST_Mod/modinfo.lua"]:12: unexpected symbol near '='

it says it has an error loading the entire thing, so I do not know what to add to a spoiler.

and I have added the zip file. 

some of the images for the character have not been edited from the base yet, but i do not think that would be a problem, would it?

Benny_DST_Mod.zip

Link to comment
Share on other sites

2 hours ago, FrontierHero said:

 

some of the images for the character have not been edited from the base yet, but i do not think that would be a problem, would it?

Should not be a problem, as long as name is ok, content of image itself should not matter, if you did no change. Don't seems to be the problem here.

Could you try change :

forumthread =

by

forumthread = ""

?
I don't have time for tests right now but it could be the issue.

 


 [string "../mods/Benny_DST_Mod/modinfo.lua"]:12: unexpected symbol near '='
    

This line mean the problem is in modinfo.lua. The error is near line 12 (could be line 12 itself, here i think the problem is in the line before, line 8), and the "unexpected symbol near '='" is what is wrong. Usually in this case, either there is a symbol that shouldn't be here, or there is something missing and so the line doesn't "stop" at the right place.

One advice when encountering a log error you don't understand. Try to google it (like "don't starve together unexpected symbol near '=' " in this case), and see if the result could help you. Here the error is probably too generic, but in some cases you can see what is wrong.

 

So i'm not sure this will fix your error, i'm not sure you don't have others errors, but tell me if it"s better or not :)

Link to comment
Share on other sites

1 hour ago, Lumina said:

This line mean the problem is in modinfo.lua. The error is near line 12 (could be line 12 itself, here i think the problem is in the line before, line 8), and the "unexpected symbol near '='" is what is wrong. Usually in this case, either there is a symbol that shouldn't be here, or there is something missing and so the line doesn't "stop" at the right place.

One advice when encountering a log error you don't understand. Try to google it (like "don't starve together unexpected symbol near '=' " in this case), and see if the result could help you. Here the error is probably too generic, but in some cases you can see what is wrong.

THANK YOU for pointing this out; I remember pointing this out, as I did not think it was anything important at the time, and thought it was for something else. I'm sure this will fix it.

Thank you so much for your help; you've really helped time and time again, and I really appreciate it! thank you very much!

This fixed a lot of the issue; the mod now has the right info in the description, and the author and compatibility is now known. it still says the character mod has crashed, and is still disabled, but you've explained a lot, and I'm sure I can figure this out on my own and fix the issue myself now. I have a basic understanding of what to do now. Thank you for the help!

EDIT:

I tried loading the game and it gave me this: (image is attached below)

so i looked at the file and I have this:

Spoiler

local function onhungerchange(inst, data, forcesilent)
    if inst.components.hunger.current > 150 then
        inst.components.combat.damagemultiplier = 1.5
    elseif . . .
    end
end 

I assume the unexpected symbol near '.' is the '.' in 'elseif . . . ', as that is line 40.

i was told to add this to give the mod an attack boost when hunger is at 150 or more, and i have no idea about what this does, so i worked completely off trust that this would work.

would a perk be added into 'benny.lua' in the prefabs folder under scripts? or is this why it doesn't work?

error.png

Edited by FrontierHero
Link to comment
Share on other sites

1 hour ago, FrontierHero said:

so i looked at the file and I have this:

  Hide contents

local function onhungerchange(inst, data, forcesilent)
    if inst.components.hunger.current > 150 then
        inst.components.combat.damagemultiplier = 1.5
    elseif . . .
    end
end 

I assume the unexpected symbol near '.' is the '.' in 'elseif . . . ', as that is line 40.

i was told to add this to give the mod an attack boost when hunger is at 150 or more, and i have no idea about what this does, so i worked completely off trust that this would work.

would a perk be added into 'benny.lua' in the prefabs folder under scripts? or is this why it doesn't work?

local function onhungerchange(inst, data, forcesilent)
    if inst.components.hunger.current > 150 then
        inst.components.combat.damagemultiplier = 1.5
    else
    	inst.components.combat.damagemultiplier = 1.0
    end
end 

Usually three dots in a row is an ellipsis to mean "some stuff here".

In your case you'd revert the change if the condition wasn't met.

Here's what I would do to shorthand the lot and remove a branch conditional with a short circuit one:

inst:ListenForEvent(
    "hungerdelta",
    function(inst, data)
        inst.components.combat.damagemultiplier = inst.components.hunger.current > 150 and 1.5 or 1.0
    end
)

 

Link to comment
Share on other sites

7 minutes ago, CarlZalph said:

Usually three dots in a row is an ellipsis to mean "some stuff here".

In your case you'd revert the change if the condition wasn't met

thank you for your help! this helped a lot, and actually helped me find another issue; i had paritally deleted a local function for a moment! i added it, along with what you told me to change, and it's working now! thank you!

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