Jump to content

[LE] Item multiplier container


tesfan1999

Recommended Posts

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...