LordNiggle Posted October 12, 2019 Share Posted October 12, 2019 How do i do it? Simply removing the .png & replacing it with the respective file extension doesnt work. Do i need a specific program for this? Link to comment Share on other sites More sharing options...
bluecube Posted October 12, 2019 Share Posted October 12, 2019 (edited) Are you working with pngs and an scml or just a png sheet you want to turn into a tex file? For an scml, just drop the folder containing the scml and the pngs into the exported folder of your mod and it will autocompile into a bin tex and xml when you launch the game. If you want to convert a png to a tex file you'll need a tex converter like TEXTool, which is pretty simple to use. Edited October 12, 2019 by bluecube Link to comment Share on other sites More sharing options...
LordNiggle Posted October 13, 2019 Author Share Posted October 13, 2019 3 hours ago, bluecube said: Are you working with pngs and an scml or just a png sheet you want to turn into a tex file? For an scml, just drop the folder containing the scml and the pngs into the exported folder of your mod and it will autocompile into a bin tex and xml when you launch the game. If you want to convert a png to a tex file you'll need a tex converter like TEXTool, which is pretty simple to use. I just want to convert a png to the 3 respectful files somehow. Link to comment Share on other sites More sharing options...
bluecube Posted October 13, 2019 Share Posted October 13, 2019 (edited) You can't make a .bin from a png, you can only convert a png to a .tex file. If you're editing a preexisting item or something, you should already have access to working anim.bin and build.bin files from whatever you're basing it on, you'll just need to convert the .tex to a png, edit it, then convert it back into a .tex file. You can use the tool I linked to do that. Edited October 13, 2019 by bluecube Link to comment Share on other sites More sharing options...
LordNiggle Posted October 13, 2019 Author Share Posted October 13, 2019 43 minutes ago, bluecube said: You can't make a .bin from a png, you can only convert a png to a .tex file. If you're editing a preexisting item or something, you should already have access to working anim.bin and build.bin files from whatever you're basing it on, you'll just need to convert the .tex to a png, edit it, then convert it back into a .tex file. You can use the tool I linked to do that. so do most inventory items have the same build/atlas.bin or whatever it is? I really dont know what those are and am just curious as to what they do, like if theyre used for masking or whatever. I would assume that if I really wanted to just reskin an item i would just get its anim/build and then import my own png but put custom text file? Link to comment Share on other sites More sharing options...
bluecube Posted October 13, 2019 Share Posted October 13, 2019 (edited) You're pretty much correct on how to reskin an item, all you need to do is edit the .tex (so convert it using the TEXTool into a png, edit it, then convert back to .tex with TEXCreator, and replace the original .tex with your new one) as that's the actual image it will use. The .tex will generally be named something like atlas-0.tex. The build.bin and anim.bin are used for the animations and such, so as long as the item you're basing your new mod item off of behaves pretty much how you want it to as far as animations/position on the character/etc then you shouldn't need to worry about these. However, most items will not have the same animations so for example you can't really just grab the anim/build .bins from a hat and use them for a custom armor, you would want to grab them from the hat. Edited October 13, 2019 by bluecube Link to comment Share on other sites More sharing options...
LordNiggle Posted October 13, 2019 Author Share Posted October 13, 2019 49 minutes ago, bluecube said: You're pretty much correct on how to reskin an item, all you need to do is edit the .tex (so convert it using the TEXTool into a png, edit it, then convert back to .tex with TEXCreator, and replace the original .tex with your new one) as that's the actual image it will use. The .tex will generally be named something like atlas-0.tex. The build.bin and anim.bin are used for the animations and such, so as long as the item you're basing your new mod item off of behaves pretty much how you want it to as far as animations/position on the character/etc then you shouldn't need to worry about these. However, most items will not have the same animations so for example you can't really just grab the anim/build .bins from a hat and use them for a custom armor, you would want to grab them from the hat. You have been extremely helpful to me! So if i'm making inventory item that's just a still image i can just nab the anim & build from an item like berries or cut grass? Link to comment Share on other sites More sharing options...
bluecube Posted October 13, 2019 Share Posted October 13, 2019 Inventory textures are separate from the textures used for the item in the world/on a character (inventory textures will be in the images folder, the actual item textures will be in the anim folder). Inventory textures use a .tex file and .xml, however you can do pretty much the same thing and copy then just edit the .tex. Link to comment Share on other sites More sharing options...
LordNiggle Posted October 13, 2019 Author Share Posted October 13, 2019 25 minutes ago, bluecube said: Inventory textures are separate from the textures used for the item in the world/on a character (inventory textures will be in the images folder, the actual item textures will be in the anim folder). Inventory textures use a .tex file and .xml, however you can do pretty much the same thing and copy then just edit the .tex. alright. so the text file in the anim folder is it on the ground then? also when i said inventory item i was talking about just a normal unequpable item, like berries or cut grass so thats my bad. Link to comment Share on other sites More sharing options...
bluecube Posted October 13, 2019 Share Posted October 13, 2019 1 minute ago, LordNiggle said: alright. so the text file in the anim folder is it on the ground then? also when i said inventory item i was talking about just a normal unequpable item, like berries or cut grass so thats my bad. Yup, the .tex file(s) in the anim folder are used for everything other than the inventory image pretty much. Link to comment Share on other sites More sharing options...
LordNiggle Posted October 13, 2019 Author Share Posted October 13, 2019 1 hour ago, bluecube said: Yup, the .tex file(s) in the anim folder are used for everything other than the inventory image pretty much. I have the text & xml in the inventoryimages folder, I have the two bin files and the tex file in a .zip folder in an anims folder and a fully functioning .lua file for the item, but my item isnt in the game when i try to cheat it in through the console Link to comment Share on other sites More sharing options...
bluecube Posted October 13, 2019 Share Posted October 13, 2019 Don't forget to add the prefab to your modmain.lua if you haven't already. Link to comment Share on other sites More sharing options...
LordNiggle Posted October 13, 2019 Author Share Posted October 13, 2019 11 hours ago, bluecube said: Don't forget to add the prefab to your modmain.lua if you haven't already. I've checked quite a few mod's modmains and still kind of lost as to how i do that. So I have this: PrefabFiles = { "itemname", } Assets = { Asset("ATLAS", "images/inventoryimages/itemname.xml"), Asset("ANIM", "anim/itemname.zip"), Asset("IMAGE", "images/inventoryimages/itemname.tex"), } is this enough or do I need to add more to it? Link to comment Share on other sites More sharing options...
bluecube Posted October 13, 2019 Share Posted October 13, 2019 Yup that should be enough, though since your assets are loaded in your item's lua you don't really need those here, just the item in the PrefabFiles. Link to comment Share on other sites More sharing options...
LordNiggle Posted October 13, 2019 Author Share Posted October 13, 2019 (edited) 26 minutes ago, bluecube said: Yup that should be enough, though since your assets are loaded in your item's lua you don't really need those here, just the item in the PrefabFiles. So it turns out my problem had nothing to do with loading the stuff in the modmain. "[00:02:05]: ..\source\animlib\animmanager.cpp(516) :: Tried to add build [berries] from file [anim/berries.zip] but we've already added a build with that name!" I took the two .bins from the berries folder in the anim folder & I dont know how to make or edit .bin files so this wont happen. Is there any solution to this? ((could I take a .bin from someone elses mod & then just uninstall the mod?)) Edited October 13, 2019 by LordNiggle Link to comment Share on other sites More sharing options...
bluecube Posted October 13, 2019 Share Posted October 13, 2019 (edited) Oops I forgot to mention that you need to rename your build using this tool. Edit: Sorry apparently those tools don't contain a build renamer anymore from the looks of it, here's one I found. Nevermind again haha, I just missed it, use the first link for the build renamer. Edited October 13, 2019 by bluecube Link to comment Share on other sites More sharing options...
LordNiggle Posted October 13, 2019 Author Share Posted October 13, 2019 (edited) 2 hours ago, bluecube said: Oops I forgot to mention that you need to rename your build using this tool. Edit: Sorry apparently those tools don't contain a build renamer anymore from the looks of it, here's one I found. Nevermind again haha, I just missed it, use the first link for the build renamer. Does not work ^ Nevermind, I got it to work but the item is invisible in both the inventory (I can see the stack size & spoilage meter) and its invisible on the ground. Edited October 13, 2019 by LordNiggle Link to comment Share on other sites More sharing options...
bluecube Posted October 13, 2019 Share Posted October 13, 2019 What does your item's lua look like? Did you make sure to load the assets there? Link to comment Share on other sites More sharing options...
LordNiggle Posted October 14, 2019 Author Share Posted October 14, 2019 1 hour ago, bluecube said: What does your item's lua look like? Did you make sure to load the assets there? local assets = { Asset("ANIM", "anim/item.zip"), } local prefabs = { "spoiled_food", } local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst.AnimState:SetBank("item") inst.AnimState:SetBuild("item") inst.AnimState:PlayAnimation("idle") MakeInventoryFloatable(inst) inst.entity:SetPristine() if not TheWorld.ismastersim then return inst end inst:AddComponent("stackable") inst.components.stackable.maxsize = TUNING.STACK_SIZE_SMALLITEM inst:AddComponent("inspectable") inst:AddComponent("inventoryitem") inst:AddComponent("edible") inst.components.edible.healthvalue = 7 inst.components.edible.hungervalue = 12.5 inst.components.edible.sanityvalue = 35 inst:AddComponent("perishable") inst.components.perishable:SetPerishTime(TUNING.PERISH_SUPERSLOW) inst.components.perishable:StartPerishing() inst.components.perishable.onperishreplacement = "spoiled_food" MakeHauntableLaunchAndPerish(inst) return inst end return Prefab("item", fn, assets, prefabs) Link to comment Share on other sites More sharing options...
bluecube Posted October 14, 2019 Share Posted October 14, 2019 (edited) I'm not very experienced with lua but other than missing the inventory texture in your assets everything looks right to me. If you send your anim zip i can take a look at it to see if there's a problem there. Edit: Since the anim.bin wasn't renamed or edited (just the atlas-0.tex and build.bin), you'll need to change this line to reference your original item's anim: Quote inst.AnimState:SetBank("item") Change "item" to whatever you're basing the item off of. Edited October 14, 2019 by bluecube Link to comment Share on other sites More sharing options...
LordNiggle Posted October 14, 2019 Author Share Posted October 14, 2019 32 minutes ago, bluecube said: I'm not very experienced with lua but other than missing the inventory texture in your assets everything looks right to me. If you send your anim zip i can take a look at it to see if there's a problem there. Edit: Since the anim.bin wasn't renamed or edited (just the atlas-0.tex and build.bin), you'll need to change this line to reference your original item's anim: Change "item" to whatever you're basing the item off of. I used the anim & build for "berries". It is still invisible while in your inventory, but it does actually show up when dropped. The first image is the image I converted & the second image is what the item looks like when dropped. If you know how to fix the out-of-proportion-mushroom-problem thatd be great but im not even going to complain because 1: it actually works & 2: it actually looks kinda funny. Link to comment Share on other sites More sharing options...
bluecube Posted October 14, 2019 Share Posted October 14, 2019 (edited) The reason it doesn't show up in the inventory is probably simply because you need to add the assets for the inventory image in your lua. As for the ground texture, I think the problem is because the image you used doesn't have the same dimensions as the berry image. As you can see the original berry image is 256x128 and has 2 different textures on it (since the berries have a cooked version). Your image is 64x64. If you don't have a higher resolution of your texture you can simple resize the berry image down to 128x64, but it needs to stay the same aspect ratio. Simply take this image and replace the berries on the right with your new texture. If you won't have a cooked texture, you can either simply ignore the texture on the left or find a food item that doesn't have one and base it off of that. Also, your build should still be that of your new item, since you renamed it with the buildrenamer. Only the anim.bin needs to reference the berries since you're just borrowing the animations of the berries. Edited October 14, 2019 by bluecube 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