Jump to content

How would I add a new offering recipe?


Recommended Posts

How could I add a new recipe to the offering_recipe table in sacred_chest.lua? And where would I place this piece of code?

I've tried this so far

AddPrefabPostInit("sacred_chest", function(inst)
    local offering_recipe = {
    myitem_blueprint            = { "nightmare_timepiece", "rabbit", "nightmarefuel", "petals", "berries", "carrot" },
    ruinsrelic_plate_blueprint        = { "nightmare_timepiece", "cutstone", "nightmarefuel", "petals", "berries", "carrot" },
    ruinsrelic_chipbowl_blueprint    = { "nightmare_timepiece", "cutstone", "nightmarefuel", "carrot", "berries", "petals" },
    ruinsrelic_bowl_blueprint        = { "nightmare_timepiece", "cutstone", "nightmarefuel", "rabbit", "carrot", "petals" },
    ruinsrelic_vase_blueprint        = { "nightmare_timepiece", "cutstone", "nightmarefuel", "redgem", "butterfly", "petals" },
    ruinsrelic_chair_blueprint        = { "nightmare_timepiece", "cutstone", "nightmarefuel", "purplegem", "rabbit", "petals"},
    ruinsrelic_table_blueprint        = { "nightmare_timepiece", "cutstone", "nightmarefuel", "purplegem", "crow", "rabbit" },
}
    inst.offering_recipe = offering_recipe

end)

 

Link to comment
Share on other sites

AddPrefabPostInit and its siblings can only be put into your modmain.lua

You cannot change local variables in a prefab or component (unless you employ the Upvalue Hacker, which should be your very last resort).

That said, I can't find any good entry points. Everything in sacred_chest is local, and the functions aren't hooked up to any components we can access, so I think you may have to use Upvalue Hacker to do this. I have no experience with that.

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...