ReplaceAnimationLibrarySequence: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|AnimationId|The animation id as an integer, see [[AnimationList]].}} | {{FuncParam|AnimationId|The animation id as an integer, see [[AnimationList]]. To add a new animation use an id lower than 1000.}} | ||
{{FuncParam|PathToNewAnimiation|Path to your animation sequence asset.}} | {{FuncParam|PathToNewAnimiation|Path to your animation sequence asset.}} | ||
{{FuncParamOptional|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'''}} |
Latest revision as of 10:33, 27 February 2021
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)