Jump to content

How to create a new recipe tab + new recipes?


Recommended Posts

hey there, two days ago i started working on my first mod. thanks to the awesome turorials i figured out how to customize my first character, thanks to some digging through some existing mods i found out how to change some values and add the exact sanity regeneration i want (working on a maxwell like character) 

also i made my first hand equipable item thanks to the existing tutorial, and by a bit trying around i figured out how to make it to a weapon with the damange numbers range and uses i wanted. (havent figured out how to have it able to be repairable yet but i guess i will get there)

now i would like some help on how to add specific character recipe tab, also with adding recipes for the new items that i modded. i looked for tutorials in that matter, but i haven found any. so if anyone could be so nice to help me out, i would be very very happy. 
i do have questions to some much more complicated mod matters too, but first things first, let us get done with this one first :)

 

sorry for any spelling and/or grammar mistakes. english is not my mothertongue! 

anyone reading this, have a nice day 

:)

Link to comment
Share on other sites

eh its a bit messy(then again when is coding not messy?) but it needs both the character lua file and modmain lua so I'll start with the modmain:

Assets = {--reference

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

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

local TECH = GLOBAL.TECH
local customtab = AddRecipeTab ("titleofthetab", 998, "images/hud/customtab .xml", "customtab .tex", "tagofthecharacter" )


local somecustomitem = Ingredient( "somecustomitem ", 1 )
somecustomitem .atlas = "images/inventoryimages/somecustomitem .xml"
local anothercustomitem_recipe = AddRecipe("anothercustomitem", { Ingredient("goldnugget", 25), Ingredient("nightmarefuel", 10), somecustomitem }, customtab , TECH.MAGIC_THREE, nil, nil, nil, nil, "tagofthecharacter", "images/inventoryimages/anothercustomitem.xml")

for the character lua file:

local common_postinit = function(inst) --reference on where it goes
    inst:AddTag("tagofthecharacter")

Hopefully you can make out whats going on in the code as I'm a bit busy for the next 24 hours so if you have questions I won't respond for a while(hope I didn't miss something).

Edited by K1NGT1GER609
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...