Stealth022 Posted February 4, 2023 Share Posted February 4, 2023 (edited) I need an advice in those who were experiencing цшер arrays and in setting the function which outputs an array to an array variable. Can someone write here a working example of using this function to get an array of items stored inside a container? This function is from Papyrus Extender : ;Function is untested in cases where the inventory count exceeds normal papyrus array limit of 128. Form[] function AddAllInventoryItemsToArray(ObjectReference akRef, bool noEquipped = true, bool noFavourited = false, bool noQuestItem = false) global nativeand any my tries ends up with some error likeglobal function ... cannot be called on an objectorno viable alternative at input '='or else... This is my piece of script code applied to container, a code I can not get to be compiled :/ Scriptname aaaTestChestSCRIPT extends PO3_SKSEFunctions Event OnActivate (ObjectReference akActionRef) ObjectReference[] ChestItems = AddAllInventoryItemsToArray(self, true, false, false) EndEvent Edited February 4, 2023 by Stealth022 Link to comment Share on other sites More sharing options...
Stealth022 Posted February 10, 2023 Author Share Posted February 10, 2023 ...well... that function AddAllInventoryItemsToArray works with akRef as Actor. It could accept for to be compiled a container's ObjectReference casted to Actor, but it outputs none.The working one for a container isGetContainerForms()from ObjectReference script.Both functions noted are outputting an array of Forms of the items. That array of Forms are like an array of BaseObjects, so doing anything to the item from the array will touch any item of the same FormID.And I needed an ObjectReference types of the items, so I could make things (like GetEnchantment, a custom one) to the specific one. If to compare to the Oblivion stuff, looks like it is no longer possible to get an ObjectReference types of the specific items inside an Actor/Container. However, in game we are seeing the items with a custom enchantment normally, so they do not stacks with the items of same FormID (a "base" items, non-enchanted). Link to comment Share on other sites More sharing options...
Recommended Posts