Auxiliary Variables
Revision as of 23:00, 24 April 2015 by imported>Jazzisparis (Created page with "The Auxiliary-Variables interface is a utility added by the [http://www.nexusmods.com/newvegas/mods/58277 JIP NVSE Plugin], and is an alternative method for dynamically storin...")
The Auxiliary-Variables interface is a utility added by the JIP NVSE Plugin, and is an alternative method for dynamically storing and managing game-data. Auxiliary-Variables (abbreviated as AuxVars) are a special type of variables that, unlike generic script variables, exist in the game's memory and are not part of, and are not pre-declared in any game-script. AuxVars are created, accessed, modified and deleted using a set of script commands, and can be permanent (saved with the game), or temporary.
Properties
- An AuxVar is defined by a Name (string, case-insensitive) and an Object (object reference/base form) that "owns" it. This Object:Name pair must, therefore, be unique. Note that different Objects may "own" a variable with the same Name and still count as a unique pair. Any Object may "own" any number of variables.
- AuxVars can store either numeric, reference/form, or string values. They have no explicit, fixed value-type - their type changes dynamically, according to the type of value assigned to them.
- Every AuxVar is an array by default, and can be used to store either a single, or multiple values (of mixed types).
Private vs. Public AuxVars
- By default, every AuxVar is private to the mod it was created by, and can only be accessed/modified by scripts originating in that mod. This allows different mods to use the same variable names, associated with the same objects, without overwriting each other. Private AuxVars and their values are saved with the game.
- In contrast, public AuxVars can be accessed/modified by any mod, and can be very useful for inter-mod communication. Their values are persistent in the current game session (much like constant global variables). However, they are not saved with the game, and are discarded when the game is exited. Prefixing a variable's name with an asterisk (example: "*VarName") will mark it as public.