Jump to content

Extracting Inventory Images?


Recommended Posts

in

data/images/inventoryimages.tex

and

data/databundles/images.zip/images/inventoryimages1.tex

data/databundles/images.zip/images/inventoryimages2.tex

To view them, download Don't Starve Mod Tools from your Steam library. Then Right click it in your library -> manage -> browse local files

It should take you to somewhere like

C:\Program Files (x86)\Steam\steamapps\common\Don't Starve Mod Tools

then go to mod_tools/tools/bin

and use

TextureViewer.exe

You can even right click your .tex file (in explorer,not the zip file) -> properties -> near the top,

Type of File: TEX...
Open with: ...

Click the "Change ..." button, and set it to the TextureViewer.exe

  • Like 1
Link to comment
Share on other sites

@Bigfootmech
Wow!  This is, a little overwhelming, but helpful!  I'm looking at what appear to be dozens and dozens of inventory images.  Do you have any idea how I use this?  I just wanted the image file for a specific item.

Does this also work for the mini-map images?  I'm making a version of bird traps and those have a mini-map image that isn't located in this inventory image file.

Link to comment
Share on other sites

> Do you have any idea how I use this? 

You could convert it to PNG, and then crop. Also the .xml files will correlate portions of the image with the item. But that's about it.

As for the rest, not sure.

I'm kinda new to this too ^_^. Just happened to stumble accross this yesterday.

 

Link to comment
Share on other sites

@Bigfootmech

I tried to save the file, but there’s no option to do so.  All it allows me to do is view the file’s data.
As for referencing data in such a file, I’m afraid I have no experience.  What I’ve done for other items was put it in a mod file, reference the location, and the auto-compiler converted the file to the version DST uses.  I was hoping I could just tell it to use the original version, but I don’t know how to download or use this data yet.  I appreciate the help though!

Link to comment
Share on other sites

I do not get what you're trying to do lol

If you wanna use things from the .tex without modifying them, the .xml file breaks down the .tex file in to individual item icons.

For example, take a look at data/images/saveslot_portraits

it has a .tex and a .xml file

Each "icon" has an Element in the xml file defining it.

For example, Wigfrid (wathgrithr in the code) is the very top right of the .tex combined file.

Her element is:

<Element name="wathgrithr.tex" u1="0.82080078125" u2="0.93701171875" v1="0.7978515625" v2="0.9990234375" />

Meaning: left/right the icon goes from ~0.82 to 0.93 of the total tex file (ie: 82-93%)

And up/down, Wigfrid's icon goes from 0.79 to 0.99 (almost very top) of the file

Comparatively, WX's element is:

<Element name="wx78.tex" u1="0.82080078125" u2="0.93701171875" v1="0.3916015625" v2="0.5927734375" /></Elements>

meaning he occupies the same left/right space as Wigfrid's icon (checks out)

While occupying a different up/down space.

It's also not at the very bottom of the image, so  it starts at like 0.39, and ends at 0.59

 

But how these names (for example wx78.tex) are referenced, I don't know yet. I would need to do more digging.

I'm assuming that you've already played with some of the code for the inventory stuff, or at least know a mod that references it, and you could dig it out.

Probably touching "prefabs" (a hunch)

Link to comment
Share on other sites

@Bigfootmech
My goal was to make a “cheap bird trap” that was nearly identical to the default trap, but with a different recipe.  I copied the prefab file, renamed the prefab, added it to my modmain with a recipe, and it works, but the inventory image isn’t there.  Apparently I need to reference the image, but I don’t know how to reference images in the default file location, only within my own file, and that only includes Tex files I put there or generated from another type of image file.

Link to comment
Share on other sites

@penguin0616
Specifically the bird trap image.  It would be useful to know how to extract any specific image, but I just need the bird trap right now.  I have another post about the bird trap, and someone has offered help, but the files they provided seem to cause an error..  

 

Edited by FurryEskimo
Link to comment
Share on other sites

@penguin0616
I tried using the mod on a server without caves and it kept crashing the entire game, plus no error logs.  I made a new server with caves, and it simply fails to launch the server.
  

image.png

Edit:  I tested the mod on a map with no caves, with the new bird trap visuals turned off, and the mod works fine, so it's definitely the visual causing the error.

server_log_2021-01-30-13-47-36.txt

Edited by FurryEskimo
Link to comment
Share on other sites

There's supposed to be a client log as well.

Also, yes, there is an error in that server log.

"expected <"

@FurryEskimo Replace the contents of your XML file with this.

<?xml version="1.0"?>
<Atlas>
	<Texture filename="cheapbirdtrap.tex"/>
	<Elements>
		<Element v2="1" v1="0" u2="1" u1="0" name="cheapbirdtrap.tex"/>
	</Elements>
</Atlas>

 

Edited by penguin0616
  • Like 1
  • Health 1
Link to comment
Share on other sites

@Combustiblemon  @penguin0616

Got it!  You were right, there was a typo in the XML file.  Also, I changed "GLOBAL.STRINGS.NAMES.cheapbirdtrap= "Cheap Bird Trap"" to "GLOBAL.STRINGS.NAMES.CHEAPBIRDTRAP = "Cheap Bird Trap"".  There were a few error like that regarding it's text.
I re-added "cheapbirdtrap.atlas = "images/inventoryimages/cheapbirdtrap.xml"" in the modmain, and reactivated the 

	Asset("IMAGE", "images/inventoryimages/cheapbirdtrap.tex"),  --Cheap bird trap uses the default bird trap visuals.
	Asset("ATLAS", "images/inventoryimages/cheapbirdtrap.xml"),

in the modmain's asset list, and now it all appears to be working perfectly!  Thanks so much!  I'm still not quite sure how CombustibleLemon got the image file, but it appears to be working, so thank you so much.

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