Jump to content

I need help creating a new food item.


Recommended Posts

I'm trying to create a new food item that can be cooked with the crockpot.

I am trying to build it off of the "Sample Prefab" but I am unsure how to make it into an item.

I know Lua scripting, but I am not the best.

 

TL;DR

I'm too dumb to figure out how to make the "Sample Prefab" or anything that i made in Spriter cookable with the crockpot.

Any help would be appreciated.

Thanks.

Link to comment
Share on other sites

If you would like to make a food item cookable you need to specify it in the prefab that you're making

inst:AddComponent("cookable")
inst.components.cookable.product = [REFERENCE TO PREFAB THAT IS THE RESULT OF COOKING]

Dunno if this helps, if you need some more info feel free to ask

Link to comment
Share on other sites

1 minute ago, ThatGourmand said:

If you would like to make a food item cookable you need to specify it in the prefab that you're making


inst:AddComponent("cookable")
inst.components.cookable.product = [REFERENCE TO PREFAB THAT IS THE RESULT OF COOKING]

Dunno if this helps, if you need some more info feel free to ask

What does "inst" mean, and does prefab mean "item"?

Link to comment
Share on other sites

Just now, ThatGourmand said:

"inst" is the instancte of the entity that you created to make your food item, and prefab is short for "prefabricated object" in which case is the mentioned food item

Oh, okay. How do I make a prefab? I tried using the "sampleprefab" template but it errors on start.

Link to comment
Share on other sites

Can you show me what you have so far, cause if you already made a food-item and you only want to make that item insertable into the crockpot you should add this line to your modmain.lua

AddIngredientValues({"custom_item_name",}, {tag1=1, tag2=2}) 

with your own item name (prefab name) and the tags you want your item to have

Link to comment
Share on other sites

Just now, ThatGourmand said:

Can you show me what you have so far, cause if you already made a food-item and you only want to make that item insertable into the crockpot you should add this line to your modmain.lua


AddIngredientValues({"custom_item_name",}, {tag1=1, tag2=2}) 

 

I attached all i have right now.

Please note that i did not create it.

 

chocolate.zip

Link to comment
Share on other sites

1 hour ago, ThatGourmand said:

I noticed that the chocolate.scml file doesn't realy display the chocolate img, so you kinda have to fix that still :-)

chocolate.zip 25.26 kB · 0 downloads

If some stuff seems unclear or you got other questions, ask away

Edit: I forgot to clearify that the zip that I send contains the code that you need ;p

i dont know what to do from this point on. how can i make this a recipe in the crockpot now?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...