Jump to content

Recommended Posts

The idea is that by clicking on one item on the cookpot, the cooking of a certain dish is started.
Here is the component code that I used, but so far it only cooks, mumbles, or crashes:

local quick_snacks_item = Class(function(self, inst)
    self.inst = inst
    self.repair_value = 1
end)

function quick_snacks_item:cook(target, doer)
--  target.components.container:GiveItem("tallbirdegg", 0)
    target.components.stewer:StartCooking(doer)
    if self.inst.components.stackable ~= nil then
    self.inst.components.stackable:Get(1):Remove()
    else
    self.inst:Remove()
    end
end

return quick_snacks_item

First I wanted the bacon and eggs to cook. Help if you can. Please.

    Okay, I solved the problem.

local quick_snacks_item = Class(function(self, inst)
    self.inst = inst
    self.repair_value = 1
end)

function quick_snacks_item:cook(target, doer)
    target.components.stewer:StartCooking(target)
    target.components.stewer.product = "baconeggs"
    if self.inst.components.stackable ~= nil then
    self.inst.components.stackable:Get(1):Remove()
    else
    self.inst:Remove()
    end
end

return quick_snacks_item

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