Zorkaz Posted September 17, 2022 Share Posted September 17, 2022 Vending Machine:I want to have a bunch of items in a formlist (All variants of Nuka Cola)When a container is activated in which various Nuka Colas, Quantums and cold variants reside one of them gets removed and replaced with caps. Now I already made a script like this Event OnActivate (ObjectReference AkActionRef) If Self.getitemcount (NukaColaQuantum_Cold) > 0 Self.removeitem (NukaColaQuantum_Cold) TheValue = NukaColaQuantum_Cold.getgoldvalue() Self.additem (Caps001, TheValue) Elseif Self.getitemcount (NukaColaQuantum) > 0 Self.removeitem (NukaColaQuantum) TheValue = NukaColaQuantum.getgoldvalue() Self.additem (Caps001, TheValue) Endif EndEventBut I actually find this inefficient. I think I can put the Colas in a formlist.But how do i determine which object has been removed so I can get its gold value? Link to comment Share on other sites More sharing options...
Zorkaz Posted September 17, 2022 Author Share Posted September 17, 2022 Okay instead of removing the cola, maybe I'll send it to a dummy container.Using EventOnItemAdded() i could then determine the value.But maybe there's another idea Link to comment Share on other sites More sharing options...
niston Posted September 17, 2022 Share Posted September 17, 2022 How about keeping item counts and compare before/after? Difference in counts will be what's been taken from the container. Link to comment Share on other sites More sharing options...
LarannKiar Posted September 18, 2022 Share Posted September 18, 2022 Why not attach a script to the vending machine and add the event OnItemRemoved() to it, then akBaseItem.GetGoldValue(). Link to comment Share on other sites More sharing options...
Recommended Posts