Add - Array

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

Member of: All Arrays

Adds a new item to the array at the end, expanding it to fit. May add multiple items at once.

Syntax[edit | edit source]

Function Add(;/element type/; akElement, int aiCount = 1) native

Parameters[edit | edit source]

  • akElement: The element to locate
  • aiCount: The number of items to add
    • Default: 1

Return Value[edit | edit source]

None

Examples[edit | edit source]

; Add the number 4 to the end of the array
MyIntArray.Add(4)


; Add the number 1 four times into the array
MyIntArray.Add(1, 4)

Notes[edit | edit source]

If you add a struct to an array it will only be a single struct, not multiple copies of the struct. Add essentially works like a while loop, continually adding the thing you give it to the array, after saving that thing off into a variable.

See Also[edit | edit source]