MF99K Posted November 7, 2019 Share Posted November 7, 2019 does anyone know of a way to use existing inventory assets for modded items? I want to make it so that the items I'm adding use the butterfly and butterfly wing inventory images, but since they dont have the same name as the .tex, the game won't access them and will crash basically, I'm trying to make evil butterflies that work the same way as regular butterflies, but will spawn and spawn from evil flowers. Here are the files in question: prefabsevilbutterfly.lua evilbutterflywings.lua components evilbutterflyspawner.lua evilpollinator.lua right now I can plant evil butterflies to make evil flowers, but evil flowers still spawn regular butterflies, and the evil butterfly prefabs don't have inventory icons. I tried to use inst.components.inventoryitem.atlasname = "images/inventoryimages/butterfly.xml" to make the evil butterfly use the existing butterfly icon, but the game crashed. Should I just try to make new inventory icons for these items, and if so, what's the best way to decompile and edit the existing ones and then recompile them Link to comment Share on other sites More sharing options...
Jessie_ Posted November 7, 2019 Share Posted November 7, 2019 i think you should be able to just use the setimagename function (without changing the atlasname) Link to comment Share on other sites More sharing options...
its zea Posted November 7, 2019 Share Posted November 7, 2019 decompile the game files, and add the images into your modded folder and call on them from there. Link to comment Share on other sites More sharing options...
MF99K Posted November 7, 2019 Author Share Posted November 7, 2019 3 minutes ago, its zea said: decompile the game files, and add the images into your modded folder and call on them from there. how do I do that with the static images though? I know how to decompile the animations but I don't know how it works for the non-animated stuff Link to comment Share on other sites More sharing options...
Jessie_ Posted November 7, 2019 Share Posted November 7, 2019 3 minutes ago, its zea said: decompile the game files, and add the images into your modded folder and call on them from there. i don't recommend doing this, it's way easier to just use their imagename Link to comment Share on other sites More sharing options...
its zea Posted November 7, 2019 Share Posted November 7, 2019 (edited) 1 minute ago, MF99K said: how do I do that with the static images though? I know how to decompile the animations but I don't know how it works for the non-animated stuff Decomplie the animations into static images and an .scml file. Place those files into your exported folder. Then call upon as you would your own images. Jessie is correct and it probably cleaner and easier to use in-game files. Edited November 7, 2019 by its zea Link to comment Share on other sites More sharing options...
Jessie_ Posted November 7, 2019 Share Posted November 7, 2019 if you want to use the icons for reference use ktech from ktools Link to comment Share on other sites More sharing options...
MF99K Posted November 7, 2019 Author Share Posted November 7, 2019 Just now, its zea said: Decomplie the animations into static images and an .scml file. Place those files into your exported folder. Then call upon as you would your own images. I would use krane for the static images? Link to comment Share on other sites More sharing options...
Jessie_ Posted November 7, 2019 Share Posted November 7, 2019 Just now, MF99K said: I would use krane for the static images? you use ktech for TEX files Link to comment Share on other sites More sharing options...
its zea Posted November 7, 2019 Share Posted November 7, 2019 Just now, MF99K said: I would use krane for the static images? Yes, I recommend making a .bat file inside the ktools folder that way you don't have to type put the command each time. Link to comment Share on other sites More sharing options...
Jessie_ Posted November 7, 2019 Share Posted November 7, 2019 if you're not going to edit anything, you can just use setimagename or whatever the function's name was, which would save you a lot of time Just now, its zea said: Yes, I recommend making a .bat file inside the ktools folder that way you don't have to type put the command each time. this is incorrect, you can't use krane for converting TEX files Link to comment Share on other sites More sharing options...
MF99K Posted November 7, 2019 Author Share Posted November 7, 2019 krane doesnt work for what I need, is ktech the decompiler for static images and if so how do I use it? Link to comment Share on other sites More sharing options...
Jessie_ Posted November 7, 2019 Share Posted November 7, 2019 1 minute ago, MF99K said: krane doesnt work for what I need, is ktech the decompiler for static images and if so how do I use it? https://github.com/nsimplex/ktools#ktech you can use something like this to use the butterfly's inventory icon inst.components.inventoryitem.imagename = "butterfly" Link to comment Share on other sites More sharing options...
MF99K Posted November 7, 2019 Author Share Posted November 7, 2019 ok I think it worked but I have no idea where it saved the image files and I'm assuming I just edit the xml manually Link to comment Share on other sites More sharing options...
its zea Posted November 7, 2019 Share Posted November 7, 2019 9 minutes ago, MF99K said: krane doesnt work for what I need, is ktech the decompiler for static images and if so how do I use it? Sorry I did not read properly for inventory icon yes ktech as jessie said. sorry for the confusion. Link to comment Share on other sites More sharing options...
MF99K Posted November 7, 2019 Author Share Posted November 7, 2019 I compiled the new icons and the game isnt crashing but the icons are still invisible Link to comment Share on other sites More sharing options...
its zea Posted November 7, 2019 Share Posted November 7, 2019 (edited) Post an updated download of your file. Ill see if spot the problem. Also posting your errors would help. Edited November 7, 2019 by its zea Link to comment Share on other sites More sharing options...
MF99K Posted November 7, 2019 Author Share Posted November 7, 2019 (edited) 33 minutes ago, its zea said: Post an updated download of your file. Ill see if spot the problem. Also posting your errors would help. I'm not getting any crashes so there arent any errors. as for what the bug looks like: and the only lines of code I edited: (the other was the same but evilbutterflywings.xml) edit: .tex works fine on the mod listing so there's something wrong with the inventory image in the code and not the asset itself Edited November 7, 2019 by MF99K Link to comment Share on other sites More sharing options...
its zea Posted November 7, 2019 Share Posted November 7, 2019 (edited) 26 minutes ago, MF99K said: I'm not getting any crashes so there arent any errors. as for what the bug looks like: and the only lines of code I edited: (the other was the same but evilbutterflywings.xml) If you made a copy of the images and put them in your mod folder, make sure to point to them under "local assets=" You also need a .tex file as that it was contains the image. Atlas just contain information needed to display the image. Also list the assests in your modmain.lua i.e. Asset("ATLAS", "images/inventoryimages/evilbutterfly.xml"), Asset("IMAGE", "images/inventoryimages/evilbutterfly.tex"), If you are calling upon the game files then try "dontstarve/common/together/ect/ect <-- wherever that particular xml is. I have not play around with this as I have always made my own images, but that seems to be the path other files use. Edited November 7, 2019 by its zea Link to comment Share on other sites More sharing options...
MF99K Posted November 7, 2019 Author Share Posted November 7, 2019 here are the current versions of the files evilbutterfly.lua evilbutterflywings.lua Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now