Jump to content

[Help] My mod has crashed, and it can't get up.


Recommended Posts

Yep.

 

I think I might have found your problem.

 

Not sure if you will have troubles with modinfo.lua or not, but doesn't hurt to escape the single quotation in it.

description = "Bringin' a kung-fu cowboy into the world of Don't Starve, y'all."

to

description = "Bringin\' a kung-fu cowboy into the world of Don\'t Starve, y\'all."

Try changing this line on line 39 of modmain:

STRINGS.NAMES.COWBOYHAT = "Clay's Hat"

to

STRINGS.NAMES.COWBOYHAT = "Clay\'s Hat"

Try changing this line on line 45 of modmain:

STRINGS.CHARACTERS.WOODIE.DESCRIBE.CLAY = ("Ranchin's a darn nice profession, eh?")

to

STRINGS.CHARACTERS.WOODIE.DESCRIBE.CLAY = ("Ranchin\'s a darn nice profession, eh?")

Try changing this line on line 47 of modmain:

STRINGS.CHARACTERS.WILLOW.DESCRIBE.CLAY = ("I've never burned up an authentic cowboy hat before...")

to

STRINGS.CHARACTERS.WILLOW.DESCRIBE.CLAY = ("I\'ve never burned up an authentic cowboy hat before...")

You're using single quotations inside a double quotation without using a second single quotation so it might through the lua parser off when it's running. If you escape the single quotation it should tell the parser to ignore looking for the other single quotation.

 

Reference: http://lua-users.org/wiki/StringsTutorial

Edited by Kzisor
Link to comment
Share on other sites

I think I might have found your problem.

 

Not sure if you will have troubles with modinfo.lua or not, but doesn't hurt to escape the single quotation in it.

description = "Bringin' a kung-fu cowboy into the world of Don't Starve, y'all."

to

description = "Bringin\' a kung-fu cowboy into the world of Don\'t Starve, y\'all."

Try changing this line on line 39 of modmain:

STRINGS.NAMES.COWBOYHAT = "Clay's Hat"

to

STRINGS.NAMES.COWBOYHAT = "Clay\'s Hat"

Try changing this line on line 45 of modmain:

STRINGS.CHARACTERS.WOODIE.DESCRIBE.CLAY = ("Ranchin's a darn nice profession, eh?")

to

STRINGS.CHARACTERS.WOODIE.DESCRIBE.CLAY = ("Ranchin\'s a darn nice profession, eh?")

Try changing this line on line 47 of modmain:

STRINGS.CHARACTERS.WILLOW.DESCRIBE.CLAY = ("I've never burned up an authentic cowboy hat before...")

to

STRINGS.CHARACTERS.WILLOW.DESCRIBE.CLAY = ("I\'ve never burned up an authentic cowboy hat before...")

You're using single quotations inside a double quotation without using a second single quotation so it might through the lua parser off when it's running. If you escape the single quotation it should tell the parser to ignore looking for the other single quotation.

 

Reference: http://lua-users.org/wiki/StringsTutorial

Still didn't work. Considering I've been trying out DST mods that do work all day today that have has words like "it's, that's, ect." in their modmains, I doubted this was it.

 

Link to comment
Share on other sites

Still didn't work. Considering I've been trying out DST mods that do work all day today that have has words like "it's, that's, ect." in their modmains, I doubted this was it.

 

 

The reason you have received this error [[expected ' or "]] is because it's expecting to have one of those some where within your lines of code.

 

This is the only information that I can come up with on the web given that exact expected error, which led me to believe that you have an non-closed quotation or a string which isn't quoted correctly.

 

 

 

unfinished string near [...]

This occurs when the compiler encounters an extra " that is unmatched to end a string before the end of the file. For example,

     23: `unfinished string near `"'

tells you that the string begun with " on line 23 was never terminated by another " character.

 

EDIT:

I just downloaded clay.lua and I think I might have found a potential issue in it on line 39:

local start_inv = {"cowboyhat"}
Edited by Kzisor
Link to comment
Share on other sites

 

The reason you have received this error [[expected ' or "]] is because it's expecting to have one of those some where within your lines of code.

 

This is the only information that I can come up with on the web given that exact expected error, which led me to believe that you have an non-closed quotation or a string which isn't quoted correctly.

 

 

 

 

EDIT:

I just downloaded clay.lua and I think I might have found a potential issue in it on line 39:

local start_inv = {"cowboyhat"}

I kind of figured it was something like that, I just didn't know where this was occurring.

Also, I don't think I see the same issue you do there.

 

Link to comment
Share on other sites

I just downloaded clay.lua and I think I might have found a potential issue in it on line 39: ? 1 2 3 local start_inv =  {"cowboyhat" }
  That looks fine to me.

 

As you pointed out with your example, though, having a missing second quote produces a different message ("unfinished string near ___"). So it must be something more complex.

 

Are you still using the folder name with the space in it, though?

 

Also, you said the issue only occurs when you add hats. Have you tried commenting out parts of the hats (and in some places replacing it with less risky code, like using in-game assets for the hats instead of the ones you provided, etc)? Maybe the string problem exists in one of the anim names for the hats or something.

Link to comment
Share on other sites

  That looks fine to me.

 

As you pointed out with your example, though, having a missing second quote produces a different message ("unfinished string near ___"). So it must be something more complex.

 

Are you still using the folder name with the space in it, though?

 

Also, you said the issue only occurs when you add hats. Have you tried commenting out parts of the hats (and in some places replacing it with less risky code, like using in-game assets for the hats instead of the ones you provided, etc)? Maybe the string problem exists in one of the anim names for the hats or something.

 

 

If Klei has altered the output error in any fashion with how string errors are output it will be different than what I've posted. So it could still potentially be an issue.

 

The only other thing which would help is if they posted the entire mod for us to look through and possibly figure it out that way. The bits of code that I have I don't potentially see any error in other than the small bit's I've pointed out which could potentially cause issues.

 

EDIT:

 

 

I kind of figured it was something like that, I just didn't know where this was occurring.

Also, I don't think I see the same issue you do there.

 

Try adding a comma after the "cowboyhat" section.

 

example

local start_inv = {"cowboyhat",}
Edited by Kzisor
Link to comment
Share on other sites

  That looks fine to me.

 

As you pointed out with your example, though, having a missing second quote produces a different message ("unfinished string near ___"). So it must be something more complex.

 

Are you still using the folder name with the space in it, though?

 

Also, you said the issue only occurs when you add hats. Have you tried commenting out parts of the hats (and in some places replacing it with less risky code, like using in-game assets for the hats instead of the ones you provided, etc)? Maybe the string problem exists in one of the anim names for the hats or something.

 

I renamed the folder "Klei_Bailey", but it didn't really fix anything.

As for the hats, I've taken some codes from already existing hats in functional DST mods with no positive results. I thought it was because I messed up while compiling the hat in Spriter (doodling over the straw hat build), but I just took the straw hat zip straight from DST, broke it down in krane, and replaced the existing art with my own and that did nothing, so I'm not sure what else it could be.

 

Try adding a comma after the "cowboyhat" section.

 

example

 

local start_inv = 

{

"cowboyhat",

}

 

Nothing changed.

Edited by Worthington
Link to comment
Share on other sites

I renamed the folder "Klei_Bailey", but it didn't really fix anything.

As for the hats, I've taken some codes from already existing hats in functional DST mods with no positive results. I thought it was because I messed up while compiling the hat in Spriter (doodling over the straw hat build), but I just took the straw hat zip straight from DST, broke it down in krane, and replaced the existing art with my own and that did nothing, so I'm not sure what else it could be.

 

Nothing changed.

 

Could you please post an entire .zip of all the files for your mod so we may plug it into our mod folder and actually see if we can replicate the bug? This might be something completely different than the mod itself.

Link to comment
Share on other sites

Try adding a comma after the "cowboyhat" section.   example ? 1 2 3 4 local start_inv =  { "cowboyhat", }
 That's only needed to separate key/value pairs (or explicit values with default keys). So you can definitely do local start_inv = {"cowboyhat"}, just like you could do local start_inv = {"meat","cowboyhat"} instead of local start_inv = {"meat", "cowboyhat",}

 

@Worthington, Then you should do what I suggested. Disable code, strip code down, find the smallest thing that causes the error, but doesn't cause it when you remove it. It's a standard debugging process for difficult-to-find errors.

Link to comment
Share on other sites

Could you please post an entire .zip of all the files for your mod so we may plug it into our mod folder and actually see if we can replicate the bug? This might be something completely different than the mod itself.

Klei_Bailey.zip

 

@Worthington, Then you should do what I suggested. Disable code, strip code down, find the smallest thing that causes the error, but doesn't cause it when you remove it. It's a standard debugging process for difficult-to-find errors.

 

I have fiddled (or gutted would be a more appropriate word here) with my mod, the hat and the character itself and removed coding I thought was throwing the game off, but I didn't find anything too troubling.

Also, this is going to sound dumb, but I'm not too sure how to disable coding all together, if that's what you meant, anyway. And if you meant something else, I feel dumber.

Link to comment
Share on other sites

@Worthington, If you're using Notepad++, you can use ctrl+Q to comment out the selected code. The hotkeys may be different for other editors, but manually adding "--" will disable the rest of the line, and adding "--[[stuff goes here]]" will disable everything in the middle (a "block comment"). 

Link to comment
Share on other sites

@Worthington, If you're using Notepad++, you can use ctrl+Q to comment out the selected code. The hotkeys may be different for other editors, but manually adding "--" will disable the rest of the line, and adding "--[[stuff goes here]]" will disable everything in the middle (a "block comment"). 

Just disabled a few bits of code I thought was causing it in the hat's lua, the character's and in the modmain, but none of it was causing the problem. Did you get the character's zip file and see if there was anything conflicting in there?

 

Link to comment
Share on other sites

@Worthington, Yes, so I determined that a problem exists in your assets. It appears to be in multiple assets. This is what I've found so far:
 
bigportraits/clay.xml has a "}" that shouldn't be there, right at the start.
Same problem with images/inventoryimages/cowboyhat.xml
 
Remove this line:

GLOBAL.DST_CHARACTERLIST[#GLOBAL.DST_CHARACTERLIST+1] = 'clay'

That adds him to the main character list, which means the game looks in its own files for his assets. You already have the AddModCharacter call later, which is all you need.
 
Add GLOBAL to this line like so:

GLOBAL.table.insert(GLOBAL.CHARACTER_GENDERS.MALE, "clay")

table, like require, etc, is in the GLOBAL space.
 
In cowboyhat.lua, you need to change these lines:

    inst.components.equippable:SetOnEquip( cowboyhat_onequip )    inst.components.equippable:SetOnUnequip( cowboyhat_onunequip )

You don't define a cowboyhat_onequip, etc. You define onequip, onunequip, so use those instead.
 
With those changes, I managed to load into a game and run around a little. Nice art, by the way.
 
It looks like some of your xmls have bad values, though, since the inventory art for the hat and the bigportrait were cut off. Did you let it autocompile the tex and xml from a png?

Edit: So I'm pretty sure it was the rogue brackets in the xml that were causing the mysterious error.

 

Edit: Do the sounds work for you? They don't work for me. By peeking into the fev, it looks like it's referencing sounds way outside of the game's folders. I've never worked with sounds in the game before, but I'm guessing there's something else you have to do there.

Edited by rezecib
Link to comment
Share on other sites

helpful whatnot

My computer has decided to start lagging for no reason, so I'm going to have to wait to load it in game. Hopefully, though, if it's working for you, it's working for me. Thank you, btw, I worked hard on the art. :razz:

For the .tex images, I believe so, yes. For the .xmls, however, I used the ones from "Extended Sample Character", and just replaced "ecsample" with "clay." My TexTool doesn't like to make me .xmls, for some reason.

 

Edit: It works! Thank you, rez, I now grant you my immortal soul.

Edit 2:

Edit: Do the sounds work for you? They don't work for me. By peeking into the fev, it looks like it's referencing sounds way outside of the game's folders. I've never worked with sounds in the game before, but I'm guessing there's something else you have to do there.

 

I've never worked with sounds before, and, sadly, the "Adding custom sound to your custom character" thread back in the DS mod tools subforum has deleted it's DS sound template. If there is an issue, I'll have to look further into that to figure out how to make it work in game.

Edited by Worthington
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...