IHasRoadRage Posted December 20, 2017 Share Posted December 20, 2017 So I was thinking of making a mod that makes crafting recipes harder to add a little challenge but I cannot figure out how I would go about doing this. My problem is that I cannot figure out how I would change the crafting recipes of items. For an example I was thinking of changing the lightning rod recipe to... 2x Gold nuggets - 1x Cut stone - 1x Volt goat horn. If someone could post how I would code this then I could figure out how I would do this then I can start making it. Much thanks! Link to comment Share on other sites More sharing options...
rons0n Posted December 20, 2017 Share Posted December 20, 2017 Well if you're fine with changing each individual recipe: Quote STRINGS = GLOBAL.STRINGS RECIPETABS = GLOBAL.RECIPETABS Recipe = GLOBAL.Recipe Ingredient = GLOBAL.Ingredient TECH = GLOBAL.TECH Recipe("researchlab", {Ingredient("log", 6),Ingredient("nitre", 4),Ingredient("goldnugget", 4),Ingredient("silk", 2)}, RECIPETABS.SCIENCE, TECH.NONE, "researchlab_placer") Is an example. This applies to all characters Link to comment Share on other sites More sharing options...
IHasRoadRage Posted December 24, 2017 Author Share Posted December 24, 2017 Fantastic, thank you! This works great and I am extremely thankful. Would you like to be credited on the mod page when its released for helping me greatly with the code? Link to comment Share on other sites More sharing options...
rons0n Posted December 24, 2017 Share Posted December 24, 2017 Its fine you don't have to. Just glad you got what you needed. Link to comment Share on other sites More sharing options...
IHasRoadRage Posted December 30, 2017 Author Share Posted December 30, 2017 (edited) Okay so I have an issue with it. When in the game, the recipes I edit will not need a science machine or alchemy engine to craft. I assumed that it was TECH.NONE that I had to change but I tried everything I could think of, I also downloaded other mods to see what they did. Nothing has worked and I really need to know how to change this. Another issue is that I cannot get items from crafting non-structures. I am sorry that I couldn't figure this out for myself like I thought I could. Thank you! Edited December 31, 2017 by IHasRoadRage Link to comment Share on other sites More sharing options...
. . . Posted December 30, 2017 Share Posted December 30, 2017 Instead of NONE you can use "SCIENCE_TWO" for alchemy engine craft, or "SCIENCE_ONE" for science machine craft Link to comment Share on other sites More sharing options...
IHasRoadRage Posted December 30, 2017 Author Share Posted December 30, 2017 Great it works thank you! Man I had such a headache of this thank you for helping me out! Link to comment Share on other sites More sharing options...
Aquaterion Posted December 30, 2017 Share Posted December 30, 2017 While this is not required, I would suggest going into scripts/recipes.lua. It has the list of all the recipes, which you can copy any recipe you want to change into modmain.lua and then adjust it. This is all to make sure you don't mistakenly change values that you didn't mean to change. Link to comment Share on other sites More sharing options...
Ricoom Posted December 30, 2017 Share Posted December 30, 2017 (edited) Using Recipe() from mod is deprecated and should not be used. use AddRecipe() instead. its basically all same.. Edited December 30, 2017 by Ricoom Link to comment Share on other sites More sharing options...
IHasRoadRage Posted December 31, 2017 Author Share Posted December 31, 2017 Thank you both! This should make it a lot easier to write the code and speed it up a lot. Link to comment Share on other sites More sharing options...
Mai_Tai Posted July 17, 2020 Share Posted July 17, 2020 (edited) Hello. Can someone explain how this works? The changes didn't work at the same time, but if I change only one item everything works fine. Edited July 17, 2020 by Mai_Tai Link to comment Share on other sites More sharing options...
-LukaS- Posted July 17, 2020 Share Posted July 17, 2020 Not really sure what's the problem here. I've put this code in my modmain.lua and both recipes changed. 1 Link to comment Share on other sites More sharing options...
Mai_Tai Posted July 17, 2020 Share Posted July 17, 2020 Thx) Well... It's kinda strange. I rewrite code and now it works. I don't understand what was the problem. it's not good, i guess. Link to comment Share on other sites More sharing options...
Hungry French Posted August 27, 2023 Share Posted August 27, 2023 On 12/20/2017 at 6:38 PM, rons0n said: Well if you're fine with changing each individual recipe: Is an example. This applies to all characters Respect. Now I can change the craft of the thulecite crown, cat cap and beefalo hat 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