Text keys
Text keys are timed markers stored in a KF file’s NiTextKeyExtraData block. In NifSkope, each entry in the Text Keys array has a Time (in seconds from the start of the animation) and a Value (the key text).
Fallout: New Vegas already uses text keys such as Start, End, Hit, Eject, Attach, Detach, Blend:, m:, a:, and prn:. kNVSE adds new text keys and extends a few vanilla keys.
Examples on this page write each key as time: value:
0.0: Start0.5: loadAmmo1.2: EndGeneral rules
Section titled “General rules”- Match the spelling and capitalization shown below. While kNVSE parses several keys case-insensitively, some checks are strictly case-sensitive (including
noFix,noBlendSmoothing,allowFirstPerson,allowClampInLocomotion,fDestFrame, and parts ofrespectEndKey,noBlend, andinterruptLoop). - Stay under 260 characters per key. Any text key longer than 259 characters crashes the game when the KF loads. This is a game engine limit.
- Timed keys trigger on playback. Keys that act at a timestamp (
Script:,scriptLine:,SoundPath:,loadAmmo,unloadAmmo, andburstFireHit/Ejectkeys) fire when playback reaches that timestamp and fire again each time a looping animation wraps around. Keys placed before the animation’s starting time do not fire. - Editing keys from scripts:
SetAnimTextKeys,AddAnimTextKey, andRemoveAnimTextKeymodify a KF’s keys at runtime for future plays (plays already running keep their original keys). Note thatAddAnimTextKeyandRemoveAnimTextKeydo not re-parse vanilla engine keys (Start,Hit,End),weaponSpaceis cached until the weapon reloads, andblendToReloadLoopremains active for the session once used.
Argument syntax
Section titled “Argument syntax”kNVSE keys with arguments use one of two formats:
- Flexible-argument keys (
aimPitch,weaponSpace,spawn,despawn,blendCurve,blendInCurve,blendOutCurve,loadAmmo,unloadAmmo,anchor,anchorTo):- Format:
nameorname: arg1, arg2, ... - The colon is optional (
loadAmmo 2andloadAmmo: 2are identical), and spaces around the colon or commas are ignored.
- Format:
- Colon-prefix keys (
Script:,scriptLine:,SoundPath:):- The colon must appear immediately after the key name with no space before it (
Script: MyFunc, notScript MyFunc).
- The colon must appear immediately after the key name with no space before it (
Timing and blending
Section titled “Timing and blending”respectEndKey
Section titled “respectEndKey”Use respectEndKey (or its alias respectTextKeys) in a player 1st-person animation so that the 1st-person KF controls action timing and blend times while in 1st person.
By default, Fallout: New Vegas drives firing, reloading, drawing, and holstering timing from the 3rd-person animation even when the player is in 1st person. If your 1st-person KF has different Hit, Eject, Attach, Detach, or End times than the 3rd-person KF, gameplay events will be out of sync with the 1st-person visuals. Adding respectEndKey copies the 1st-person KF’s key times and blend times to the player’s 3rd-person animation while in 1st person. NPCs and 3rd-person play are unaffected.
0.0: Start0.0: respectEndKey0.4: Hit0.5: Eject0.9: EndkNVSE can automatically repair common mistakes in respectEndKey KFs; see bFixWrongAKeyInRespectEndKeyAnim, bFixWrongPrnKey, and bFixMissingPrnKey.
respectTextKeys
Section titled “respectTextKeys”Alias for respectEndKey.
noBlend
Section titled “noBlend”Disables blending both into and out of the animation so it cuts immediately, and disables blend smoothing on that animation (just like noBlendSmoothing). Works for any actor in 1st and 3rd person.
0.0: Start0.0: noBlend1.0: EndnoBlendSmoothing
Section titled “noBlendSmoothing”Opts an animation out of bBlendSmoothing and fBlendSmoothness so it uses vanilla engine blending. Use this on animations that depend on vanilla blend behavior.
0.0: Start0.0: noBlendSmoothing1.0: EndUnless a KF contains noFix, kNVSE automatically adds noBlendSmoothing to:
meshes\characters\_1stperson\locomotion\male\pipboy.kfmeshes\characters\_1stperson\locomotion\female\pipboyfemale.kf- Any KF whose path contains
B42Inject,B42Interact, orpipboyholopanel_animations
blendCurve
Section titled “blendCurve”Sets the easing curve for blending both into and out of the animation (by default, the game blends at a constant rate). Works with or without bBlendSmoothing.
blendCurve: <curve>Available <curve> values (case-insensitive):
| Curve | Shape |
|---|---|
default |
Vanilla engine blend (affected by fBlendSmoothness). |
linear |
Strictly linear blend (bypasses fBlendSmoothness). |
smooth |
Smoothstep (slow start and slow end). |
inSine, inQuad, inCubic, inQuart, inExpo, inCirc |
Slow start, fast end. |
outSine, outQuad, outCubic, outQuart, outExpo, outCirc |
Fast start, slow end. |
inOutSine, inOutQuad, inOutCubic, inOutQuart, inOutExpo, inOutCirc |
Slow start and slow end. |
bezier x1 y1 x2 y2 |
Cubic Bézier curve (same parameters as CSS cubic-bezier()). Each value must be between 0 and 1; commas between values are optional. |
Overshooting curves (elastic, back, bounce) are not supported. An unrecognized curve name or missing argument is logged to kNVSE.log and ignored.
How curves are chosen:
- You can place multiple curve keys along an animation’s timeline. Each key stays in effect from its timestamp until the next curve key for that direction.
- When a blend starts, kNVSE checks the key active at the animation’s current timestamp. For example, placing
blendOutCurvenear the end of a reload affects the normal end of the reload, without affecting an early reload cancel. - During a transition between two animations, the incoming animation’s
blendInCurve(orblendCurve) takes precedence over the outgoing animation’sblendOutCurve(orblendCurve).
0.0: Start0.0: blendInCurve: bezier 0.25, 0.1, 0.25, 10.0: blendOutCurve: outQuad1.5: blendOutCurve: inOutSine2.0: EndblendInCurve
Section titled “blendInCurve”Same as blendCurve, but only applies when blending into the animation. If placed at the same timestamp as a blendCurve key, blendInCurve takes precedence.
0.0: blendInCurve: outCubicblendOutCurve
Section titled “blendOutCurve”Same as blendCurve, but only applies when blending out of the animation. If placed at the same timestamp as a blendCurve key, blendOutCurve takes precedence.
0.0: blendOutCurve: inOutQuadblendToReloadLoop
Section titled “blendToReloadLoop”Place blendToReloadLoop in a looping reload’s start animation (ReloadWStart through ReloadZStart) to prevent the engine from briefly cutting back to the aim pose between the start animation and the reload loop. kNVSE already does this for every looping reload while bBlendSmoothing is on, so the key only matters with it off. For the player in 1st person, placing this key in the 1st-person reload start covers the 3rd-person skeleton as well.
0.0: Start0.0: blendToReloadLoop0.6: EndfDestFrame
Section titled “fDestFrame”Sets the starting timestamp (in seconds) that the animation jumps to the next time the engine blends into it via BlendFromPose. Put the target frame time in the text key’s Time field.
fDestFrame is one-shot: once consumed by a blend, kNVSE resets its timestamp so subsequent plays start normally. This key is most commonly managed from scripts using SetAnimDestFrame.
0.45: fDestFrameWeapons and ammo
Section titled “Weapons and ammo”allowAttack
Section titled “allowAttack”Lets the player fire again before the current animation finishes. Once playback passes the allowAttack timestamp (while the animation is actively playing, not blending in or out), the player can attack to interrupt the rest of the animation.
Applies to the player only, using the KF for the currently active camera view. If multiple allowAttack keys exist in the KF, the first one is used.
0.0: Start0.6: allowAttack1.2: EndinterruptLoop
Section titled “interruptLoop”Place interruptLoop in an automatic weapon’s AttackLoop or AttackLoopIS animation (player only) so the loop does not have to play to its end before the next shot or a reload can start:
- Once the animation has played for the weapon’s shot interval, the player can fire again or reload immediately.
- When the magazine reaches 0 rounds, the player returns directly to aiming instead of finishing the loop.
0.0: Start0.0: interruptLoop0.4: EndburstFire
Section titled “burstFire”Place burstFire in an attack animation to fire a shot at every Hit key and eject a casing at every Eject key, rather than only the first of each.
- Works for both the player (using the active camera view’s KF) and NPCs.
- Firing stops automatically if the magazine runs empty or a reload starts (unless the player is in god mode).
- Any additional
Hitkey placed after the last extraEjectkey ejects its own casing automatically. If the KF has only oneEjectkey total (handled by the engine for the first shot), every subsequentHitkey ejects its own casing.
Example of a 3-round burst animation:
0.00: Start0.00: burstFire0.10: Hit0.15: Eject0.20: Hit0.25: Eject0.30: Hit0.35: Eject0.60: EndIn addition to standard attack timing and burstFire, kNVSE reads Hit in automatic weapon attack loops (AttackLoop, AttackLoopIS, and their Up/Down variants) to support open-bolt weapons:
- The first shot of a burst is held until the attack loop reaches the
Hitkey. - Subsequent shots in the same burst follow at the weapon’s normal fire rate.
- Works for both the player (active camera view) and NPCs.
0.00: Start0.08: Hit0.20: EndIn addition to standard casing ejection and burstFire, kNVSE reads Eject in automatic weapon attack animations (when burstFire is not present) to synchronize shell casing ejection with the animation:
- Instead of ejecting immediately when a shot fires, kNVSE delays casing ejection until the animation reaches the
Ejectkey (wrapping around the loop ifEjectis earlier in the loop than the shot). - Works for both the player (active camera view) and NPCs.
0.00: Start0.05: Eject0.15: EndloadAmmo
Section titled “loadAmmo”Loads rounds into the actor’s magazine at the key’s timestamp. Works for the player and NPCs, and can be used in reload or non-reload animations.
loadAmmoloadAmmo: <rounds>loadAmmo(no argument) fills the magazine to capacity, or to the total matching ammo carried if that is lower.loadAmmo: <n>addsnrounds (a positive whole number), up to magazine capacity and carried ammo.
Rounds loaded into the magazine are part of the actor’s carried ammo, so total inventory ammo count does not change. For the player, only the keys from the camera view active when the animation started take effect (switching POV mid-reload does not switch key sets).
Behavior in reloads:
- Standard reloads: Adding a
loadAmmokey stops the game from refilling the magazine at the start of the reload. If the reload is cancelled before theloadAmmotimestamp, the magazine keeps its previous count. - Looping reloads (shotguns, lever-action rifles): Placing
loadAmmoin the shell-insertion loop replaces the game’s default 1-round load. For example,loadAmmo: 3loads 3 rounds per animation loop. For NPCs, looping reloads requirebFixNPCLoopingReloads.
0.0: Start1.1: loadAmmo1.6: EndunloadAmmo
Section titled “unloadAmmo”Removes rounds from the actor’s magazine at the key’s timestamp. The removed rounds remain in the actor’s inventory.
unloadAmmounloadAmmo: <rounds>unloadAmmo(no argument) empties the magazine to 0.unloadAmmo: <n>removesnrounds (clamped at 0).
Note that unloadAmmo by itself does not suppress the game’s start-of-reload magazine refill. Pair it with loadAmmo in reload animations.
Example of dropping the old magazine at 0.3s and inserting the new one at 1.1s:
0.0: Start0.3: unloadAmmo1.1: loadAmmo1.6: EndweaponSpace
Section titled “weaponSpace”Overrides automatic hand detection for bFixWeaponHandBlend from the key’s timestamp until the next weaponSpace key. Requires both bBlendSmoothing and bFixWeaponHandBlend.
weaponSpace: right|left|body|auto|off| Value | Meaning |
|---|---|
right |
Weapon is held by the right hand. |
left |
Weapon is held by the left hand. |
body |
Weapon is held by neither hand (blend relative to the body, useful for tosses or hand-offs). |
auto |
Resume automatic hand detection (the default before the first key). |
off |
Opt this animation’s share of any blend out of bFixWeaponHandBlend. |
right, left, and body require the KF to contain left-hand bone tracks; off works on any animation.
Example of a reload where the left hand holds the rifle while the right hand works the bolt:
0.0: Start0.2: weaponSpace: left0.9: weaponSpace: right1.4: EndScripts and sounds
Section titled “Scripts and sounds”Script:
Section titled “Script:”Calls a user-defined function (UDF) script on the actor at the key’s timestamp. The colon must immediately follow Script.
0.5: Script: MyReloadCallbackThe script is looked up by its EditorID. If the EditorID does not exist or is not a script, kNVSE logs an error and ignores the key.
Inside the called script, you can use ThisAnim and ThisAnimDir to get the playing KF’s path and folder.
Player 1st/3rd-person behavior: Because the player plays both a 1st-person and 3rd-person animation at the same time, keys in the hidden view only fire if the currently visible view’s animation has no Script: keys of its own. This avoids firing the script twice while letting 1st-person-only or 3rd-person-only KFs still trigger their scripts in either view.
scriptLine:
Section titled “scriptLine:”Compiles and runs inline NVSE script code on the actor at the key’s timestamp. The colon must immediately follow scriptLine.
0.5: scriptLine: ModAV Variable01 10.9: scriptLine: if GetAV Variable01 > 5%r SetAV Variable01 0%rendif1.0: scriptLine: Print %qReload finished%q- Use
%rfor a line break and%qfor a double quote ("). - Local variable declarations (
ref rActor,int iCount, etc.) cannot be used inscriptLine:; call a UDF withScript:instead if you need local variables. - Keep the entire text key under 260 characters.
- Compile errors are logged to
kNVSE.log. - Uses the same player 1st/3rd-person fallback rule as
Script:(tracked independently fromScript:).
SoundPath:
Section titled “SoundPath:”Plays a sound file or a random sound from a folder at the key’s timestamp. The colon must immediately follow SoundPath.
0.3: SoundPath: fx\wpn\mymod\magout.wav1.0: SoundPath: fx\wpn\mymod\magin- Paths are relative to
Data\Sound\. - Specify a
.wavor.oggfile directly, or omit the extension to treat the path as a folder (kNVSE picks a random.wavor.oggfrom that folder when the animation starts). - For the player in 1st person, the sound plays in 2D (non-positional); in 3rd person and for NPCs, it plays in 3D at the actor’s position. For the player, only the visible camera view plays
SoundPath:keys.
Movement and aim transitions
Section titled “Movement and aim transitions”When bMovementTransitions or bAimTransitions plays a _start or _stop transition KF, the vanilla End text key marks the handover point:
- A walk/run
_startanimation transitions into the walk/run cycle atEnd. - A walk/run
_stopanimation blends into the idle animation atEnd. - An aim
_startor_stopanimation transitions into the target aim animation atEnd.
If an aim transition plays backwards (because the player toggled aim partway through), timed kNVSE keys (SoundPath:, Script:, scriptLine:, loadAmmo, unloadAmmo, burstFire) are skipped while playing in reverse.
allowFirstPerson
Section titled “allowFirstPerson”Allows a 3rd-person walk/run _start or _stop animation to play on the player’s 3rd-person skeleton while the player is in 1st person.
By default, kNVSE skips 3rd-person movement transitions in 1st person so their root motion does not shift the camera unexpectedly when the 1st-person arms do not animate with them. Transition KFs in _1stperson folders do not need this key.
0.0: Start0.0: allowFirstPerson0.4: EndallowClampInLocomotion
Section titled “allowClampInLocomotion”Allows a movement override (Forward through TurnRight) exported with the Clamp cycle type to load and play as a looping animation. Normally, kNVSE rejects non-looping movement overrides (except _start and _stop transitions, which allow Clamp automatically).
0.0: Start0.0: allowClampInLocomotion0.8: EndaimPitch
Section titled “aimPitch”Rotates spine bones on a 3rd-person skeleton to follow the actor’s vertical aim pitch, so a single animation can aim up and down without separate Up/Down KFs. Requires bBlendSmoothing. Applies to 3rd-person skeletons only (player in 3rd person and NPCs).
aimPitchaimPitch: <bone> <share>, <bone> <share>, ...- Without arguments, kNVSE splits the pitch evenly (
1/3each) acrossBip01 Spine,Bip01 Spine1, andBip01 Spine2. - With arguments, list up to 16
<bone> <share>pairs separated by commas. The last space-separated word in each entry is the numeric share, so bone names containing spaces work naturally. Shares summing to less than1.0rotate the upper body by a fraction of the actor’s pitch. - Only the first
aimPitchkey in a KF is read. - 3rd-person aim
_start/_stoptransitions automatically apply defaultaimPitchunless they define their ownaimPitchkey.
0.0: Start0.0: aimPitch: Bip01 Spine1 0.5, Bip01 Spine2 0.50.5: EndVanilla movement morph keys (such as m:L and m:R marking left and right foot plants) keep footsteps synchronized when switching between movement animations.
With bBlendSmoothing enabled, bFixMovementMorphKeys keeps m: sync working whenever two looping movement animations contain the same set of m: keys, even if they animate different numbers of bones or begin on different m: keys.
0.00: Start0.15: m:L0.55: m:R0.80: EndSkeleton nodes
Section titled “Skeleton nodes”Temporarily attaches a NIF mesh or a copy of an existing node from the actor’s 3D (such as a weapon’s ##Clip magazine) during an animation, without editing weapon NIFs or skeleton files. Works for the player in both 1st and 3rd person; NPCs play the animation without spawning the mesh.
spawn: <bone>, <mesh>[, <parent>]<bone>: Name of the node to attach the mesh to.- If the skeleton does not already have a node with this name, kNVSE adds a new bone as a child of
<parent>(default:Weapon). Your KF can animate this bone by name just like any regular skeleton bone, relative to<parent>. If the KF has no animation track for<bone>, the mesh stays at<parent>’s origin. - If the skeleton already has an
NiNodewith this name (such asBip01 L Hand), kNVSE attaches the mesh directly to that existing node.
- If the skeleton does not already have a node with this name, kNVSE adds a new bone as a child of
<mesh>: Either a.nifpath relative toData\Meshes\(for example,Weapons\2HandAutomatic\ServiceRifle.nif) or the exact name of an existing node on the actor’s 3D to clone (for example,##Clip).<parent>: Optional parent bone name when creating a new bone. Defaults toWeapon.
Visibility follows the animation’s playback time: nothing appears before the first spawn key, and the latest spawn or despawn key for that bone at or before the current timestamp decides what is shown. Spawning a new mesh on the same bone replaces the previous one. All spawned meshes are automatically removed when the animation ends or is interrupted, and reappear if the animation loops or restarts.
(Note: If you add a new spawn bone at runtime using SetAnimTextKeys, the bone’s KF track will only begin moving after the player next equips a weapon; until then the mesh sits at its parent’s origin.)
Example of spawning a fresh copy of the weapon’s magazine in the left hand during a reload:
0.0: Start0.4: spawn: NewMag, ##Clip, Bip01 L Hand1.2: despawn: NewMag1.6: Enddespawn
Section titled “despawn”Hides the mesh spawned on <bone> by spawn from this timestamp onward.
1.2: despawn: NewMaganchor
Section titled “anchor”Stabilizes partial-skeleton animations played on top of other animations (for example, a left-arm animation played with ActivateAnim over weapon idles). Because different weapons bend the spine and neck differently, a partial left-arm KF that does not key the spine normally shifts position depending on the equipped weapon. anchor compensates for that spine/neck movement so the listed bones stay in their authored position relative to a reference bone.
Requires bBlendSmoothing. Works for the player (1st and 3rd person) and NPCs.
anchor: <bone>, <bone>, ...- List the top-most keyed bone of each chain (up to 16 bones), such as
Bip01 L Clavicle. All child bones below each listed bone follow automatically. - Only the first
anchorkey in the KF is read. - Author the animation on the skeleton’s rest pose.
0.0: Start0.0: anchor: Bip01 L Clavicle0.0: anchorTo: Bip01 Spine21.0: EndanchorTo
Section titled “anchorTo”Sets the ancestor reference bone used by anchor. Only the first anchorTo key in the KF is read, and it has no effect without an anchor key.
Defaults to Bip01 Rotate, which keeps camera movement and walk/run bob affecting the anchored bones in 1st person while removing stance differences from the spine and neck.
0.0: anchorTo: Bip01 Spine2Opts a KF file out of kNVSE’s automatic KF repairs and auto-applied noBlendSmoothing. Specifically, noFix skips:
bFixEndKeyTimeShorterThanStopTimebFixWrongAKeyInRespectEndKeyAnimbFixWrongPrnKeybFixMissingPrnKeybFixWrongAnimNamebFixShortGaitBlendbFixBlendSamePriority- Automatic
noBlendSmoothingon vanilla Pip-Boy and B42 KFs
0.0: Start0.0: noFix1.0: End