Jump to content

How to make a character know how to craft a specific recipe from the start?


Recommended Posts

For my character, she will be able to know how to craft an alchemy engine from the start of the world. How would I make this happen? I am fine with her already having the recipe unlocked or spawning with an alchemy engine blueprint.

Link to comment
Share on other sites

I don't know if its possible to make it but you can try to give her a special crafting tab. for that.

 

Asset("ATLAS", "images/hud/crafttab.xml"),

in modmain you will see assets put that there. you will need a folder in images named "hud" and in that you need a picture for your special craft tab.

after assets put that in modmain.lua

local Ingredient = GLOBAL.Ingredient
local RECIPETABS = GLOBAL.RECIPETABS
local Recipe = GLOBAL.Recipe
local TECH = GLOBAL.TECH
craftab = AddRecipeTab("charactername", 998, "images/hud/craftab.xml", "craftab.tex", "chractername_builder")

after "local"

after craftab

local Special_Alch_mac_recipe = AddRecipe("Special_Alch_mac",
  {Ingredient("crafting_item1", amount), Ingredient("crafting_item2", amount),...}
  crafttab, TECH.NONE
  nil, nil, nil, 1, nil,
  Special_Alch_mac_recipe.tagneeded = false
  Special_Alch_mac_recipe.builder.tag = "charactername_builder"
  Special_Alch_mac_ recipe.atlas = resolvefilepath(alchemy machine file path)

 

 

lemme know if it not work.

Link to comment
Share on other sites

13 hours ago, AkaiNight said:

I don't know if its possible to make it but you can try to give her a special crafting tab. for that.

 


Asset("ATLAS", "images/hud/crafttab.xml"),

in modmain you will see assets put that there. you will need a folder in images named "hud" and in that you need a picture for your special craft tab.

after assets put that in modmain.lua


local Ingredient = GLOBAL.Ingredient
local RECIPETABS = GLOBAL.RECIPETABS
local Recipe = GLOBAL.Recipe
local TECH = GLOBAL.TECH

craftab = AddRecipeTab("charactername", 998, "images/hud/craftab.xml", "craftab.tex", "chractername_builder")

after "local"

after craftab


local Special_Alch_mac_recipe = AddRecipe("Special_Alch_mac",
  {Ingredient("crafting_item1", amount), Ingredient("crafting_item2", amount),...}
  crafttab, TECH.NONE
  nil, nil, nil, 1, nil,
  Special_Alch_mac_recipe.tagneeded = false
  Special_Alch_mac_recipe.builder.tag = "charactername_builder"
  Special_Alch_mac_ recipe.atlas = resolvefilepath(alchemy machine file path)

 

 

lemme know if it not work.

I don't think I am willing to create an entirely new crafting recipe for an item that already has a recipe (especially since I have better plans for a custom crafting tab), however I could consider resorting to this of I need to, depending on if I decide not to scrap this feature.

Link to comment
Share on other sites

If you want to have the blueprint, just add "researchlab2_blueprint" to the starting inventory.

If you want the character to know the recipe, add inst.components.builder:AddRecipe("researchlab2") to your master postinit. If it doesn't work like this, you may need to do it with a delay with DoTaskInTime.

  • Like 1
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...