ReplaceAnimationLibrarySequence

From Onset Developer Wiki
Revision as of 13:22, 14 August 2020 by BlueMountains (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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
    How often this animation will repeat. If you want an infinite amount just use 99999. Default: 1
  • 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

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