Jump to content

Recommended Posts

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.

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

 

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.

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"})

 

  • Like 1
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.

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)

 

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:

JnLMZJa1.png.3f202d8856f5f6511a503398718255b2.png

 

Sorry if I'm being dumb also, I'm very new to modding and I really appreciate the help.

Edited by Lugon
typo
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:

JnLMZJa1.png.3f202d8856f5f6511a503398718255b2.png

 

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

  • Thanks 1
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 :wilson_cry:

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!

14 hours ago, Lugon said:

Can't get it to work :wilson_cry:

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

  • Thanks 1
On 6/8/2024 at 4:44 PM, Lugon said:

This is what it looks like right now:

JnLMZJa1.png.3f202d8856f5f6511a503398718255b2.png

Wherever you use the Accursed Trinket as an ingredient, write it like this:

Ingredient("cursed_monkey_token", 1, nil, nil, "cursed_beads4.tex")

 

  • Like 1
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... :wilson_worried:

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

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
×
  • Create New...