Sign in to follow this  
Garamonde

[SELF-SOLVED] How to extract .SCML files/sprite frames for the playable characters using ktools

Recommended Posts

Garamonde    53

This is kind of a weird one and I'm not very hopeful there'll be a solution, but I basically want to know how I can export animations/individual texture frames for the survivors using ktools. There are 2 reasons why I'm asking this:

1: Because none of the main players' builds contain .ANIM files like the other entities do, which from what I read about ktools is required in order to export an .SCML file, yet I've seen .GIFs online and such places of the playable characters and I don't know how they obtained/made them

2: I want to be able to view each of the survivors' body part sprites in a similar fashion to the Extended Sample Character so I can see the actual frame isolated, so basically in a fashion that is a bit nicer than this:

wilson.thumb.png.1e8ad4e52eb8edf36131bec0890d580c.png

(Sorry if I'm not supposed to post this, let me know and I'll take it down or delete the thread entirely)

Hopefully someone knows how to achieve this. It'd be really helpful to me to have the player characters' segregated, non-jumbled parts. Thanks in advance!

Edited by Garamonde
Found my solution on my own.

Share this post


Link to post
Share on other sites
Garamonde    53

Sorry to waste anyone's time, I actually figured it out! It seems that the .ANIM file within the "build_status" folder is the one I needed and it seems to work for all the survivors!

Side note: Doubtful if anyone really needs it at this point but if anyone wants to know how I did it, feel free to ask and I'll make a little guide on it!

Thanks anyway!

Share this post


Link to post
Share on other sites
AkaiNight    31
On 6/24/2021 at 1:45 AM, Garamonde said:

Sorry to waste anyone's time, I actually figured it out! It seems that the .ANIM file within the "build_status" folder is the one I needed and it seems to work for all the survivors!

Side note: Doubtful if anyone really needs it at this point but if anyone wants to know how I did it, feel free to ask and I'll make a little guide on it!

Thanks anyway!

Is it works for item files too? Like armors? İ am trying to make a character mod with some custom items. There is no template files for armors. I already did lua files and i just need to finish anim files. And i don't know how to do it. If its work for armor files i might be able to edit an existed armor.
 

  • Like 1

Share this post


Link to post
Share on other sites
Garamonde    53

@AkaiNight

Yes it does! So first off you wanna make sure you have ktools. Next, you wanna go into Steam\steamapps\common\Don't Starve Together\data\anim, and you'll see tons upon tons of .zip files labeled with the prefab names of the game's entities. For this example I'll use "armor_slurtleshell.zip". Extract the contents of the .zip anywhere outside the game's folders. There should be anim.bin, atlas-0.tex, and build.bin files in most of the .zip files. You'll wanna put all 3 of these files in the same folder as ktools. Next, make a new text document and paste this code into it...

krane anim.bin build.bin output_dir

...as explained here. Then, save it as a .bat file (it can be named anything; heck, I named mine "slurtle.bat" lol), again in the same folder as ktools. Now, double-click/run the new .bat file. A command prompt window will open, but instead of doing nothing (like ktools normally does when you try to open it this way), Krane will actually start extracting the individual sprite frames and sort them, separated into folders by object and in proper animation order too. The folder, as indicated by the .bat's code, will be named output_dir and will be located inside ktools' folder. Open that and you'll see all the beautiful sprite frames, ready to do whatever with in subfolders, along with the entity's .scml file. Now, in some cases, such as with the Snurtle Shell Armor that I extracted, the frames actually came out upscaled and blurry, like this:

swap_body_tall-14.png.4d9977c466c43b8210c01c542c810ef0.png

Some of the sprites just don't extract correctly for whatever reason, even if all 3 files came from the same folder and match. There is a way around this, though, and these sprites can still serve a purpose.

Make sure you have TEXTool, and open that. Browse to the folder of your armor (for this we'll be looking at armor_slurtleshell's again) and open the .tex file that's in there with TEXTool. You'll see the texture atlas of the item/entity being viewed in its raw state, so not upscaled and blurry:

image.thumb.png.54d5722fd9c4fdb62037179f2da087d7.png

Now you can click the save button and choose to export the texture atlas as a .png. Now you can get to editing! If you need to know how to rebuild your changes back into anim.bin and build.bin files, there is this guide that details how to do it. If you aren't trying to change an existing item and re-insert it back into the base game, then you should be able to just open this new png atlas in your favorite image editing program that supports transparency (I use Paint.NET), and begin using your select tool to separate the sprites and resave them as separate images. This is where the seemingly useless, blurry versions of the sprites can be useful; use the single, blurry frames as a guide on how the sprites should be ordered and organized.

Hopefully that helps and if you have any more questions, I'll try to help!

Edited by Garamonde
Forgot to actually add why the blurry sprites would be useful lol
  • GL Happy 1

Share this post


Link to post
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
Sign in to follow this