AuxiliaryVariableSetFromArray

From GECK
(Redirected from AuxVarSetFromArr)
Jump to: navigation, search


A function added by the JIP NVSE Plugin.

Description

Creates an Auxiliary-Variable containing all the values stored in the passed array_var. If the specified AuxVar already exists, all values stored in it are erased.

If you are making a patch for a script that is using AuxVar functions, and that patch is an ESM/ESP, the ESM/ESP will overwritte the Mod Index of the AuxVar is attached to, and the original script will lose access to the AuxVar. So if another script within the master plugin is attempting to check the AuxVar, it will not be able to, as the Mod Index has now been overwritten.

Syntax

[help]
(numElements:int) reference.AuxiliaryVariableSetFromArray varName:string sourceArray:array_var baseForm:ref 

Or:

(numElements:int) reference.AuxVarSetFromArr varName:string sourceArray:array_var baseForm:ref

Example

RaulRef.AuxiliaryVariableSetFromArray "someVarName" aSourceArr
AuxVarSetFromArr "someVarName" aSourceArr ArmorCombat 

Notes

  • The function returns the size (number of elements) of the created AuxVar.
  • This creates a new array stored in the AuxVar that is no longer associated with the source array.
  • This function only grabs the values from the array; keys from Map Arrays and StringMaps are ignored, as AuxVars only use numeric keys, like regular arrays.
  • Using this function on a Multidimensional Array (an Array composed of Arrays) will NOT produce the expected results. It is suggested to only use single-dimension arrays with this function.

See Also