Been searching for an hour to do this (No joke, I timed it) and I wasn't able to find any real answer. Every old thread just ended abruptly with no answer or just tells the poor guy that asked the question to go in the source code and find how it works, and at that point the poor guy just gives up.
I just need to know what all that Sequence, Gesture, ACT, Slots mumbo jumbo is all about. The animation I'm trying to play is that of a player getting up, exactly like this (Timestamped):
https://youtu.be/S772CDUuF8A?t=15
Also I'm hoping there's a way to control the speed of the animation too, I think I saw something like that but all examples I've seen were on entities and not players, bonus coins if someone can clear me up on that.
The sitting/standing sequences are called "idle_to_sit_ground" and "sit_ground_to_idle". I am not sure if these exist in the player's animation file or just the mossman model. You can override a player's animation by returning the activity/sequence numbers using a GM/CalcMainActivity hook. You can set the animation speed with Entity/SetPlaybackRate in a GM/UpdateAnimation hook, then returning something to prevent the base gamemode from overriding your speed.
If this is for a gamemode, considering implementing this PR to make the above process less hacky. Specifically, you can use Player:DoCustomAnimEvent with PLAYERANIMEVENT_CUSTOM_SEQUENCE, and a CalcPlaybackRate hook.
I'm using this page here to find emotes https://wiki.garrysmod.com/page/Enums/ACT but most of them (Like 95%) are just T-Posing.
hook.Add("CalcMainActivity", "TesterinoHAHAHAHA", function(ply, vel)
return ACT_WALK, -1
end)
Here's just one example ^^
It's because most ACT enums available on players are contain HL2MP. You can see all valid activities by either decompiling m_anm.mdl in the Garry's Mod VPK or run this code in single-player:
local pEntity = Entity(1)
for i = 0, pEntity:GetSequenceCount() - 1 do
print(pEntity:GetSequenceName(i), pEntity:GetSequenceActivityName(i))
end
Sequences without an attached activity will probably return ACT_INVALID.
Nice, I'll leave some tags for future reference and people trying to find a solution like I did.
GMOD LUA ANIMATION HOW TO DO ANIMATION HELP ANIMATE PLAYER OVERRIDE ANIMATIONS PLAY ANIMATIONS PLAY ACT GESTURE SEQUENCE
Sorry, you need to Log In to post a reply to this thread.