ReplaceAnimationLibrarySequence: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
Line 27: | Line 27: | ||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
[[SetPlayerAnimation]] | * [[SetPlayerAnimation]] | ||
* [[ReplaceObjectModelMesh]] |
Revision as of 17:43, 28 August 2020
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)