lee3310 Posted February 16, 2023 Share Posted February 16, 2023 (edited) You are using the on activation event if you want a function, you will have to create one outside of the even Function myFunction()..EndFunction Event myFunction()...EndEvent Edited February 16, 2023 by lee3310 Link to comment Share on other sites More sharing options...
RaidersClamoring Posted February 16, 2023 Share Posted February 16, 2023 How would I write that without getting things likeFridge is not a function etcor cannot pass container to an objectreference etc Since the script is attached to the Fridge it's as simple as adding "self" as the last parameter. Game.GetPlayer().RemoveItem(WarmDrinks, Insert, false, self) Link to comment Share on other sites More sharing options...
SoulMasterFinnigan Posted February 16, 2023 Author Share Posted February 16, 2023 The Script wasn't attached to the fridge, I had a fridge container in a seperate cell , the script was attached to an activator , I ended up doing it the long way round writing huge if statementssince NukaMix has the Most it worked to me writing If (Game.GetPlayer().GetItemCount(Mix1) < Trade); Player Doesn't have A Warm DrinkDebug.Notification("You Need A Warm One")ElseIf (selectedOption == 0) ; Newka Cola ColdGame.GetPlayer().AddItem(Cold1); Newka Cola ColdEndIf Like 17 times lolThe Plan Was to have 1 fridge where it would remove the warm variant and give me the cold of selected variantHowever since a message can Only hold 19 slots i have had to split the messages over 4 different activatorsBeerVimNukaNuka Mix I do have a message to act as a main menu with the 4 slots , but I would know how to.Select Beer , Beer Message Shows , make selection of Drink or Go Back to Main Menu Link to comment Share on other sites More sharing options...
Fantafaust Posted February 17, 2023 Share Posted February 17, 2023 Personally I would make a container that replaces warm versions with cold versions after you close it, you'd just have to use two arrays and some very minor scripting to make it work Link to comment Share on other sites More sharing options...
SoulMasterFinnigan Posted February 17, 2023 Author Share Posted February 17, 2023 How would that look ? Link to comment Share on other sites More sharing options...
lee3310 Posted February 17, 2023 Share Posted February 17, 2023 Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) If (akNewContainer == PlayerRef) RegisterForMenuOpenCloseEvent("ContainerMenu") endif EndEvent Event OnMenuOpenCloseEvent(string asMenuName, bool abOpening) If (asMenuName == "ContainerMenu" && abOpening == False) UnregisterForMenuOpenCloseEvent("ContainerMenu") EndIf EndEvent You will need those two events Link to comment Share on other sites More sharing options...
SoulMasterFinnigan Posted February 17, 2023 Author Share Posted February 17, 2023 Thank youIts compiled , I will sort out its details tomorrow Link to comment Share on other sites More sharing options...
RaidersClamoring Posted February 17, 2023 Share Posted February 17, 2023 About script not being attached to fridge: surely you will capture the ref of the fridge at some point if not directly as a property in CK? So replace self with that reference. It is possible to create persistent refs in CK if placed in a cell (and perhaps in other ways too). Link to comment Share on other sites More sharing options...
SoulMasterFinnigan Posted February 17, 2023 Author Share Posted February 17, 2023 The fridge container is in a seperate cell that i have called storagecell. the fridge activator is in the player home cells At the moment to get the desired function i have spread out around each homeA Gwinnett poster for getting cold beerA nuka clock for getting cold standard nukaA nuka flag for the nuka mixesand a Vim poster for vim. And put them as trading in warm variants will give you a cold, my player homes are somewhat different sizes so have to think outside the box lol Link to comment Share on other sites More sharing options...
SoulMasterFinnigan Posted February 17, 2023 Author Share Posted February 17, 2023 Anyone know what i should be ending this withThe script works but i am not sure how to set the teleport marker as a location? Event OnActivate(ObjectReference akActionRef)int selectedOption = BuyAPet.Show()If (selectedOption == 1) ; CancelreturnEndIfIf (Game.GetPlayer().GetItemCount(Caps001) < CostToBuy) ; Player doesn't have enough capsDebug.Notification("You need more Caps")returnEndIfGame.GetPlayer().RemoveItem(Caps001, CostToBuy) If (SelectedOption==0);TelePortIn.Cast(Cat)EndIfEndEvent Link to comment Share on other sites More sharing options...
Recommended Posts