ReplaceAnimationLibrarySequence

From Onset Developer Wiki
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. To add a new animation use an id lower than 1000.
  • 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