naptimeshadows Posted December 3, 2015 Share Posted December 3, 2015 Hello!I have figured out how to make custom items and their recipes, but I can't for the life of me figure out how to make my recipes go into their own tab. I've tried every method that comes up on Google to no avail. A good example of what I'm trying to do is the One Piece character Chopper, but mimicking that code crashes the game for me, even though I can play and craft as Chopper no problem. Another example of methods I've tried is what was discussed here: http://forums.kleientertainment.com/topic/47196-unable-to-add-custom-recipe-tab/ None of it works for me. Suggestions? Link to comment https://forums.kleientertainment.com/forums/topic/59845-custom-recipe-tab/ Share on other sites More sharing options...
Kzisor Posted December 3, 2015 Share Posted December 3, 2015 (edited) @naptimeshadows, custom recipe tabs have been made easier. Unless the mod is using AddRecipeTab in order to create their recipe tab they're doing it in an unsupported fashion. The API supported way to create a recipe tab is as followed. Simply replace RECIPETABS.X in your AddRecipe function with recipe_tab.local recipe_tab = AddRecipeTab( "custom_tab", -- Name of the tab to show the player. 999, -- Sort Order #, 999 will place it at the bottom of the list. "images/recipe_tab.xml", -- Atlas file associated with the image file. "recipe_tab.tex", -- Image (.tex) file with the extension. nil -- Builder Tag if one is needed, character must have this tag in order to see tab. ) Edited December 3, 2015 by Kzisor Link to comment https://forums.kleientertainment.com/forums/topic/59845-custom-recipe-tab/#findComment-691265 Share on other sites More sharing options...
naptimeshadows Posted December 3, 2015 Author Share Posted December 3, 2015 Fantastic!With that, what do I use to tie recipes to that tab?Is that what the builder tag is for? For example:local weapon_recipe = AddRecipe("swordcane",{GLOBAL.Ingredient("item", 1), GLOBAL.Ingredient("item", 3)}, [TAB?], TECH.NONE,nil, nil, nil, nil, nil,"images/inventoryimages/weapon.xml", "weapon.tex")swordcane_recipe.tagneeded = falseswordcane_recipe.builder_tag = "weapon_builder"swordcane_recipe.atlas = resolvefilepath("images/inventoryimages/weapon.xml") 1 Link to comment https://forums.kleientertainment.com/forums/topic/59845-custom-recipe-tab/#findComment-691279 Share on other sites More sharing options...
naptimeshadows Posted December 3, 2015 Author Share Posted December 3, 2015 I tried using the "recipe_tab" spot to tie in recipes, and it didn't work. I assume with no known recipes inside it, the tab won't show up?There's nothing there; the rest of the tab icons haven't even shifted to make room for another one. Link to comment https://forums.kleientertainment.com/forums/topic/59845-custom-recipe-tab/#findComment-691285 Share on other sites More sharing options...
Kzisor Posted December 3, 2015 Share Posted December 3, 2015 @naptimeshadows, sorry, please take another look at the code as it should be AddRecipeTab, not AddReciptTab. I've updated the previous code to reflect this. Link to comment https://forums.kleientertainment.com/forums/topic/59845-custom-recipe-tab/#findComment-691295 Share on other sites More sharing options...
naptimeshadows Posted December 3, 2015 Author Share Posted December 3, 2015 (edited) I saw that after the first few rounds of debugging.So, I'm still having issues. The tab isn't showing up, and after fixing things here and there to make sure everything is perfect, I'm getting a specific error. Exact code and error are as follows:(I can't figure out how to do the script box like you did, lol.) local soldier_tab = AddRecipeTab( "Soldiering", -- Name of the tab to show the player. 999, -- Sort Order #, 999 will place it at the bottom of the list. "images/soldiertab.xml", -- Atlas file associated with the image file. "soldiertab", -- Image (.tex) file without the extension. "soldier_builder" -- Builder Tag if one is needed, character must have this tag in order to see tab. ) local swordcane_recipe = AddRecipe("swordcane",{GLOBAL.Ingredient("cane", 1), GLOBAL.Ingredient("nightmarefuel", 3)}, soldier_tab, TECH.NONE,nil, nil, nil, nil, nil,"images/inventoryimages/swordcane.xml", "swordcane.tex")swordcane_recipe.tagneeded = trueswordcane_recipe.builder_tag = "soldier_builder"swordcane_recipe.atlas = resolvefilepath("images/inventoryimages/swordcane.xml") Character has:inst:AddTag("soldier_builder") Line 41 is:"Soldiering", -- Name of the tab to show the player. Any idea what I need to do from here? Edited December 3, 2015 by naptimeshadows Link to comment https://forums.kleientertainment.com/forums/topic/59845-custom-recipe-tab/#findComment-691312 Share on other sites More sharing options...
Kzisor Posted December 3, 2015 Share Posted December 3, 2015 (edited) @naptimeshadows, looks like you have a rouge character in the file. Create a new file and copy the contents of the old file to the new file and delete the old file. Save the new file, DO NOT OVERWRITE IT AS IT COULD CAUSE THE ISSUE AGAIN. Note:You could also remove the information and the double dashes (--) as those are comments. Also make sure to put AddRecipeTab all on a single line. Edited December 3, 2015 by Kzisor Link to comment https://forums.kleientertainment.com/forums/topic/59845-custom-recipe-tab/#findComment-691318 Share on other sites More sharing options...
naptimeshadows Posted December 3, 2015 Author Share Posted December 3, 2015 (edited) I did that, and it definitely did not have the same effect. Putting it all on one line in a fresh .lua with no excess text gives me the below issue.The window isn't crashing, it resizes and scales like it's supposed to.Just no game content.The HUD is unresponsive.This is the only mod running.This happened every time I entered a world. EDIT:: I entered a world with other mods, and it looks like the recipe tabs for other custom characters are showing up, even though they absolutely shouldn't be. Picture added. Edited December 3, 2015 by naptimeshadows Link to comment https://forums.kleientertainment.com/forums/topic/59845-custom-recipe-tab/#findComment-691336 Share on other sites More sharing options...
Kzisor Posted December 3, 2015 Share Posted December 3, 2015 @naptimeshadows, Find the log.txt file under documents/klei/DontStarveTogether and post it here so we can help you further. I cannot tell you for sure why it's not showing up, but it more than likely has to do with the images/atlas file not being loaded. Note:Your recipe does not need tagneeded or builder_tag and the atlas is already set in the AddRecipe function. The 5th nil in your AddRecipe function call is the builder_tag variable, simply change nil to "soldier_builder" and it will be set. Link to comment https://forums.kleientertainment.com/forums/topic/59845-custom-recipe-tab/#findComment-691367 Share on other sites More sharing options...
naptimeshadows Posted December 3, 2015 Author Share Posted December 3, 2015 I don't think it's an issue with the atlas, since before I ever tried making it a recipe, I made it a starting item, and it worked perfectly. I deleted the extra lines and it happened again.Before re-running, I cleared the log, so the entries should just be about this one instance.log.txt Link to comment https://forums.kleientertainment.com/forums/topic/59845-custom-recipe-tab/#findComment-691644 Share on other sites More sharing options...
Kzisor Posted December 3, 2015 Share Posted December 3, 2015 (edited) @naptimeshadows, Error from log file: [string "scripts/util.lua"]:423: Could not find an asset matching images/soldiertab.xml in any of the search paths. This error indicates it's an issue with the atlas file for the soldier tab. Make sure it's in the location you specified. Note: Did you remember to import it into the Assets table via:Assets = { Asset("ATLAS", "images/soldiertab.xml"), Asset("IMAGE", "images/soldiertab.tex"), -- ETC FOR ALL IMAGES AND ATLAS FILES.} Edited December 3, 2015 by Kzisor Link to comment https://forums.kleientertainment.com/forums/topic/59845-custom-recipe-tab/#findComment-691697 Share on other sites More sharing options...
naptimeshadows Posted December 3, 2015 Author Share Posted December 3, 2015 Ohhhhhh.I just assumed it would query the hud folder.Well, I tried both using the hud folder as a source as well as moving the file to the images folder, and both times I get the following issue.I checked the .xml itself, and there was no mention of those pieces.Sadly, I once again have no idea what to change, since the error seems to be referencing the DST files, not my mod.Unless those things were supposed to be generated in the .xml and weren't? Link to comment https://forums.kleientertainment.com/forums/topic/59845-custom-recipe-tab/#findComment-691730 Share on other sites More sharing options...
Kzisor Posted December 3, 2015 Share Posted December 3, 2015 Sadly, I once again have no idea what to change, since the error seems to be referencing the DST files, not my mod. The reason it's referencing the DST files is because the error is being 'generated' by the DST file when it's trying to load your atlas file. Put your mod in a zip file and upload it to the forums. That is the only way I will be able to assist you further. Link to comment https://forums.kleientertainment.com/forums/topic/59845-custom-recipe-tab/#findComment-691742 Share on other sites More sharing options...
naptimeshadows Posted December 3, 2015 Author Share Posted December 3, 2015 (edited) OOHHHHH I GOT IT TO WORK! I added .tex to the Add Tab piece you sent me, and it shows up perfectly! Thank you! local soldier_tab = AddRecipeTab("Soldiering", 999, "images/soldiertab.xml", "soldiertab.tex", "soldier_builder") Edited December 3, 2015 by naptimeshadows Link to comment https://forums.kleientertainment.com/forums/topic/59845-custom-recipe-tab/#findComment-691743 Share on other sites More sharing options...
Kzisor Posted December 3, 2015 Share Posted December 3, 2015 (edited) @naptimeshadows, glad that you were able to get it solved. Updated the original code to reflect the resolution. Edited December 3, 2015 by Kzisor Link to comment https://forums.kleientertainment.com/forums/topic/59845-custom-recipe-tab/#findComment-691757 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