• Making the player play sequences?
    4 replies, posted
I tried making the player do custom sequences like waving but couldn't get it to work, then I found some function that it was possible to do with but I had to override all the default animations and set the crouching, walking, jumping, driving and all of those separately for the player not to do a T-pose. Is there any way to just set something like the salute sequence when still using the default walking? So far the closest I have got to making it work is restarting it every tick while at the same time setting it's start time in the animations to a little more. This is very unoptimized and with lower ticks will look extremely glitchy.
Take a look at [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/AddGesture]Entity:AddGesture[/url], [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/AddGestureSequence]Entity:AddGestureSequence[/url] and [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/AddLayeredSequence]Entity:AddLayeredSequence[/url]. Apparently a player is a [URL="http://wiki.garrysmod.com/page/BaseAnimatingOverlay"]BaseAnimatingOverlay[/URL] entity, so I think one of those should work.
[QUOTE=MPan1;52543642][img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/AddGesture]Entity:AddGesture[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/AddGestureSequence]Entity:AddGestureSequence[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/AddLayeredSequence]Entity:AddLayeredSequence[/url]. I think one of those should work.[/QUOTE] None of those work. They dont do anything at all. [editline]6th August 2017[/editline] I was able to create some more immersive and realistic movement using this code atleast: [code] hook.Add("PlayerButtonDown", "<- That does that ->", function( ply, key ) if key == KEY_P then ply:ChatPrint("Act") ply:DoCustomAnimEvent( PLAYERANIMEVENT_CUSTOM , 88 ) end end) hook.Add( "DoAnimationEvent" , "AnimEventTest" , function( ply , event , data ) if data == 88 then ply:AnimRestartGesture( GESTURE_SLOT_CUSTOM, ACT_RUN, true ) end end ) [/code] [url]https://i.gyazo.com/29793ff7bd8bca12f642d55059c97808.mp4[/url] [url]https://i.gyazo.com/747d029578222217953bdfbdc6a7b419.mp4[/url]
I have no clue why that thing doesn't seem to work. All I can say is that players have a gesture called [CODE] ply:LookupSequence( "gesture_wave" ) [/CODE] And there's also an enum for it: [CODE] ACT_GMOD_GESTURE_WAVE [/CODE] I just can't get anything to work.
Oh damn I just figured out that the code I just posted works for every single sequence. Totally gonna use the leaning back sequence when aiming with weapon in car ;)
Sorry, you need to Log In to post a reply to this thread.