Jump to content

How to make a custom item


Recommended Posts

@Dogmeat8990
Probably not too hard.  @Me in the morning and I can provide more specific information.

Here’s the general steps I think you’ll need to do.  Go into the base game’s data, find the prefab for the axe, and just copy it into your mod’s prefab file.  You’ll update the name of the item (at the bottom of the file, and a few other places I think.)  you may be able to copy the axe’s original animation file, if one exists, I haven’t made custom weapons yet.  In your modmain file you add a recipe for your axe, recipe text, and inspection text.  The recipe’s image goes somewhere, but I can’t remember it off the top of my head.

As for special qualities, those likely all go in the axe’s prefab file.  What kinds of things did you want it to do?  Extreme durability?  Chop down trees faster?  Only usable by your unique character?

  • Like 1
Link to comment
Share on other sites

@Dogmeat8990
Axe animation files are in here:  C:\Program Files (x86)\Steam\steamapps\common\Don't Starve Together\data\anim

I've attached the base axe's code, which was here:  C:\Program Files (x86)\Steam\steamapps\common\Don't Starve Together\data\databundles\scripts.zip\scripts\prefabs

Add to starting inventory:

if startinginventory == 1 then
	TUNING.GAMEMODE_STARTING_ITEMS.DEFAULT.FURRYESKIMO = {
		--Axe's prefab name  (eg. "superaxe",  )
	}
end

local master_postinit = function(inst)  --Set player's abilities here..
	--Sets starting inventory.
	inst.starting_inventory = start_inv[TheNet:GetServerGameMode()] or start_inv.default

I'm not totally sure how Woodie's axe works (Lucy) but I found those prefabs for you too.  Hope this helps!  I'm sure there must be other forums posts about custom items like Woodie's axe, but maybe you can just edit Woodie's axe to make your own version.  You'll still need inventory images, but I think tat's pretty easy if you have your own images.  It's been a while since I did any of that code, but it looked something like:

--In ModMain
Assets = {
	Asset( "IMAGE", "images/map_icons/ice_den.tex" ),  --Code related to a custom tent.
	Asset( "ATLAS", "images/map_icons/ice_den.xml" ),
	Asset( "IMAGE", "images/inventoryimages/ice_den.tex" ),
	Asset( "ATLAS", "images/inventoryimages/ice_den.xml" ),
}

AddMinimapAtlas("images/map_icons/furryeskimo.xml")
AddMinimapAtlas("images/map_icons/ice_den.xml")  --Allows the ice den's map icon to appear.

ice_den.atlas = "images/inventoryimages/ice_den.xml"

 

axe[1].lua lucy[1].lua lucy_classified[1].lua

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