GetFormTraitType
From GECK
A function added by the pp NVSE Plugin.
Contents
Description
FormTraits are a more specialized version of Auxiliary-Variable variables that support nested arrays. Traits can be loaded directly onto forms when the game starts through Devkit, and they're especially useful for modification systems. linkedForm, linkedKey and Priority are all optional. linkedKey is mainly used if you want to have a linkedForm that can have multiple different values depending on the key.
Syntax
(variable) GetFormTrait Index:int parentForm:ref Key:string linkedForm:ref linkedKey:ref Priority:int
Example
if eval GetFormTraitType 0 weapNV9mmPistol "MoveNode" == 2 let sString := GetFormTrait 0 weapNV9mmPistol "MoveNode" endif if eval GetFormTraitType 1 weapNV9mmPistol "MoveNode" == 0 let fx := GetFormTrait 1 weapNV9mmPistol "MoveNode" endif
Returns MoveNode trait on the weapNV9mmPistol
if eval GetFormTraitType 0 weapNV9mmPistol "AttachedModel" ModNV9mmPistolExtMags "MagSlot" == -1 ;Trait does not exist let sModelPath := GetFormTrait 0 ModNV9mmPistolExtMags "AttachedModel" else let sModelPath := GetFormTrait 0 weapNV9mmPistol "AttachedModel" ModNV9mmPistolExtMags "MagSlot" endif ;Do something with sModelPath
TriatTypes | Description |
---|---|
(-1) | Trait does not exist |
0 | float |
1 | reference |
2 | string |
3 | array |
Notes
- Traits remain valid for the session, and behave like the Temporary-Public class "*_" in aux variables.