Talk:GetGiftFilter - ActorBase: Difference between revisions

Jump to navigation Jump to search
Blanked the page
imported>Sollar
(Created page with " == Script to Show Gift Window and Track Items Given == This is used for the Player to feed his animal companion. The FormList is created in the CK and includes all the food...")
 
imported>Sollar
(Blanked the page)
 
Line 1: Line 1:


== Script to Show Gift Window and Track Items Given ==
This is used for the Player to feed his animal companion.  The FormList is created in the CK and includes all the food (Potion & Ingredient) items I want to consider food for the animal.
<source lang="papyrus">
FormList Property FoodList Auto
Bool hasBeenFedToday = False
Function FeedCompanion()
ObjectReference foodItem = None
int indexPos = FoodList.GetSize()
While(indexPos > 0)
indexPos -= 1
foodItem = FoodList.GetAt(indexPos) as ObjectReference
AddInventoryEventFilter(foodItem)
EndWhile
Self.ShowGiftMenu(true, FoodList, false, False)
Self.RemoveAllInventoryEventFilters()
EndFunction
Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
If akSourceContainer == Game.GetPlayer()
self.RemoveItem(akBaseItem,aiItemCount)
If hasBeenFedToday == False
hasBeenFedToday=True
EndIf
EndIf
EndEvent
</source>
--[[User:Sollar|Sollar]] 02:59, 28 June 2012 (EDT)
Anonymous user

Navigation menu