Here is the erroneous code:
Event OnUpdate()If (MDHClawCont.GetItemCount(dunYngolBarrowCoralClaw) == 1) Claw01.Enable()else Claw01.Disable()endifEndEvent
It rejects dunYngolBarrowCoralClaw as being invalid. This is one of the base objects I wish to count.
This is my whole script so far as well:
Scriptname MDHClawScriptCONTAINER extends ObjectReference{Toggles claw display based on contents of container (valid claws)}Bool Property Blocked = False Auto HiddenMessage Property MessageWarning AutoFormList Property ClawList AutoActor Property PlayerREF AutoInt Property DisplayType = 6 Auto; ClawXX refers to the Enable parents of claw displayObjectReference Property Claw01 Auto ;CoralObjectReference Property Claw02 Auto ;DiamondObjectReference Property Claw03 Auto ;EbonyObjectReference Property Claw04 Auto ;EmeraldObjectReference Property Claw05 Auto ;GlassObjectReference Property Claw06 Auto ;Golden Claw, handled uniquelyObjectReference Property Claw07 Auto ;IronObjectReference Property Claw08 Auto ;IvoryObjectReference Property Claw09 Auto ;RubyObjectReference Property Claw10 Auto ;SapphireObjectReference Property MDHClawCont Auto ;Is container used for this scriptEvent OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)If (akSourceContainer == PlayerRef) If (AllowedItems(akBaseItem))RegisterForSingleUpdate(0.1) Else MessageWarning.Show() RemoveItem(akBaseItem, aiItemCount, False, PlayerRef) EndIfElse RemoveItem(akBaseItem, aiItemCount, False, akSourceContainer)EndIfEndEventEvent OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)If (akDestContainer == Game.GetPlayer()) UnregisterForUpdate()EndIfEndEventEvent OnUpdate()If (MDHClawCont.GetItemCount(dunYngolBarrowCoralClaw) == 1)Claw01.Enable()elseClaw01.Disable()endifEndEventBool Function AllowedItems(Form akBaseItem)If (DisplayType == 6) Return (ClawList.HasForm(akBaseItem))EndifEndFunction
Haven't tested any aspect of this in-game yet.
*EDIT: I'd rather not have each individual dragon claw as its own formlist. There has to be a more elegant method.