KicklerOfButts Posted July 8, 2017 Posted July 8, 2017 I'm working on a mod but find myself not knowledgeable enough to program a particular function that I need. Is there any way that I can check if an item is added to any actor? (Specific item or otherwise) The important part is that it needs to check for an item added event on any actor. I'm working on a framework mod that requires me to be able to know whenever certain armors are added to any actor's inventory, so that I can replace them with another armor. OnItemAdded with an InventoryEventFilter would be perfect, if only they didn't need to be aimed at a specified actor via ObjectReference. This functionality is integral to a soon-to-be multi-year project of mine, so I would very much appreciate any feedback you could offer. Thanks in advance.
Guest Posted July 8, 2017 Posted July 8, 2017 Create a ReferenceAlias. Add a script to it. In the script you can use: Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) ; "A set of 'aiItemCount' item of type 'akBaseItem' are added to the actor of this alias" EndEvent Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) ; "A set of 'aiItemCount' item of type 'akBaseItem' are removed from the actor of this alias" EndEvent Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference) ; "The actor of the ReferenceAlias is now wearing 'akBaseObject'" EndEvent ; Event received when this actor unequips something - akReference may be None if object is not persistent Event OnObjectUnequipped(Form akBaseObject, ObjectReference akReference) ; "The actor of the ReferenceAlias just unequipped the item 'akBaseObject'" EndEvent
KicklerOfButts Posted July 8, 2017 Author Posted July 8, 2017 Create a ReferenceAlias. Add a script to it. In the script you can use: But then won't the script apply only to the specified ReferenceAlias and not all actors overall? Because it's the latter that I need, and the CK glossary entry tells me the former would be the case.
Guest Posted July 8, 2017 Posted July 8, 2017 No, you cannot apply this by default to all actors around. It is not supported by the Skyrim engine. The only thing you can do is to add an AliasScan, and fill the RefAliases with the actors around.
KicklerOfButts Posted July 8, 2017 Author Posted July 8, 2017 No, you cannot apply this by default to all actors around. It is not supported by the Skyrim engine. The only thing you can do is to add an AliasScan, and fill the RefAliases with the actors around. Alright then, thanks for the response. I suppose I'll try and figure out how to do things without this functionality.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.