starz82 Posted August 1, 2019 Share Posted August 1, 2019 Could anyone help me out with this cooking script? I'm a complete noob at this kind of thing but I'm trying to wrap my head around it. I've managed to get it working mostly how I want it, but there's a few things I can't get working properly. There's probably a few mistakes in the working script someone could correct I'm sure. The script is attached to a container. Here's what I have so far. ScriptName CookeryContainerScriptFloat TimerFloat AngleXFloat AngleYFloat AngleZRef PotRef FireRef FoodShort DoOnceShort IngredientsDoOnceShort ButtonShort BeefCountShort ChickenCountShort VenisonCountShort PotatoCountShort OnionCountShort CarrotCountBegin OnActivate If (IngredientsDoOnce == 0) MessageBox "What would you like to cook?", "Beef Stew", "Chicken Stew", "Venion Stew", "Open", "Pack Up", "Cancel" ElseIf (IngredientsDoOnce == 2) If (Timer >= 1) Message "There is already food cooking." EndIf EndIfEndBegin GameMode Set Button to GetButtonPressed Set Timer to Timer - GetSecondsPassed Set BeefCount to Player.GetItemCount Beef Set ChickenCount to Player.GetItemCount Chicken Set VenisonCount to Player.GetItemCount Venison Set PotatoCount to Player.GetItemCount Potato Set OnionCount to Player.GetItemCount Onion Set CarrotCount to Player.GetItemCount Carrot;PLACER If (DoOnce == 0) Set IngredientsDoOnce to 0 Set Fire to PlaceAtMe CookingFire 1, 0, 0 Fire.SetAngle X AngleX Fire.SetAngle Y AngleY Fire.SetAngle Z -100 Fire.SetAngle x -90 Fire.SetAngle y 0 Fire.SetAngle z 0 Fire.Enable Set DoOnce to 1 EndIf;COOKED If (IngredientsDoOnce == 2) If (Timer <= 1) Message "The food is now cooked." AddItem Food 1 Set IngredientsDoOnce to 0 EndIfEndif;RECIEVER If (IngredientsDoOnce == 1) Message "The food is cooking." Set Timer to 60 Set IngredientsDoOnce to 2 EndIf;INGREDIENTS If (IngredientsDoOnce == 0) If (Button == 0 && BeefCount > 0 && PotatoCount > 0 && OnionCount > 0 && CarrotCount > 0) Player.RemoveItem Beef 1 Player.RemoveItem Potato 1 Player.RemoveItem Onion 1 Player.RemoveItem Carrot 1 Set Food to BeefStew Set IngredientsDoOnce to 1 EndIf If (Button == 1 && ChickenCount > 0 && PotatoCount > 0 && OnionCount > 0 && CarrotCount > 0) Player.RemoveItem Chicken 1 Player.RemoveItem Potato 1 Player.RemoveItem Onion 1 Player.RemoveItem Carrot 1 Set Food to ChickenStew Set IngredientsDoOnce to 1 EndIf If (Button == 2 && VenisonCount > 0 && PotatoCount > 0 && OnionCount > 0 && CarrotCount > 0) Player.RemoveItem Venison 1 Player.RemoveItem Potato 1 Player.RemoveItem Onion 1 Player.RemoveItem Carrot 1 Set Food to VenisonStew Set IngredientsDoOnce to 1 EndIf If (Button == 3) Activate EndIf If (Button == 4) Set Pot to CookeryContainer Fire.Disable Pot.Disable Player.AddItem CookingGear 1 EndIf If (Button == 5) Return EndIf EndIfEnd If it's possible, I'd like to bypass the message box and open the container if there is cooked food already inside it. I've tried to do "ElseIf (IngredientsDoOnce == 3)" but it didn't work. Also, I'd like to add a ingredient check message. Such as "You do not have the correct ingredients". I've tried adding this to the end of the ingredients block with "else" but that didn't work either, it shows as soon as activate the container. I won't give up trying to work this out, but any help is greatly appreciated. Cheers. Link to comment Share on other sites More sharing options...
Striker879 Posted August 1, 2019 Share Posted August 1, 2019 (edited) Many of Emma's houses (e.g. Aleswell) have a cooking/ingredients script that may provide you with some helpful hints. Edit - Aleswell Cottage ver 4_1 Edited August 1, 2019 by Striker879 Link to comment Share on other sites More sharing options...
starz82 Posted August 1, 2019 Author Share Posted August 1, 2019 Great, I'll check it out. Cheers Link to comment Share on other sites More sharing options...
Recommended Posts