Jump to content

Reskinning an item and its inventory image in Dont Starve Together


Recommended Posts

So, I'm trying to make a mod where I re-skin an item (replacing the original texture). [Let's say I'm reskinning berries] My Questions are :

1. How do you replace an item's inventory image ?
2. Is The code for reskinning an item the same/similar to reskinning a mob/enemy. If not, could you tell me the codes ?
3. Enlighten me with some other coding information for reskinning items, its inventory image, and adding items to DST

Thanks :) !

Link to comment
Share on other sites

There are probably better answers than this one, but one way you could do it is replace the texture files with your own.

Here is a useful program by Simplex for viewing and editing .anim files.

 

You'll need to grab whatever anim file you want to replace from the anim folder in the game files, unzip it, and put the contents in a folder somewhere you'll remember. To run it, you'll need to open a command prompt and drag the following 3 things into the prompt: the Krane executable, an input folder (with the contents of the unzipped anim file), and an output folder - in that order, and then run it

If everything goes well, the output folder should now contain a set of all the image files that item uses in-game, in png format.

You can edit it however you want, then place the folder into your mod in an "exported" folder, and the auto-compiler should compile it all for you, much like they do for character sprites. 

In your modmain you just need to list the asset along with any other assets like this

Assets = {
	Asset( "ANIM", "anim/whateveritscalled.zip" ),
}

 

Link to comment
Share on other sites

17 hours ago, pickleplayer said:

There are probably better answers than this one, but one way you could do it is replace the texture files with your own.

Here is a useful program by Simplex for viewing and editing .anim files.

 

You'll need to grab whatever anim file you want to replace from the anim folder in the game files, unzip it, and put the contents in a folder somewhere you'll remember. To run it, you'll need to open a command prompt and drag the following 3 things into the prompt: the Krane executable, an input folder (with the contents of the unzipped anim file), and an output folder - in that order, and then run it

If everything goes well, the output folder should now contain a set of all the image files that item uses in-game, in png format.

You can edit it however you want, then place the folder into your mod in an "exported" folder, and the auto-compiler should compile it all for you, much like they do for character sprites. 

In your modmain you just need to list the asset along with any other assets like this


Assets = {
	Asset( "ANIM", "anim/whateveritscalled.zip" ),
}

 

Ah, Thank You for the information, but I still have one more question... when I replace the texture of 'berries.zip' and export that into the game, the inventory image of the item doesn't change. I heard that all the inventory images are located in data > images > intentoryimages.tex , but i found it a bit harder to edit that single berry image with a whole lot of other images blocking my way. Is there a way for me to change the inventory image of the berries using spriter? (so all the inventory images will be separated into individual pngs)or does spriter only work for .zip files since 'inventoryimages.tex' doesnt have a build.bin nor an anim.bin ?

- Hope that made sense, I'm not the best at explaining..

Edited by strawberryjuice
Link to comment
Share on other sites

8 hours ago, strawberryjuice said:

I heard that all the inventory images are located in data > images > intentoryimages.tex , but i found it a bit harder to edit that single berry image with a whole lot of other images blocking my way.

Oh wow, you're right. I've never edited the actual inventory images before, I didn't realize they were all just crammed into one file.

Were you actually able to get a viewable image from Krane? I didn't think it would work with tex files. For tex files like intentoryimages.tex, you're going to need a different set of tools. 

 

KTools comes with TEXTool and TEXCreator. You can use TEXTool to open the tex file you want and save it as a png to edit it, and then use TEXCreator to export it back into a .tex file to throw into your mod's images folder.

From there I beleive you can list the asset in your modmain like the last one, but I think you would do it like this instead: Asset("IMAGE", "images/inventoryimages.tex"),

You'll have to forgive me, I'm not all that familiar with these types of sprites, so I may be missing a few steps

Link to comment
Share on other sites

11 hours ago, pickleplayer said:

KTools comes with TEXTool and TEXCreator. You can use TEXTool to open the tex file you want and save it as a png to edit it, and then use TEXCreator to export it back into a .tex file to throw into your mod's images folder.

From there I beleive you can list the asset in your modmain like the last one, but I think you would do it like this instead: Asset("IMAGE", "images/inventoryimages.tex"),

Ah, no need apologizing, maybe I wasn't that clear enough :wilson_smile: . I tried it with krane and it doesn't make the file it's suppose to make. 

Also, Thank you for giving me the tools, Now I should be able to reskin the inventory images...

ah, last question, since we're trying to export a .tex file into the game, and i assume it counts as image, should I make a new folder called 'Image exports' and then 2 folders inside that folder called 'exported' and 'image' ? or it doesn't matter and everything goes into 'animation exports' folder ?

 

 

Link to comment
Share on other sites

7 hours ago, strawberryjuice said:

ah, last question, since we're trying to export a .tex file into the game, and i assume it counts as image, should I make a new folder called 'Image exports' and then 2 folders inside that folder called 'exported' and 'image' ? or it doesn't matter and everything goes into 'animation exports' folder ?

 

I believe you shouldn't need to worry about any export folders with these. Since these are tex files, they don't need to be converted any further after you've turned your edited png back into tex. You can just put the tex file in a folder called images (or whatever folder name you list in the assets, but i used "images" in my example)

Link to comment
Share on other sites

Thanks! So I should just be able to make an images folder in my mod folder and not have to worry about exporting the tex files into DST's mod files. 

So I don't have to export this 'inventoryimage.tex' to DST's folder or do I have to export the .tex file so the game knows that it should replace the .tex image? also should the only code I'm going to put inside the modmain.lua only Asset("IMAGE", "image/inventoryimage.tex") or is there more? 

 

Thanks Overall ! :D

 

 

Edited by strawberryjuice
Link to comment
Share on other sites

21 hours ago, strawberryjuice said:

Thanks! So I should just be able to make an images folder in my mod folder and not have to worry about exporting the tex files into DST's mod files. 

Since you'll be exporting the png into a tex file yourself, you dont need to do anything with the game's autocompiler or exported folder. So you'll just be adding your altered tex file into an "images" folder like this

image.thumb.png.4828f0cef82d3fccb7fe1c1961051992.png

 

And to get the game to pull that tex file in, you'll put this in the modmain. (your modmain might already have an "Assets" field in it, in which case you would just add that one line into it)

Assets = {
    Asset( "IMAGE", "images/inventoryimages.tex" ),
	--(and any other assets you might be using)
}

 

Do note that although this method is quick and simple, it'll likely mean that this mod will be incompatible with any other mods that alter base inventory files, as well as any official dst updates that add new inventory images to the game. 

Like I mentioned earlier, there are likely better ways to do this, but this is the first method that came to mind, and it's made harder since all of them are crammed into one tex file. Not really sure why they decided to do it that way. maybe to save on file clutter?? who knows.

Link to comment
Share on other sites

4 hours ago, pickleplayer said:

Since you'll be exporting the png into a tex file yourself, you dont need to do anything with the game's autocompiler or exported folder. So you'll just be adding your altered tex file into an "images" folder like this

image.thumb.png.4828f0cef82d3fccb7fe1c1961051992.png

 

And to get the game to pull that tex file in, you'll put this in the modmain. (your modmain might already have an "Assets" field in it, in which case you would just add that one line into it)


Assets = {
    Asset( "IMAGE", "images/inventoryimages.tex" ),
	--(and any other assets you might be using)
}

 

Do note that although this method is quick and simple, it'll likely mean that this mod will be incompatible with any other mods that alter base inventory files, as well as any official dst updates that add new inventory images to the game. 

Like I mentioned earlier, there are likely better ways to do this, but this is the first method that came to mind, and it's made harder since all of them are crammed into one tex file. Not really sure why they decided to do it that way. maybe to save on file clutter?? who knows.

Thank You So Much for the help ! Really appreciate it ! :-D. And Yeah, It's weird that they made all the inventory images get crammed in one file o~o. Maybe because they don't think anyone would change inventory images ? and just add them , who knows ! (Oh and now i know why mine wasn't working Dx, it's because I took the inventoryimages.tex file from the game before the She sells sea shells update. So this means I have to update it as Klei releases new inventory items Dx. Oh well... Thanks For the help once again!!)

Edited by strawberryjuice
Link to comment
Share on other sites

23 hours ago, strawberryjuice said:

Thank You So Much for the help ! Really appreciate it ! :-D. And Yeah, It's weird that they made all the inventory images get crammed in one file o~o. Maybe because they don't think anyone would change inventory images ? and just add them , who knows ! (Oh and now i know why mine wasn't working Dx, it's because I took the inventoryimages.tex file from the game before the She sells sea shells update. So this means I have to update it as Klei releases new inventory items Dx. Oh well... Thanks For the help once again!!)

No Problem!

And I'm not totally sure how the interactions would differ when it comes to game updates, but I think the mod should still run, and whatever new inventory sprites they added would just be invisible unless you add them to your sprite file. Or it would crash. One of those two

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