Lugon Posted June 6, 2024 Share Posted June 6, 2024 So I added a crafting recipe for the accursed trinket and its working fine, but for some reason it doesn't have an icon on the crafting menu and I can't seem to be able to add one the same way I added one to my custom items. I'm guessing that since the trinket has like 5 different possible inventory icons the game just doesn't know what to do with the crafting menu? Any help with getting an icon to show up there would be much appreciated. Link to comment https://forums.kleientertainment.com/forums/topic/156554-trying-to-add-an-inventory-icon-to-an-existing-item-that-doesnt-have-one/ Share on other sites More sharing options...
Haruhi Kawaii Posted June 7, 2024 Share Posted June 7, 2024 17 hours ago, Lugon said: So I added a crafting recipe for the accursed trinket and its working fine, but for some reason it doesn't have an icon on the crafting menu and I can't seem to be able to add one the same way I added one to my custom items. I'm guessing that since the trinket has like 5 different possible inventory icons the game just doesn't know what to do with the crafting menu? Any help with getting an icon to show up there would be much appreciated. I guess since the image file name doesn't match the prefab name, you can add these to your crafting recipe cursed_beads1, cursed_beads2, cursed_beads3, cursed_beads4 Link to comment https://forums.kleientertainment.com/forums/topic/156554-trying-to-add-an-inventory-icon-to-an-existing-item-that-doesnt-have-one/#findComment-1720438 Share on other sites More sharing options...
Lugon Posted June 7, 2024 Author Share Posted June 7, 2024 6 hours ago, Haruhi Kawaii said: I guess since the image file name doesn't match the prefab name, you can add these to your crafting recipe cursed_beads1, cursed_beads2, cursed_beads3, cursed_beads4 Where exactly would I add it? I tried using this before: local cursed_monkey_token_recipe = AddRecipe2("cursed_beads4", {Ingredient("rope", 1), Ingredient("houndstooth", 2), Ingredient("palmcone_scale", 2)}, TECH.NONE, {numtogive = 1}, {"CHARACTER"}) But then all it does it show the icon, when you try crafting it nothing happens. Also I probably need a way for the cursed_monkey_token prefab itself to use the icon since I'm using it on other recipes and that spot also shows up empty. I was trying to use AddPrefabPostInit to specify the crafting menu icon but I don't know what it is that I need to change or even if its possible at all make it work like that. Using RegisterInventoryItemAtlas also doesn't work. Link to comment https://forums.kleientertainment.com/forums/topic/156554-trying-to-add-an-inventory-icon-to-an-existing-item-that-doesnt-have-one/#findComment-1720699 Share on other sites More sharing options...
Haruhi Kawaii Posted June 8, 2024 Share Posted June 8, 2024 8 hours ago, Lugon said: Where exactly would I add it? I tried using this before: local cursed_monkey_token_recipe = AddRecipe2("cursed_beads4", {Ingredient("rope", 1), Ingredient("houndstooth", 2), Ingredient("palmcone_scale", 2)}, TECH.NONE, {numtogive = 1}, {"CHARACTER"}) But then all it does it show the icon, when you try crafting it nothing happens. Also I probably need a way for the cursed_monkey_token prefab itself to use the icon since I'm using it on other recipes and that spot also shows up empty. I was trying to use AddPrefabPostInit to specify the crafting menu icon but I don't know what it is that I need to change or even if its possible at all make it work like that. Using RegisterInventoryItemAtlas also doesn't work. local cursed_monkey_token_recipe = AddRecipe2("cursed_monkey_token", {Ingredient("rope", 1), Ingredient("houndstooth", 2), Ingredient("palmcone_scale", 2)}, TECH.NONE, {image = "cursed_beads4.tex"}, {numtogive = 1}, {"CHARACTER"}) 1 Link to comment https://forums.kleientertainment.com/forums/topic/156554-trying-to-add-an-inventory-icon-to-an-existing-item-that-doesnt-have-one/#findComment-1721089 Share on other sites More sharing options...
Lugon Posted June 8, 2024 Author Share Posted June 8, 2024 35 minutes ago, Haruhi Kawaii said: local cursed_monkey_token_recipe = AddRecipe2("cursed_monkey_token", {Ingredient("rope", 1), Ingredient("houndstooth", 2), Ingredient("palmcone_scale", 2)}, TECH.NONE, {image = "cursed_beads4.tex"}, {numtogive = 1}, {"CHARACTER"}) It removed the trinket from the menu initially but I tried it like this: {image = "cursed_beads4.tex", numtogive = 1} And it worked for the main recipe! Thank you! But that issue I mentioned before is still there, when I try using it as an ingredient the icon still shows up empty. Link to comment https://forums.kleientertainment.com/forums/topic/156554-trying-to-add-an-inventory-icon-to-an-existing-item-that-doesnt-have-one/#findComment-1721115 Share on other sites More sharing options...
Haruhi Kawaii Posted June 8, 2024 Share Posted June 8, 2024 5 hours ago, Lugon said: It removed the trinket from the menu initially but I tried it like this: {image = "cursed_beads4.tex", numtogive = 1} And it worked for the main recipe! Thank you! But that issue I mentioned before is still there, when I try using it as an ingredient the icon still shows up empty. I tried it and it still works fine, try despawn your character AddPrefabPostInit("cursed_monkey_token", function(inst) if not GLOBAL.TheWorld.ismastersim then return inst end inst.components.inventoryitem.atlasname = "images/inventoryimages/someatlasname.xml" inst.components.inventoryitem.imagename = "cursed_monkey_token" end) Link to comment https://forums.kleientertainment.com/forums/topic/156554-trying-to-add-an-inventory-icon-to-an-existing-item-that-doesnt-have-one/#findComment-1721286 Share on other sites More sharing options...
Lugon Posted June 8, 2024 Author Share Posted June 8, 2024 (edited) 6 hours ago, Haruhi Kawaii said: I tried it and it still works fine, try despawn your character AddPrefabPostInit("cursed_monkey_token", function(inst) if not GLOBAL.TheWorld.ismastersim then return inst end inst.components.inventoryitem.atlasname = "images/inventoryimages/someatlasname.xml" inst.components.inventoryitem.imagename = "cursed_monkey_token" end) Sorry, I'm not sure what you mean by 'despawn your character' here. I tried adding this to my modmain and it just made it invisible when it's in my inventory I also tried using a custem item's xml there and different image names to test it but nothing worked for me. This is what it looks like right now: Sorry if I'm being dumb also, I'm very new to modding and I really appreciate the help. Edited June 8, 2024 by Lugon typo Link to comment https://forums.kleientertainment.com/forums/topic/156554-trying-to-add-an-inventory-icon-to-an-existing-item-that-doesnt-have-one/#findComment-1721443 Share on other sites More sharing options...
Haruhi Kawaii Posted June 9, 2024 Share Posted June 9, 2024 14 hours ago, Lugon said: Sorry, I'm not sure what you mean by 'despawn your character' here. I tried adding this to my modmain and it just made it invisible when it's in my inventory I also tried using a custem item's xml there and different image names to test it but nothing worked for me. This is what it looks like right now: Sorry if I'm being dumb also, I'm very new to modding and I really appreciate the help. Hm... I checked but don't really know how to fix it but I have this, choose 1 of the 4 icons in this zip file and change it to cursed_monkey_token RegisterInventoryItemAtlas(GLOBAL.resolvefilepath("images/inventoryimages/namehere.xml"), "cursed_monkey_token.tex") cursed_beads.zip 1 Link to comment https://forums.kleientertainment.com/forums/topic/156554-trying-to-add-an-inventory-icon-to-an-existing-item-that-doesnt-have-one/#findComment-1721847 Share on other sites More sharing options...
Lugon Posted June 9, 2024 Author Share Posted June 9, 2024 7 hours ago, Haruhi Kawaii said: Hm... I checked but don't really know how to fix it but I have this, choose 1 of the 4 icons in this zip file and change it to cursed_monkey_token RegisterInventoryItemAtlas(GLOBAL.resolvefilepath("images/inventoryimages/namehere.xml"), "cursed_monkey_token.tex") cursed_beads.zip 15.04 kB · 0 downloads Can't get it to work I guess I'll just make a new item with the attributes I want and replace the in-game trinket with my new one... But thanks for all the help! Link to comment https://forums.kleientertainment.com/forums/topic/156554-trying-to-add-an-inventory-icon-to-an-existing-item-that-doesnt-have-one/#findComment-1722068 Share on other sites More sharing options...
Haruhi Kawaii Posted June 10, 2024 Share Posted June 10, 2024 14 hours ago, Lugon said: Can't get it to work I guess I'll just make a new item with the attributes I want and replace the in-game trinket with my new one... But thanks for all the help! It seems it still works test.zip 1 Link to comment https://forums.kleientertainment.com/forums/topic/156554-trying-to-add-an-inventory-icon-to-an-existing-item-that-doesnt-have-one/#findComment-1722410 Share on other sites More sharing options...
ClumsyPenny Posted June 10, 2024 Share Posted June 10, 2024 On 6/8/2024 at 4:44 PM, Lugon said: This is what it looks like right now: Wherever you use the Accursed Trinket as an ingredient, write it like this: Ingredient("cursed_monkey_token", 1, nil, nil, "cursed_beads4.tex") 1 Link to comment https://forums.kleientertainment.com/forums/topic/156554-trying-to-add-an-inventory-icon-to-an-existing-item-that-doesnt-have-one/#findComment-1722593 Share on other sites More sharing options...
Lugon Posted June 10, 2024 Author Share Posted June 10, 2024 11 hours ago, Haruhi Kawaii said: It seems it still works test.zip 6.08 kB · 0 downloads Bro theres no way... when I tried RegisterInventoryAtlas before all of it was just returning blank, but after looking at yours I managed to figure that it turns out it was just the image I was using for the tex file that for some reason wasn't valid?? So I just remade the image the exact same way I did before but this time it works everywhere... 1 hour ago, ClumsyPenny said: Wherever you use the Accursed Trinket as an ingredient, write it like this: Ingredient("cursed_monkey_token", 1, nil, nil, "cursed_beads4.tex") Omg I ALSO tried this and failed before because I just used Ingredient("cursed_monkey_token", 1, "cursed_beads4.tex"). That's what I get for not knowing proper syntax lmao But all issues seem to be resolved now! Thanks for the help guys Link to comment https://forums.kleientertainment.com/forums/topic/156554-trying-to-add-an-inventory-icon-to-an-existing-item-that-doesnt-have-one/#findComment-1722643 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