Script commands
kNVSE adds the following commands to NVSE and GECK scripting.
- Parameters in
[brackets]are optional. ref.Commandrequires a calling reference.[ref.]Commandaccepts an optional calling reference that changes what the command targets.- KF paths are relative to
Data\Meshesand must use backslashes (\), such ascharacters\_male\idleanims\myidle.kf. Most commands lowercase KF paths automatically.
Command index
Section titled “Command index”| Command | Alias | Purpose |
|---|---|---|
| ActivateAnim | Start a KF directly on an actor | |
| AddAnimTextKey | Append a text key to a KF | |
| BlendToAnim | Blend from one KF to another | |
| BlendToAnimFromPose | Blend from the actor’s current pose to a KF | |
| CanFireWeapon | Check if an actor can fire right now | |
| CopyAnimationsToForm | Copy a form’s registered overrides to another form | |
| CopyAnimPriorities | Copy bone priorities from one loaded KF to another | |
| CreateIdleAnimForm | Create an idle form for a KF path | |
| CrossFadeAnims | Cross-fade from an active KF to another KF | |
| DeactivateAnim | Stop a playing KF | |
| EjectWeapon | Eject a shell casing from the equipped weapon | |
| EraseCurrentAnimAction | Clear the actor’s current animation action | |
| ForceFireWeapon | Make an actor fire its equipped weapon | |
| ForcePlayIdle | Play an idle form immediately | |
| ForceStopIdle | Stop the actor’s currently playing idle | |
| GetActiveAnims | Get paths of all active KFs on an actor | |
| GetAnimationAttributes | GetAnimAttrs |
Get a string map of a KF’s properties and state |
| GetAnimationsByAnimGroup | GetAnimsByGroup |
Get KFs an actor can play for an anim group |
| GetAnimCurrentTime | Get the current playback time of a KF | |
| GetAnimHandType | Get the weapon hand type ID of a KF | |
| GetAnimInterpPriority | Get a single bone’s priority in a KF | |
| GetAnimMovementSpeedMult | Get an actor’s movement animation speed multiplier | |
| GetAnimPathBySequenceType | GetAnimPathByType |
Get the KF path playing in a sequence slot |
| GetAnimTextKeyTime | Get the timestamp of a text key | |
| GetAnimWeight | Get the weight of a loaded KF | |
| GetDirectoryFiles | List loose and BSA files matching a wildcard path | |
| GetGlobalAnimTime | Get an actor’s animation clock | |
| GetkNVSESetting | Read the active numeric value of a kNVSE setting | |
| GetPlayingAnimBySequenceType | GetAnimByType |
Get attributes of the KF playing in a sequence slot |
| GetPlayingAnimSequencePaths | GetAnimsByType |
Get an array of KF paths across all 8 sequence slots |
| IsAnimAdditive | Check if a loaded KF is marked additive | |
| IsAnimPlayingAlt | Check if an anim group is playing (any weapon type) | |
| IsAnimQueued | Check if a KF is queued via QueueNextAnim |
|
| IsAnimSequencePlaying | Check if a KF is currently playing | |
| kNVSEReset | Reload override folders, JSONs, and KFs from disk | |
| kNVSEToggleSetting | Toggle a boolean kNVSE setting | |
| PlayAnimationPath | Play any KF file on an actor | |
| PlayAnimSequenceEx | Play an embedded NIF animation on any object | |
| PlayGroupAlt | Play an anim group matched to the equipped weapon | |
| QueueNextAnim | Queue a KF for the next play of its anim group | |
| RegisterCustomAnimGroup | Register a callback script for a custom anim group | |
| RemoveAnimTextKey | Remove a text key from a KF | |
| SetActorAnimationPath | Register overrides for an actor or globally | |
| SetAnimAdditive | Mark a KF as an additive animation | |
| SetAnimAdditiveInterpsWeightMult | Scale an additive KF’s strength per bone | |
| SetAnimCurrentTime | Set the playback time of a loaded KF | |
| SetAnimCycleType | Change a KF’s cycle type (loop/reverse/clamp) | |
| SetAnimDestFrame | Set a KF’s fDestFrame text key |
|
| SetAnimInterpPriority | Set a single bone’s priority in a KF | |
| SetAnimSequenceFrequencyAlt | Set playback speed of an embedded NIF animation | |
| SetAnimTextKeys | Replace all text keys on a KF | |
| SetAnimWeight | Set the weight of a loaded KF | |
| SetFormAnimationPath | Register overrides for a form or form list | |
| SetGlobalAnimTime | Set an actor’s animation clock | |
| SetkNVSESetting | Change a kNVSE setting for the current session | |
| SetWeaponAnimationPath | Register overrides for a weapon | |
| ThisAnim | Get the KF path inside a text-key or custom-group script | |
| ThisAnimDir | Get the folder path of ThisAnim |
Aliases can be used anywhere in place of the full command name.
Common parameters and behavior
Section titled “Common parameters and behavior”- First-person flag (
firstPerson,bFirstPerson,bIsFirstPerson): Applies only to the player, who uses separate 1st-person and 3rd-person skeletons. Pass1for 1st person or0for 3rd person. Where optional, this parameter defaults to-1(use the player’s currently active camera view), except where noted. Ignored for NPCs. - Sequence type (
sequenceId): The animation slot ID:0Idle,1Movement,2Left Arm,3Left Hand,4Weapon,5Weapon Up,6Weapon Down,7Special Idle. - Return values: Unless noted otherwise, commands return
1on success and0on failure (such as a missing KF, invalid form, or non-actor reference). - Deferred execution on NPCs: When
PlayAnimationPath,ActivateAnim,DeactivateAnim,CrossFadeAnims,BlendToAnimFromPose,QueueNextAnim,SetAnimAdditive, orSetAnimAdditiveInterpsWeightMultis called on an NPC during background AI updates, kNVSE queues the operation to run on the next frame and returns1immediately.
Registering overrides
Section titled “Registering overrides”These commands register or disable animation overrides at runtime using the same override system as Data\Meshes\AnimGroupOverride. See Animation overrides for priority rules, variants, and conditions.
animationPathis relative toData\Meshes. Pass either a single.kffile path or a folder path (a folder registers all.kffiles directly inside it, loose or in BSAs, as one set).enable1registers the files;enable0disables the override set containing those files.- Each call is logged to
kNVSE.logwith the calling script and plugin. - Returns
1if at least one file was registered (whenenableis1) or matched and disabled (whenenableis0).
SetWeaponAnimationPath
Section titled “SetWeaponAnimationPath”SetWeaponAnimationPath weapon:form firstPerson:int enable:int animationPath:stringRegisters or disables overrides played when an actor equips weapon. Set firstPerson to 1 for the player’s 1st-person skeleton or 0 for 3rd-person skeletons.
SetWeaponAnimationPath WeapNV9mmPistol 1 1 "characters\_1stperson\mypistol"SetWeaponAnimationPath WeapNV9mmPistol 0 1 "characters\_male\mypistol"SetActorAnimationPath
Section titled “SetActorAnimationPath”[ref.]SetActorAnimationPath firstPerson:int enable:int animationPath:string [pollCondition:int] [condition:form] [matchBaseAnimGroupId:int]Registers or disables overrides for the calling actor. If called without a reference:
- When
firstPersonis0, the override applies globally to all actors. - When
firstPersonis1, the override applies to the player (since only the player has a 1st-person skeleton).
Optional parameters:
pollCondition:1re-checksconditionwhile looping animations play (default0).condition: A UDF script or lambda returning non-zero when the override should play.matchBaseAnimGroupId:1matches all weapon, stance, and power armor variants of the base group (default0).
playerRef.SetActorAnimationPath 0 1 "characters\_male\mymod\walk" 1 (begin function {} SetFunctionValue (playerRef.IsSneaking == 0)end)SetFormAnimationPath
Section titled “SetFormAnimationPath”SetFormAnimationPath form:form firstPerson:int enable:int animationPath:string [pollCondition:int] [condition:form] [matchBaseAnimGroupId:int]Same options as SetActorAnimationPath, targeting form explicitly. form can be an actor reference, NPC or creature base form, race, weapon, or a form list of those types (including nested form lists). Form lists are expanded at the time of the call, so forms added to the list later are not covered.
SetFormAnimationPath MyRaceList 0 1 "characters\_male\mymod\idles"CopyAnimationsToForm
Section titled “CopyAnimationsToForm”CopyAnimationsToForm fromForm:form toForm:formCopies all 1st-person and 3rd-person overrides registered directly on fromForm onto toForm. Returns 1 if at least one file was copied.
CopyAnimationsToForm WeapNV9mmPistol MyCustom9mmPistolkNVSEReset
Section titled “kNVSEReset”kNVSEResetConsole command for testing animation edits without restarting the game. Rescans Data\Meshes\AnimGroupOverride, reloads JSON configs, and clears cached KFs so modified files reload from disk on their next play. Overrides registered by scripts and plugins are preserved. Prints a warning if called from a script instead of the console. Always returns 0.
RegisterCustomAnimGroup
Section titled “RegisterCustomAnimGroup”RegisterCustomAnimGroup name:string script:form [cleanUpScript:form]Registers a callback script for a custom animation group (<animGroup>__<name>.kf inside a _male or _1stperson override folder).
While any animation from that same _male or _1stperson folder plays, script runs every frame on the actor with two arguments: the custom KF’s path (string_var) and whether it is 1st person (int). When that animation stops, cleanUpScript (if provided) is called once with the same two arguments.
Group names are case-insensitive. Returns 1 if registered, or 0 if invalid or if the exact same (script, cleanUpScript) pair is already registered.
RegisterCustomAnimGroup "Inspect" (begin function {string_var sPath, int iFirstPerson} ; runs every frame while an animation from the same folder playsend) (begin function {string_var sPath, int iFirstPerson} ; runs once when the animation stopsend)Playing animations
Section titled “Playing animations”PlayAnimationPath
Section titled “PlayAnimationPath”ref.PlayAnimationPath path:string [firstPerson:int]Loads (if needed) and plays any KF file directly on the actor without needing an override or idle form. If the KF is already playing, it restarts from the beginning.
Non-looping KFs (Clamp or Reverse) stop automatically when they reach their end. Looping KFs continue playing until stopped (for example with DeactivateAnim).
playerRef.PlayAnimationPath "characters\_male\idleanims\myidle.kf"ActivateAnim
Section titled “ActivateAnim”ref.ActivateAnim animSequencePath:string [bIsFirstPerson:int] [iPriority:int] [bStartOver:int] [fWeight:float] [fEaseInTime:float] [timeSyncSequencePath:string]Starts a KF directly with control over priority, weight, blend-in time, and synchronization. If the KF is already active, it is stopped and restarted.
iPriority: Sequence priority (default0).bStartOver:1starts from the beginning (default1).fWeight: Playback weight (defaults to the KF’s own weight).fEaseInTime: Blend-in time in seconds (defaults to the KF’sBlend/BlendIntext key, or0if none).timeSyncSequencePath: Optional KF path to sync playback timing with (fails if that KF is not found).
playerRef.ActivateAnim "characters\_1stperson\mymod\overlay.kf" 1 10 1 1.0 0.2DeactivateAnim
Section titled “DeactivateAnim”ref.DeactivateAnim animSequencePath:string [fEaseOutTime:float]Stops a currently playing KF on the actor. fEaseOutTime is the blend-out time in seconds (defaults to the KF’s Blend/BlendOut text key, or 0 if none).
For additive KFs, DeactivateAnim stops the animation immediately without removing its additive flag. Calling ActivateAnim on it again still plays it additively.
playerRef.DeactivateAnim "characters\_1stperson\mymod\overlay.kf" 0.3CrossFadeAnims
Section titled “CrossFadeAnims”ref.CrossFadeAnims sourceSequencePath:string destSequencePath:string [bFirstPerson:int] [fEaseInTime:float] [iPriority:int] [bStartOver:int] [fWeight:float] [timeSyncSequencePath:string]Cross-fades from sourceSequencePath (which must currently be active) to destSequencePath. Defaults match ActivateAnim, except fEaseInTime defaults to the blend time between the two KFs. Note that custom kNVSE text keys on destSequencePath do not automatically trigger from CrossFadeAnims.
playerRef.CrossFadeAnims "characters\_male\mtidle.kf" "characters\_male\mymod\pose.kf" 0 0.25BlendToAnim
Section titled “BlendToAnim”ref.BlendToAnim sourceSequencePath:string destSequencePath:string [bFirstPerson:int] [fDuration:float] [fDestFrame:float] [fSourceWeight:float] [fDestWeight:float] [iPriority:int] [timeSyncSequencePath:string]Blends from sourceSequencePath to destSequencePath over fDuration seconds (defaults to the blend time between the two KFs), starting destSequencePath at fDestFrame seconds (default 0). Weights default to each KF’s own weight, iPriority defaults to 0, and timeSyncSequencePath optionally syncs timing to another KF.
playerRef.BlendToAnim "characters\_male\mtidle.kf" "characters\_male\mymod\pose.kf" 0 0.5 0.0BlendToAnimFromPose
Section titled “BlendToAnimFromPose”ref.BlendToAnimFromPose sequencePath:string [bFirstPerson:int] [fDuration:float] [fDestFrame:float] [iPriority:int] [timeSyncSequencePath:string]Blends from the actor’s current pose into sequencePath over fDuration seconds (defaults to the KF’s blend time), starting at fDestFrame seconds (default 0). iPriority defaults to 0, and timeSyncSequencePath optionally syncs timing to another KF.
playerRef.BlendToAnimFromPose "characters\_male\mymod\pose.kf" 0 0.4QueueNextAnim
Section titled “QueueNextAnim”ref.QueueNextAnim sAnimPath:string [bFirstPerson:int]Queues sAnimPath to play the next time its animation group plays on the actor, overriding normal selection for that one play. The KF must have an anim group, and it matches that exact group (including weapon type, sneak/swim stance, and power armor flags). Use IsAnimQueued to check if it is still queued.
playerRef.QueueNextAnim "characters\_1stperson\mymod\2hareloada_special.kf" 1ForcePlayIdle
Section titled “ForcePlayIdle”ref.ForcePlayIdle idle:form [pov:int]Plays an idle form (TESIdleForm) immediately on the actor, bypassing its GECK conditions.
For the player, pov uses 0 for the current view (default), 1 for 3rd person, and 2 for 1st person. Ignored for NPCs.
playerRef.ForcePlayIdle MyCustomIdle 2ForceStopIdle
Section titled “ForceStopIdle”ref.ForceStopIdle [pov:int]Stops the idle currently playing on the actor. pov uses the same values as ForcePlayIdle (0 current view, 1 3rd person, 2 1st person).
playerRef.ForceStopIdle 2PlayGroupAlt
Section titled “PlayGroupAlt”ref.PlayGroupAlt animGroup:animgroup [flags:int]Plays animGroup on the actor while automatically applying the actor’s currently equipped weapon type (and stance). flags defaults to 1 (play immediately). Returns 1 if the group started playing.
playerRef.PlayGroupAlt EquipCreateIdleAnimForm
Section titled “CreateIdleAnimForm”CreateIdleAnimForm path:string [type:int]Creates a runtime idle form pointing to path (relative to Data\Meshes). type is the sequence slot (0–7, default 7 for Special Idle).
PlayAnimSequenceEx
Section titled “PlayAnimSequenceEx”ref.PlayAnimSequenceEx sequenceName:string [nodeName:string] [priority:int] [easeInTime:float]Plays an embedded NIF animation sequence on any object reference (doors, activators, furniture, etc.). sequenceName is case-sensitive. Searches the model’s root node, or nodeName if provided. priority defaults to 0 and easeInTime defaults to 0.0. Returns 0 if the sequence is already active or not found.
MyDoorRef.PlayAnimSequenceEx "Open" "" 0 0.1Controlling animations
Section titled “Controlling animations”SetAnimCurrentTime
Section titled “SetAnimCurrentTime”ref.SetAnimCurrentTime path:string time:floatJumps a loaded KF on the actor to time seconds.
playerRef.SetAnimCurrentTime "characters\_male\mymod\pose.kf" 1.5SetAnimWeight
Section titled “SetAnimWeight”ref.SetAnimWeight animSequencePath:string weight:floatSets the blend weight of a loaded KF on the actor. Requires a calling actor reference.
playerRef.SetAnimWeight "characters\_1stperson\mymod\breathing.kf" 0.5SetGlobalAnimTime
Section titled “SetGlobalAnimTime”ref.SetGlobalAnimTime timePassed:float [bFirstPerson:int]Sets the actor’s animation clock in seconds, shifting all active sequences on that skeleton together.
playerRef.SetGlobalAnimTime 0.0 1SetAnimCycleType
Section titled “SetAnimCycleType”ref.SetAnimCycleType animSequencePath:string cycleType:int [firstPerson:int]Sets how a KF behaves when it reaches its end: 0 loop, 1 reverse, 2 clamp (hold on the last frame). Loads the KF onto the actor if not already loaded.
playerRef.SetAnimCycleType "characters\_male\mymod\pose.kf" 2 0SetAnimDestFrame
Section titled “SetAnimDestFrame”ref.SetAnimDestFrame animPath:string destFrame:float [firstPerson:int]Sets (or adds) the KF’s fDestFrame text key to destFrame seconds, controlling where the animation starts on its next BlendFromPose. Loads the KF if needed.
Note: firstPerson defaults to 0 (3rd person) and is treated as a boolean (0 = 3rd person, any non-zero value = 1st person). Do not pass -1 to mean current view.
playerRef.SetAnimDestFrame "characters\_1stperson\mymod\draw.kf" 0.35 1SetAnimAdditive
Section titled “SetAnimAdditive”ref.SetAnimAdditive additiveAnimPath:string [firstPerson:int] [referencePoseAnimPath:string] [referencePoseTimePoint:float] [ignorePriorities:int]Marks a KF to play additively on the actor, applying its difference from a reference pose on top of underlying animations instead of replacing them.
referencePoseAnimPath: KF used as the baseline pose (defaults to the actor’s current idle animation).referencePoseTimePoint: Timestamp in seconds to sample from the reference pose (default0.0).ignorePriorities:1applies the additive motion regardless of bone priorities (default0).
Call SetAnimAdditive before starting the KF with ActivateAnim. The additive flag stays on that actor’s KF across subsequent plays.
playerRef.SetAnimAdditive "characters\_1stperson\mymod\breathing.kf" 1playerRef.ActivateAnim "characters\_1stperson\mymod\breathing.kf" 1SetAnimAdditiveInterpsWeightMult
Section titled “SetAnimAdditiveInterpsWeightMult”ref.SetAnimAdditiveInterpsWeightMult animSequencePath:string rootNodeName:string weight:float recursive:int [firstPerson:int]Scales the strength of an already-additive KF on rootNodeName (and all child bones under it when recursive is 1). The multiplier persists on the actor’s KF across future plays. Pass firstPerson explicitly (0 or 1) when calling on the player. Returns 0 if the bone is not found or the KF is not additive.
playerRef.SetAnimAdditiveInterpsWeightMult "characters\_1stperson\mymod\breathing.kf" "Bip01 L UpperArm" 0.5 1 1SetAnimInterpPriority
Section titled “SetAnimInterpPriority”[ref.]SetAnimInterpPriority sAnimPath:string sInterpName:string iPriority:intSets the priority (0 to 255) of a single bone (sInterpName, case-sensitive, such as "Bip01 Spine") in a KF.
- With a reference: updates the KF already loaded on that reference.
- Without a reference: updates the shared template KF, affecting actors that load it afterward (not copies already loaded on existing actors).
playerRef.SetAnimInterpPriority "characters\_male\mymod\wave.kf" "Bip01 R Clavicle" 60CopyAnimPriorities
Section titled “CopyAnimPriorities”ref.CopyAnimPriorities sSourceAnimPath:string sDestAnimPath:stringCopies bone priorities from sSourceAnimPath to sDestAnimPath for all matching bone names. Both KFs must already be loaded on the reference. Returns the number of bones updated.
int iCopiedlet iCopied := playerRef.CopyAnimPriorities "characters\_male\mtidle.kf" "characters\_male\mymod\customidle.kf"SetAnimSequenceFrequencyAlt
Section titled “SetAnimSequenceFrequencyAlt”ref.SetAnimSequenceFrequencyAlt sequenceName:string frequency:float [nodeName:string]Sets the playback speed of an embedded NIF animation sequence on an object reference (1.0 is normal speed). sequenceName and nodeName work the same way as in PlayAnimSequenceEx.
MyDoorRef.SetAnimSequenceFrequencyAlt "Open" 2.0Querying animations
Section titled “Querying animations”IsAnimSequencePlaying
Section titled “IsAnimSequencePlaying”ref.IsAnimSequencePlaying path:stringReturns 1 if the KF is currently active on the actor and not easing out via DeactivateAnim (still returns 1 while cross-fading out). For the player, checks the current camera view first and only checks the other view if the KF is not loaded in the current view.
if playerRef.IsAnimSequencePlaying "characters\_1stperson\mymod\overlay.kf" ; still playingendifIsAnimPlayingAlt
Section titled “IsAnimPlayingAlt”ref.IsAnimPlayingAlt animGroup:animgroupReturns 1 if the actor is playing animGroup in its current view, regardless of equipped weapon type or hand variant.
if playerRef.IsAnimPlayingAlt ReloadA ; player is playing any weapon type's ReloadAendifIsAnimQueued
Section titled “IsAnimQueued”ref.IsAnimQueued sAnimPath:stringReturns 1 if sAnimPath is currently waiting in the actor’s queue from QueueNextAnim.
IsAnimAdditive
Section titled “IsAnimAdditive”ref.IsAnimAdditive animSequencePath:stringReturns 1 if the loaded KF on the actor is marked as additive (whether currently playing or inactive).
GetActiveAnims
Section titled “GetActiveAnims”ref.GetActiveAnims [bIsFirstPerson:int]Returns an array containing the paths of all currently active KFs on the actor.
array_var aAnimslet aAnims := playerRef.GetActiveAnims 1GetPlayingAnimSequencePaths
Section titled “GetPlayingAnimSequencePaths”ref.GetPlayingAnimSequencePaths [bIsFirstPerson:int]Alias: GetAnimsByType
Returns an 8-element array (indices 0 through 7) containing the KF path playing in each sequence slot, or an empty string "" for empty slots.
array_var aSlotslet aSlots := playerRef.GetAnimsByType 1string_var sWeaponAnimlet sWeaponAnim := aSlots[4]GetPlayingAnimBySequenceType
Section titled “GetPlayingAnimBySequenceType”ref.GetPlayingAnimBySequenceType sequenceId:int [bIsFirstPerson:int]Alias: GetAnimByType
Returns a string map of attributes for the KF playing in sequence slot sequenceId (0–7), using the same keys as GetAnimationAttributes. Returns 0 if the slot is empty or out of range.
array_var aWeaponAnimlet aWeaponAnim := playerRef.GetAnimByType 4 1if eval (aWeaponAnim) float fTime let fTime := aWeaponAnim["calculatedTime"]endifGetAnimPathBySequenceType
Section titled “GetAnimPathBySequenceType”ref.GetAnimPathBySequenceType sequenceId:int [bIsFirstPerson:int]Alias: GetAnimPathByType
Returns the path (string) of the KF playing in sequence slot sequenceId (0–7), or "" if the slot is empty.
string_var sWeaponAnimlet sWeaponAnim := playerRef.GetAnimPathBySequenceType 4GetAnimationAttributes
Section titled “GetAnimationAttributes”[ref.]GetAnimationAttributes path:stringAlias: GetAnimAttrs
Returns a string map describing a KF.
- With an actor reference: inspects the loaded KF on that actor and includes live playback state keys.
- With a non-actor reference: inspects the loaded sequence on that object (without playback state keys).
- Without a reference: loads and inspects the KF file directly (without playback state keys).
Always included:
| Key | Description |
|---|---|
sequenceName |
Path of the KF |
seqWeight |
Blend weight |
cycleType |
0 loop, 1 reverse, 2 clamp |
frequency |
Base playback speed |
beginKeyTime, endKeyTime |
Start and end key timestamps |
accumRootName |
Name of the root motion bone |
Included when present on the KF:
| Key | Description |
|---|---|
animGroupId, animGroupName |
Full 16-bit anim group ID and group name |
sequenceType |
Sequence slot (0–7) |
keyType |
Group action type |
textKeyTimes, textKeyValues |
Parallel arrays of text key timestamps and strings |
Included only on an actor reference:
| Key | Description |
|---|---|
lastTime, weightedLastTime, lastScaledTime |
Internal timing values |
state |
Sequence state (0 inactive, 1 animating, 2 ease-in, 3 ease-out, 4 trans-source, 5 trans-dest, 6 morph-source) |
offset, startTime, endTime |
Sequence offset and transition bounds |
calculatedTime |
Current playback time in the KF |
multiplier |
Speed multiplier for the group (e.g. fire rate or reload speed; present when the KF has an anim group) |
array_var aAttrslet aAttrs := playerRef.GetAnimAttrs "characters\_1stperson\2hareloada.kf"if eval (aAttrs) Print "End time: " + $aAttrs["endKeyTime"]endifGetAnimationsByAnimGroup
Section titled “GetAnimationsByAnimGroup”ref.GetAnimationsByAnimGroup animGroup:animgroup [bIsFirstPerson:int]Alias: GetAnimsByGroup
Returns an array of KF paths the actor can play for animGroup with its currently equipped weapon. If enabled overrides exist for that group, returns the override paths; otherwise returns the vanilla KF paths for the group.
array_var aReloadslet aReloads := playerRef.GetAnimsByGroup ReloadA 1GetAnimCurrentTime
Section titled “GetAnimCurrentTime”ref.GetAnimCurrentTime path:stringReturns the current playback time (in seconds) of a loaded KF on the actor, or 0 if not found.
GetGlobalAnimTime
Section titled “GetGlobalAnimTime”ref.GetGlobalAnimTime [bFirstPerson:int]Returns the actor’s animation clock in seconds. See SetGlobalAnimTime.
GetAnimWeight
Section titled “GetAnimWeight”ref.GetAnimWeight animSequencePath:stringReturns the blend weight of a loaded KF on the actor, or 0 if not found.
GetAnimInterpPriority
Section titled “GetAnimInterpPriority”[ref.]GetAnimInterpPriority sAnimPath:string sInterpName:stringReturns the priority (0–255) of bone sInterpName (case-sensitive) in a KF, or -1 if the KF or bone is not found. Calling with or without a reference works the same way as SetAnimInterpPriority.
GetAnimHandType
Section titled “GetAnimHandType”ref.GetAnimHandType sAnimPath:stringReturns the weapon hand type ID encoded in a loaded KF’s anim group (for example, one-handed pistol vs. two-handed rifle), or -1 if the KF is not found or has no anim group.
GetAnimMovementSpeedMult
Section titled “GetAnimMovementSpeedMult”ref.GetAnimMovementSpeedMultReturns the movement animation speed multiplier currently applied to the actor.
Text keys
Section titled “Text keys”These commands read or modify KF text keys at runtime. Because KFs share their text key data across actors using the same file, changes affect all actors playing that KF. See Text keys for supported keys and limitations.
SetAnimTextKeys
Section titled “SetAnimTextKeys”[ref.]SetAnimTextKeys animPath:string textKeyTimes:array textKeyValues:array [pointOfView:int]Replaces all text keys on a KF. textKeyTimes (floats in seconds) and textKeyValues (strings) must have the same length. Uses NVSE expression syntax.
- The KF must not currently be playing.
- With an actor reference, loads the KF if needed.
pointOfView:1= 3rd person,2= 1st person,0(default) = check already-loaded views, or load into 3rd person if unloaded. - Without a reference, loads the KF file directly.
- If the engine fails to parse the new keys for the KF’s anim group, the previous keys are restored and the command returns
0.
playerRef.SetAnimTextKeys "characters\_1stperson\mymod\attack.kf" (ar_List 0, 0.4, 1.2) (ar_List "Start", "Hit", "End") 2AddAnimTextKey
Section titled “AddAnimTextKey”[ref.]AddAnimTextKey sAnimPath:string fTime:float sTextKey:stringAppends a text key at fTime seconds to a KF. With a reference, modifies the KF loaded on that reference; without a reference, loads the KF file directly. Refreshes kNVSE custom text keys, but does not re-parse vanilla engine keys (Start, Hit, End).
AddAnimTextKey "characters\_1stperson\mymod\reload.kf" 0.8 "SoundPath: fx\wpn\mymod\magin.wav"RemoveAnimTextKey
Section titled “RemoveAnimTextKey”[ref.]RemoveAnimTextKey sAnimPath:string iIndex:intRemoves a text key by index (0-based) from a KF. Looks up the KF the same way as AddAnimTextKey. Returns 1 on success.
GetAnimTextKeyTime
Section titled “GetAnimTextKeyTime”ref.GetAnimTextKeyTime sAnimPath:string sTextKey:stringReturns the timestamp (in seconds) of the first text key matching sTextKey (exact, case-sensitive match) on a loaded KF with an anim group, or -1 if not found.
float fHitTimelet fHitTime := playerRef.GetAnimTextKeyTime "characters\_1stperson\mymod\attack.kf" "Hit"ThisAnim
Section titled “ThisAnim”ThisAnimInside a script triggered by a Script: or scriptLine: text key, or by RegisterCustomAnimGroup, returns the path (string) of the triggering KF. Returns "" everywhere else (including JSON override conditions).
ThisAnimDir
Section titled “ThisAnimDir”ThisAnimDirReturns the parent directory path (without a trailing backslash) of ThisAnim, or "" when called outside a text-key or custom-group script. Useful for loading sibling files next to the running KF.
string_var sSoundAnimlet sSoundAnim := ThisAnimDir + "\overlay.kf"Settings
Section titled “Settings”These commands read and change kNVSE.ini settings for the current session only (changes are not saved to kNVSE.ini).
Pass either the full INI key ("bBlendSmoothing") or its short name without the type prefix and optional Fix prefix ("BlendSmoothing", "SpineBlendBug" for bFixSpineBlendBug). Names are case-insensitive. See Settings for the full list of keys and when each takes effect:
- Live and NewAnimations settings apply immediately (or for newly loaded animations).
- RestartToEnable settings apply immediately when set to
"0", and wait for a restart when turned back on ("1"). - Restart settings keep their active value for the rest of the session; edit
kNVSE.inior use the in-game menu instead.
GetkNVSESetting
Section titled “GetkNVSESetting”GetkNVSESetting sName:stringReturns the currently active numeric value of the setting (1 or 0 for toggles), or 0 if the setting does not exist or is a string setting.
if GetkNVSESetting "bBlendSmoothing" ; blend smoothing is activeendifSetkNVSESetting
Section titled “SetkNVSESetting”SetkNVSESetting sName:string sValue:stringSets sName to sValue (passed as a string). For numeric settings, out-of-range values are clamped to the setting’s allowed range. For string settings (such as sLegacyAnimTimePaths), any string is accepted and applied immediately. Returns 1 if accepted, or 0 if the setting does not exist or a numeric setting received a non-numeric value.
SetkNVSESetting "bFixOverlappingBlends" "0"SetkNVSESetting "fBlendSmoothness" "0.5"kNVSEToggleSetting
Section titled “kNVSEToggleSetting”kNVSEToggleSetting sFeatureName:stringToggles a boolean (b*) setting and returns the active value (1 or 0) after toggling. Returns 0 for unknown or non-boolean settings.
kNVSEToggleSetting "OverlappingBlends"Miscellaneous
Section titled “Miscellaneous”ForceFireWeapon
Section titled “ForceFireWeapon”ref.ForceFireWeaponForces the actor to fire its equipped weapon once.
playerRef.ForceFireWeaponCanFireWeapon
Section titled “CanFireWeapon”ref.CanFireWeaponReturns 1 if the actor is currently allowed to fire its weapon (checking menu state, stagger, paralysis, knockout, sitting, death, active aim transitions, allowAttack, interruptLoop, and related weapon state checks), or 0 otherwise.
if playerRef.CanFireWeapon playerRef.ForceFireWeaponendifEjectWeapon
Section titled “EjectWeapon”ref.EjectWeaponEjects a shell casing from the actor’s equipped ranged weapon, matching the weapon’s Eject text key. Does nothing for melee or unarmed weapons. Always returns 0.
playerRef.EjectWeaponEraseCurrentAnimAction
Section titled “EraseCurrentAnimAction”ref.EraseCurrentAnimActionResets the actor’s current animation action (such as attack or reload) to none.
playerRef.EraseCurrentAnimActionGetDirectoryFiles
Section titled “GetDirectoryFiles”GetDirectoryFiles sPath:string [archiveType:int]Returns an array of file paths matching the wildcard pattern sPath, searching both loose files and loaded BSAs. sPath is relative to the game folder (Data\ is prepended automatically if omitted), and returned paths keep the prefix you passed.
archiveType is an optional bitmask filtering which BSA types to search (default searches all): 1 meshes, 2 textures, 4 menus, 8 sounds, 16 voices, 32 shaders, 64 trees, 128 fonts, 256 misc.
array_var aFileslet aFiles := GetDirectoryFiles "meshes\characters\_male\mymod\*.kf" 1