menghuancat Posted February 6, 2019 Share Posted February 6, 2019 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: And for the item file body_replacement_S I have: (this item works like a honey poultice, which heals a character for 50 health) Thank you. Link to comment Share on other sites More sharing options...
Ultroman Posted February 6, 2019 Share Posted February 6, 2019 (edited) MakeInventoryPhysics, inst.AnimState's, tags (if any) and sounds (if any) should be set above your mastersim check. Edited February 6, 2019 by Ultroman Link to comment Share on other sites More sharing options...
YakumoYukari Posted February 7, 2019 Share Posted February 7, 2019 (edited) 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 April 4, 2019 by YakumoYukari Link to comment Share on other sites More sharing options...
Ultroman Posted February 7, 2019 Share Posted February 7, 2019 34 minutes ago, YakumoYukari said: As said above, Physics set must be constructed before the SetPristine() and TheWorld.ismastersim check. I did not know that they also HAD to be above SetPristine. Thanks for the correction Link to comment Share on other sites More sharing options...
YakumoYukari Posted February 7, 2019 Share Posted February 7, 2019 (edited) That section is where prefabs get 'replicated' on clients. So SetPristine() and ismastersim check will eventually show up together. Edited April 4, 2019 by YakumoYukari Link to comment Share on other sites More sharing options...
menghuancat Posted February 7, 2019 Author Share Posted February 7, 2019 (edited) @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 February 7, 2019 by menghuancat Link to comment Share on other sites More sharing options...
Ultroman Posted February 7, 2019 Share Posted February 7, 2019 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 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