Sign in to follow this  
IHasRoadRage

How do I change crafting recipes

Recommended Posts

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!

Share this post


Link to post
Share on other sites
rons0n    124

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

Share this post


Link to post
Share on other sites

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 by IHasRoadRage

Share this post


Link to post
Share on other sites
Aquaterion    821

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.

Share this post


Link to post
Share on other sites
Ricoom    15

Using Recipe() from mod is deprecated and should not be used. use AddRecipe() instead. its basically all same..

Edited by Ricoom

Share this post


Link to post
Share on other sites
Mai_Tai    0

Hello. Can someone explain how this works?
image.thumb.png.e250b17ec364b08077783f596b317502.png

The changes didn't work at the same time, but if I change only one item everything works fine.

Edited by Mai_Tai

Share this post


Link to post
Share on other sites
-t-    111

Not really sure what's the problem here. I've put this code in my modmain.lua and both recipes changed.

Share this post


Link to post
Share on other sites
Mai_Tai    0

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.

Share this post


Link to post
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
Sign in to follow this