ListAddReference

From GECK
Jump to: navigation, search


A function added by the Fallout Script Extender.

Description

Adds the calling reference at the given index (or at the end if not provided, or if -2 is the given index). If the function fails to do anything, returns -1, otherwise returns the index for where the reference was added.

Added in xNVSE v6.2.5, the checkForDupes arg can set to 1 (true) to prevent adding duplicate forms to the formlist.

This function is subject to warnings concerning being used on non-empty lists.

Syntax

[help]
(indexAddedAt:int) reference.ListAddReference formlist:baseform index:int{-2} checkForDupes:bool{0} 

Or:

(indexAddedAt:int) reference.ListAddRef formlist:baseform index:int{-2} checkForDupes:bool{0} 

Notes

  • FOSE version of the function suffers from a memory corruption bug and can cause various issues when used. The bug was addressed in early versions of xNVSE for New Vegas, and in ButcherPete FOSE plugin for Fallout 3.
  • Forms added to a list with this function will not persist across savegames. If you need to add items to a list that will be preserved in a saved game, use AddFormToFormList.

See Also