A function added by the Fallout Script Extender.
Returns the base form of the Nth item in a container.
(baseform) Container.GetInventoryObject index:int
(baseform) Container.GetNthObject index:int
ref rItem set rItem to PlayerREF.GetInventoryObject 21
Often you may wish to use this in a loop, to go through every item in an inventory:
int x ref rItem let x := PlayerREF.GetNumItems while x > 0 let x -= 1 ; decrement x, the first item is '0' let rItem := PlayerREF.GetInventoryObject x ; do something loop
- Beware removing items from a container within a loop, because it may change the index of those later.
- Multiple instances of the same base form in a container are considered as just one item by the function.