InsertNode

From GECK
Jump to: navigation, search


A function added by the JIP NVSE Plugin.

Description

Inserts a NiNode as either a child or as the parent of an existing NiNode in the 3D model of the specified object form.

The function takes 3(+) arguments, as follows:

  • refOrForm - Either an object reference or a base form. In the former case, the NiNode will be inserted into the 3D model of that specific reference only, whereas in the latter case, it will be inserted into the 3D model of any reference instance of the base form.
  • addOrRemove - Either insert a new, or remove a previously inserted NiNode. Use one of the following values:
0	Remove; Pending reload
1	Insert; Pending reload
2	Remove; Instantaneous
3	Insert; Instantaneous
  • Pending reload - Changes will be applied once either the object's 3D is (re)loaded by the game, or Update3D is called on it.
  • Instantaneous - Changes will be applied instantly.
  • targetAndName - A formatted string containing the name of an existing NiNode in the object's 3D model and, separated by a vertical bar "|", the name of the new inserted NiNode. If the name of the new node is prefixed by a caret "^", it will be inserted as the parent of the target node. Otherwise, it will be inserted as the last child of the target node. Names are case-sensitive.

Syntax

[help]
(successful:0/1) InsertNode refOrForm:form addOrRemove:int{0-3} targetAndName:formattedString formatVars(up to 20)

Example

InsertNode PlayerRef 1 "Bip01 Head|^Head Parent Bone"

The above will INSERT a new NiNode named "Head Parent Bone" as the parent of "Bip01 Head" in the 3D model of the PlayerRef.

InsertNode TeddyBear01 1 "Bone01|My Node"

The above will INSERT a new NiNode named "My Node" as the last child of "Bone01" in the 3D model of every instance of TeddyBear01.

InsertNode PlayerRef 3 "Weapon|Secondary_Weapon"

The above will instantly INSERT a new NiNode named "Secondary_Weapon" as the last child of "Weapon" in the 3D model of the PlayerRef.

InsertNode PlayerRef 2 "Weapon|Secondary_Weapon"

The above will instantly REMOVE "Secondary_Weapon" from the 3D model of the PlayerRef.

Notes

  • Any changes made by this function remain in effect for the duration of the current game session, or until removed.
  • On successful insertion, the function returns 1, otherwise 0.
  • Using InsertNode/AttachModel on dynamic refs will only work with mode 3. For instantaneous removal of attached nodes/models from temporary refs, you'll need to use RemoveNifBlock.

See Also