SetAnimSequenceFrequency

From GECK
Jump to: navigation, search


A function added by the JIP NVSE Plugin.

Description

Sets the Frequency (animation play speed) of the specified NiControllerSequence in the calling reference's loaded 3D model.

  • For actor animations, including idle animations, the sequence name should be a path to the animation's .kf file, including the Meshes\ sub-folder.
  • Passing "*" as the sequenceName argument will set the frequency of all the sequences to the specified value.

Syntax

[help]
reference.SetAnimSequenceFrequency sequenceName:string frequency:float 

Or:

reference.SetAnimSeqFreq sequenceName:string frequency:float

Example

objectRef.SetAnimSequenceFrequency "Forward" 1.5
objectRef.SetAnimSequenceFrequency "*" 1.5
EasyPeteRef.SetAnimSequenceFrequency "Meshes\Characters\_Male\Locomotion\Male\mtfastforward.kf" 1.5

The following is an example on how one might double an idle animation's speed:

string_var svIdleAnimPath
ref rIdleAnimation
int bDoOnce

begin GameMode

let rIdleAnimation := MTHitHeadA

if SunnyREF.IsIdlePlayingEx rIdleAnimation == 0
	SunnyRef.PlayIdleEx rIdleAnimation
elseif bDoOnce == 0
	; Okay, idle is being played, we can change the speed now.
	let svIdleAnimPath := "Meshes\" + GetIdleAnimPath rIdleAnimation
	SunnyRef.SetAnimSequenceFrequency $svIdleAnimPath 2.0
	Sv_Destruct svIdleAnimPath 
	let bDoOnce := 1
endif
end 

Notes

  • For this function to work on idle animations, it must be called while the idle is being played. Nothing will happen if you call it before the actor plays the specified idle animation. When the idle animation has stopped, the flag is cleared so you will have to call the function again when the animation is played the next time.
  • For animations on actors, if the animation does not loop it is limited by the animation's stop time. For example a sped up animation will result in the actor freezing on the last frame until the stop time has been reached.

See Also