Jump to content

One recipe = multiple item


Recommended Posts

Hello,

 

I would like to make a "easy" version of the recipe giving 2 item instead of 1. I find how to configure (and have so the "easy" and "normal" choice), but don't know how to have the "2 item" part.

 

How could i make this ? I try a search or looking for a mod doing this but can't found it.

 

Thank you :-)

Link to comment
Share on other sites

Change the last number to customize the amount. 

local your_item = GLOBAL.Recipe("item_name", {Ingredient("ingredient_name", amount)},RECIPETABS.Your_tab, TECH.Your_tech, nil, nil, nil, 2)
Edited by CremeLover
Link to comment
Share on other sites

Like how ? This ?

 

 

local STRINGS = GLOBAL.STRINGS
local RECIPETABS = GLOBAL.RECIPETABS
local Ingredient = GLOBAL.Ingredient
local TECH = GLOBAL.TECH

STRINGS.RECIPE_DESC.GEARS = "A complex mechanism."
    
    

local easy = (GetModConfigData("gearsrecipe")=="easy")
local normal = (GetModConfigData("gearsrecipe")=="normal")


if easy then
local gearsrecipe = AddRecipe( "gears",  {Ingredient("steelwool", 1), Ingredient("transistor", 1), Ingredient("purplegem", 1) }, RECIPETABS.SCIENCE, TECH.SCIENCE_TWO, nil, nil, nil, 2)

else if normal then
local gearsrecipe = AddRecipe( "gears",  {Ingredient("steelwool", 1), Ingredient("transistor", 1), Ingredient("purplegem", 1) }, RECIPETABS.SCIENCE, TECH.SCIENCE_TWO)

else
local gearsrecipe = AddRecipe( "gears",  {Ingredient("steelwool", 2), Ingredient("transistor", 2), Ingredient("purplegem", 1) }, RECIPETABS.SCIENCE, TECH.SCIENCE_TWO)
    end
end

 

Link to comment
Share on other sites

@Lumina, the following is an exampel:

local example = AddRecipe("example_item", {Ingredient("example_ingredient", 2)},RECIPETABS.TOWN, TECH.NONE, nil, nil, nil, 4,  -- amount to return to buildernil, -- builder tag"images/inventoryimages/example.xml",  --atlas file"example.tex" -- image file)
Edited by Kzisor
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...