ReplaceAnimationLibrarySequence: Difference between revisions

From Onset Developer Wiki
Created page with "{{Info|Function|Client|1.2.2}} {{FuncDescription|Replaces or adds a new animation sequence in the animation library. These affect the animations that can be set with SetPla..."
 
No edit summary
Line 8: Line 8:
{{FuncParam|AnimationId|The animation id as an integer, see [[AnimationList]].}}
{{FuncParam|AnimationId|The animation id as an integer, see [[AnimationList]].}}
{{FuncParam|PathToNewAnimiation|Path to your animation sequence asset.}}
{{FuncParam|PathToNewAnimiation|Path to your animation sequence asset.}}
{{FuncParam|LoopCount|How often this animation will repeat. If you want an infinite amount just use 99999. Default: '''1'''}}
{{FuncParamOptional|LoopCount|How often this animation will repeat. If you want an infinite amount just use 99999. Default: '''1'''}}
{{FuncParam|bLayeredBlendSpine|Whether this animation should be blended around the spine_02 bone. If this is true the animation will only play above the spine_02 bone. So the player will be able to walk around. For example for "phone calling" animation, this should be '''true'''. Default: '''false'''}}
{{FuncParamOptional|bLayeredBlendSpine|Whether this animation should be blended around the spine_02 bone. If this is true the animation will only play above the spine_02 bone. So the player will be able to walk around. For example for "phone calling" animation, this should be '''true'''. Default: '''false'''}}


{{FuncReturnValue|Returns '''true''' if it was successfully added.}}
{{FuncReturnValue|Returns '''true''' if it was successfully added.}}

Revision as of 13:57, 14 August 2020

ReplaceAnimationLibrarySequence

Type: Function
Context: Client
Introduced: v1.2.2

Description

Replaces or adds a new animation sequence in the animation library. These affect the animations that can be set with SetPlayerAnimation

Syntax

ReplaceAnimationLibrarySequence(AnimationId, PathToNewAnimiation [, LoopCount, bLayeredBlendSpine] )

Parameters

  • AnimationId
    The animation id as an integer, see AnimationList.
  • PathToNewAnimiation
    Path to your animation sequence asset.
  • LoopCount (optional)
    How often this animation will repeat. If you want an infinite amount just use 99999. Default: 1
  • bLayeredBlendSpine (optional)
    Whether this animation should be blended around the spine_02 bone. If this is true the animation will only play above the spine_02 bone. So the player will be able to walk around. For example for "phone calling" animation, this should be true. Default: false

Return Value

  • Returns true if it was successfully added.

Example

function OnPackageStart()
	local pakname = "AnimMod"
	local res = LoadPak(AnimMod, "/AnimMod/", "../../../TestProject/Plugins/AnimMod/Content/")
	AddPlayerChat("Loading of "..pakname..": "..tostring(res))

	res = ReplaceAnimationLibrarySequence(42, "/AnimMod/A_PhoneCall", 99999, true)
	AddPlayerChat("ReplaceAnimationLibrarySequence: "..tostring(res))
end
AddEvent("OnPackageStart", OnPackageStart)

See also

SetPlayerAnimation