Jump to content

How would I make a helmet mod

Recommended Posts

I want to know how to make a helmet, or even how to find and use the code from an existing helmet in the game.

If anyone knows I also need to:

-Add it to a character mod

-Add a crafting recipe that uses hunger as an ingredient to craft the helmet

Link to comment
Share on other sites

You'll have to unzip the scripts folder in C:\Program Files (x86)\Steam\steamapps\common\Don't Starve Together\data\databundles

move the folder into data just for convenience since that's where is used to be. If you want to make changes to the game itself, rename the original zipped scripts folder.

The items you're looking for are in the prefab folder inside scripts. Look for the hats.lua file. I've never made a new hat before, and since they're all in one file, it might be a little different from how one would normally add a new prefab. I would look into other simple mods to see how they implement new hats. If you only want a certain character to be able to equip it, you can probably add some tag to the character and check for that before you allow the equip action to run. I looked around for recipe stuff, it seems like the way the game does stat ingredients is like this:

Recipe("reviver", {Ingredient("cutgrass", 3), Ingredient("spidergland", 1), Ingredient(CHARACTER_INGREDIENT.HEALTH, 40)}, RECIPETABS.SURVIVAL,  TECH.NONE)

Unfortunately, CHARACTER_INGREDIENT.HUNGER does not exist. In the constants file, it only lists health and sanity as usable traits, so hunger is not built in to the game as a cleanly usable ingredient. You might be able to do something hacky where in the init function of the helmet it does a delta on the creator's hunger, that might be a decent alternative... maybe you could push an event and listen for it in the player's file. You just have to make sure that it deducts hunger from the right player character somehow in case there's more than one of your character.

This might seem really vague but you'll have to look some stuff up, hopefully this points you in the right direction...

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

  • Create New...