How do I attach a script to the Player? I want to add an OnItemAdded event to the player. DO I have to create a quest?
Create a quest with a ReferenceAlias force-filled with PlayerREF as described below. So long as the quest is running and any conditions you add are met, the OnItemAdded() event will work. Keep in mind you can't call functions implicitly or use 'Self' from a ReferenceAlias script, so you'll need to use http://www.creationkit.com/GetActorReference_-_ReferenceAlias instead.
e.g.
Spoiler ScriptName BagOfHoldingPlayerAliasScript extends ReferenceAliasImport InputFormList Property BagOfHoldingItemFLST AutoInt Property iAutoStashKey = 48 Auto ConditionalObjectReference Property BagOfHoldingREF AutoAuto State AutoStash Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) If BagOfHoldingItemFLST.HasForm(akBaseItem) ElseIf IsKeyPressed(iAutoStashKey) GetActorReference().RemoveItem(akBaseItem, aiItemCount, True, BagOfHoldingREF) EndIf EndEventEndState
http://www.creationkit.com/GetBaseObject_-_ObjectReference: I've also found it unreliable and have been using a property pointed to the item instead.
Is there a way to tell via conditions if the player has a MiscItem in their inventory? (Specifically, one of the Totems of Hircine, CRTotem1, 2, and 3.) They don't show up in the list provided by the GetItemCount condition, nor GetInContainer, nor for that matter in the list of items that the "Player Add Item" Story Manager Event can track.
You need to set the condition's "Run on" field up to check Reference > Cell: (any) > Reference: PlayerREF before the dropdown list will show the items. If running on "Subject" the GetItemCount condition is inapplicable unless called implicitly (INFO). Also, if checking for all three, a FormList might come in handy to check instead of checking for each item individually.