Player:AnimRestartGesture not always playing the correct ACT
6 replies, posted
I've made a custom animation for a player model of mine (a custom SMD) which replaces an ACT from the ACT Enumerations and gets played by using Player:AnimRestartGesture. It plays OK but only about 50% of the time. The other 50% it plays the ACT that I overrode the animation of instead. This animation only applies to my own player model of course but I am using that player model every time. Is there any way to fix this other than opening the Gmod VPKs and recompiling the original animation there?
You might want to try posting this in the [URL="https://facepunch.com/forumdisplay.php?f=40"]modelling forum[/URL]
You cannot "override" an ACT_, ACT_ contains multiple sequences so to speak. So either play your Sequence, or select another ACT_ enum.
Ok I was pretty sure it was self.Owner:ResetSequence() that I needed after I saw that post.
I removed the activity from the .qc file so now it's just like this:
[CODE]
$Sequence "testan" {
"anims\testan.smd"
fadein 0.2
fadeout 0.2
fps 30
weightlist "my_weightlist"
}
[/CODE]
And now I'm using this to play it in my weapon's shared.lua:
[CODE]
local play_anim = self.Owner:LookupSequence( "testan" )
self.Owner:ResetSequence( play_anim, true )
[/CODE]
It does absolutely nothing... I mean it looked at what the LookupSequence was getting and it definitely got the right thing. It's funny, ResetSequence does play it if it's still tied to an ACT but then as RobotBoy655 said an ACT contains multiple sequences so I'm guessing my sequence only replaces one of those? I'd prefer to NOT override an existing ACT anyway since they are used in other places.
Those functions will not work on players due to the animations being reset every frame by the base gamemode player model animation system.
[editline]10th April 2016[/editline]
See [url]http://wiki.garrysmod.com/page/Player/AnimSetGestureSequence[/url] and [url]http://wiki.garrysmod.com/page/GM/CalcMainActivity[/url]
OK I guess I'll forget just trying to play a single sequence then.
I've got my sequence to play almost every time now by putting a ridiculously large weight on my sequence but this is really stupid.
[CODE]
activity "ACT_GMOD_GESTURE_ITEM_THROW" 9999
[/CODE]
I really don't want to have to edit the weights in the qc for m_anm.mdl in the Gmod VPKs, it's just not practical. Is there some way to change it with LUA?
No.
Sorry, you need to Log In to post a reply to this thread.