Jump to content

Recommended Posts

Hi! So I'm working on a joke mod for my friends thats just an evil martini, and I used this thread plus the preparedfoods/preparedfood_warly files in scripts to setup my recipe. (The recipe code itself goes in scripts btw; it crashes the game if it's in your modmain.lua) 

local spookydrink_recipe = {
		name = "Nightmartini",
		test = function(cooker, names, tags) return names.nightmarefuel and names.nightmarefuel == 2 and (names.pomegranate or names.pomegranate_cooked or names.dragonfruit or names.dragonfruit_cooked == 1) and names.ice == 1 end,
		priority = 30,
		foodtype = FOODTYPE.GOODIES,
		health = -TUNING.HEALING_SMALL,
		hunger = TUNING.CALORIES_SMALL,
		perishtime = TUNING.PERISH_MED,
		sanity = -TUNING.SANITY_LARGE,
		cooktime = .5,
card_def = {ingredients = {{"nightmarefuel", 2}, {"dragonfruit", 1}, {"ice", 1}} },
		tags = {"unsafefood"},
	}

The problem is that the recipe doesn't work. Using the ingredients given in the recipe don't produce the item. (ex. mine produces either wet goop or dragonpie depending on the fruit used) The tags work but the stats (minus hunger) don't work as I had to re-add the stats of the food like this:

 inst:AddComponent("edible")
inst.components.edible.healthvalue = -TUNING.HEALING_SMALL
    inst.components.edible.hungervalue = TUNING.CALORIES_SMALL
    inst.components.edible.sanityvalue = -TUNING.SANITY_LARGE

Also line causes the game to crash upon opening the server, I tried moving it around to modmain.lua as well but it doesnt change much.

AddCookerRecipe("cookpot", your_dish_recipe)

Anyways, it could be because I haven't coded anything in ages and I'm still a novice, but help would be greatly appreicated! :)

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
×
  • Create New...