tesfan1999 Posted November 18, 2017 Share Posted November 18, 2017 I'm trying to make a chest. Whenever you place an item in it, it will wait one day and then add one more of the same item to the container. I can do the time part, thanks to my last thread, but how do i set up the container script? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted November 18, 2017 Share Posted November 18, 2017 This is how I would do it. Scriptname SomeScript Extends ObjectReference Bool UpdateRegistered = false FormList Property ListOfAddedForms Auto Float Property TimeToWait Auto Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) If !(ListOfAddedForms.HasForm(akBaseItem)) ListOfAddedForms.AddForm(akBaseItem) EndIf If UpdateRegistered == false RegisterForSingleUpdateGameTime(TimeToWait) UpdateRegistered = true EndIf EndEvent Event OnUpdateGameTime() Self.AddItem(ListOfAddedForms,1) UpdateRegistered = false ListOfAddedForms.Revert() EndEvent I would start out with an empty formlist and add items placed in the container to that formlist. The first item added would cause the script to register for a game time update. Any items added during the current update registration would be added to the formlist. Then when the update kicks in, add one of every item on the formlist, reset ability to register for an update and revert the formlist to an empty state. Link to comment Share on other sites More sharing options...
foamyesque Posted November 18, 2017 Share Posted November 18, 2017 There's no need for the HasForm conditional check. FormLists can't contain duplicate forms, so AddForm itself already does that check for you. Link to comment Share on other sites More sharing options...
Recommended Posts