Jump to content

AddAllInventoryItemsToArray


Stealth022

Recommended Posts

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 native

and any my tries ends up with some error like
global function ... cannot be called on an object
or
no 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 by Stealth022
Link to comment
Share on other sites

...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 is
GetContainerForms()
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...