Jump to content

Custom Recipe Tab and Items not showing


Recommended Posts

Hi, I'm new to coding and just can't figure it out what's wrong with my codes. I'm following tutorials and looking at others' codes and thankfully the game finally runs. However, in my codes, I have created a custom tab for my character to craft his own stuff and one craftable custom item. When the game runs, the tab didn't show up. And when I've tried to load the custom item using c_give function, the game recognized the name of the item (it showed up as one of the possible suggestion) but again, nothing shows up. Below are my codes:

For the modmain file I have:

image.thumb.png.88bea8b31be52d92564b465fe0c22b23.png

 

And for the item file body_replacement_S I have: (this item works like a honey poultice, which heals a character for 50 health)

image.thumb.png.d143482f80f02ce1456afb0eddbc9a24.png

Thank you.

Link to comment
Share on other sites

As said above, Physics part must be constructed before the SetPristine() and TheWorld.ismastersim check.
Any codes above those will be run both the client and the server. And for clients, will return(finish constructing) when they meet TheWorld.ismastersim. So commonly visible and interactive(tags mostly) part would be written there. MakeInventoryPhysics() is also one of them.
 

Also, it is recommended to rename your inventoryitem's texture and atlas name because "body_replacement_s" is not unique enough to be used in the mod which could possibly cause problems with other mods that has the same name of yours.
I thought it is some kind of body-changing skin or something, not Giorno's ability to make body part, at first.
Maybe "giornobody_replacement_s" would be enough.

Edited by YakumoYukari
Link to comment
Share on other sites

@Ultroman @YakumoYukari

Thank you! I have successfully loaded the item in the game now. But I still can't figure it out how to add a custom craft tab, nor how to add a recipe for my new item. With the craft tab, I've tried a few different methods that I've found on the forum but none of them seems to work.

Now I'm just focusing on the recipe first, trying to put it in an existing craft tab (survival tab for example), which I believe if this work, then I can just put into my character tab later (or at very least keep it in the survival tab so I can craft custom items when playing). But it just doesn't work like the tab.

Below are my codes for the recipe:

--the bizarre body replacement small
local giornobodyreplacements_recipe = AddRecipe("giornobodyreplacements",
{GLOBAL.Ingredient("goldnugget", 1), GLOBAL.Ingredient("cutstone", 3)},
GLOBAL.RECIPETABS.SURVIVAL, TECH.NONE, nil, nil, nil, nil, nil,
"images/inventoryimages/giornobodyreplacements.xml", "giornobodyreplacements.tex")
giornobodyreplacements_recipe.tagneeded = false
giornobodyreplacements_recipe.builder_tag = "giornobuilder"

 

OHHHHHH MY GOD yes I just figured out how to do the recipe!! I don't know what I've done but it works now!!! But I'm still trying to create a custom tab. I've tried both

giornotab = AddRecipeTab("Gold Experience", 999, "images/hud/giornotab.xml", "giornotab.tex", "giorno_builder")

and the method from this link

 

Ahhh never mind some sort of miracle just happened and I managed to make it work!! Thank you so much for your support!!

 

Edited by menghuancat
Link to comment
Share on other sites

I have no idea how to make custom tabs, but in my experience with other mods, the UI seems limited to only show the number of tabs available in the vanilla game, and that you have to scroll down in the list of tabs to find any extra tabs.

I hope someone else can help you with the tabs.

Link to comment
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
 Share

×
  • Create New...