I'm currently working on a quick thing where players flinch when they're shot, respective to where they were shot.
I use ply:GetSequenceActivity(ply:LookupSequence("name_here")) to get the respective sequence, then net.Broadcast don't tell me how expensive this is the returned int, so that every player can see it.
The problem I'm running into is that it seems to be highly inconsistent.
On a singleplayer game, all flinches and animations work correctly with bots and myself.
On a listen server, all flinches work correctly with bots and players.
On a dedicated server (TTT anyway), bots will sometimes play an entirely wrong gesture, but it's never the same case. At first, a leg shot made them sit down for a second. Then, a leg shot made them give a thumbs-up and a left-arm shot made them sit down for a second. All other flinches worked correctly. I haven't been able to test it with players yet.
I'm using default playermodels, and the following provided animations:
ACT_FLINCH_HEAD
ACT_FLINCH_STOMACH
ply:GetSequenceActivity(ply:LookupSequence("flinch_shoulder_l"))
ply:GetSequenceActivity(ply:LookupSequence("flinch_shoulder_r"))
ply:GetSequenceActivity(ply:LookupSequence("flinch_01"))
ply:GetSequenceActivity(ply:LookupSequence("flinch_02"))
then using
ply:AnimRestartGesture( GESTURE_SLOT_FLINCH, gest, true )
to play it.
The wiki claims that LookupSequence returns an int that will differ for models with same sequence names," but I've been using the same model for all tests, giving all of those different results.
[Lua] util.AddNetworkString( "DoPlayerFlinch" ) hook.Add( "Sc.. <== server-side
[Lua] net.Receive( "DoPlayerFlinch", function(len) local ges.. <== client-side
So what's the deal with all of this? Am I using some wrong functions?
Any help is appreciated, and if you need any more info, I'll provide it.
Things to try:
Use ACT_ enums for all of them, not just head and stomach.
https://files.facepunch.com/forum/upload/1804/e8d07ee0-4cf7-475c-979a-c288bafcfe54/image.png
http://wiki.garrysmod.com/page/Enums/ACT
Force all players on the server at all times to have one player model and see if it is different.
I tried using those before, and they just didn't play anything. That might've been before I tidied some things up, though...I'll try those now.
And the one time I tested with a couple of bots (which I think may be the culprit?), everyone had the same model, and the same problems.
I'll test more stuff thoroughly when I can, and report back.
https://github.com/robotboy655/gmod-animations/blob/1ec11d7d92f23fe1359319421301ea0f97eb24d5/gm_sequences.qci#L174-L184
Looking at this the flinch animation acts are not in a good spot. Seems we have some missing enums for this.
So is there nothing I can do about this issue right now?
Sorry, you need to Log In to post a reply to this thread.