• Changing player movement acceleration and deceleration
    2 replies, posted
Hey (first post). I'm looking to modify the acceleration values for my future TTT server. I want the movement to feel snappier, so I want to decrease the time it takes to speed up/slow down when you use/release your movement keys. My assumption is that this is specified in the base lua files somewhere, but I can't find it. Would I have to create a custom script to modify this? Any help with this is much appreciated <3
You should be able to modify that with server values which are already available through the console. sv_friction sv_accelerate sv_airaccelerate However, if you can't get exactly the desired behaviour, then the function you're likely looking for is [url=http://wiki.garrysmod.com/page/GM/Move]GM:Move[/url] You want this to be in a shared file. I don't know if TTT already uses this function somewhere. [url=https://ghostbin.com/paste/apgdo]Here's some sample code[/url] you can reference from a gamemode I made a while ago, where I completely overwrote the movement. (Major props to the Quake 3 Arena gamemode for that Accelerate function - I used to not understand how to do this sort of stuff, but I learned a lot from that addon!) I'm not a very good coder, so forgive me if there's anything sub-optimal or poorly written - it should help you understand the gist. You should be able to fine tune the movement here, but you will want to set air acceleration and ground acceleration + friction to 0 first.
Oh cheers, those sv commands were exactly what I was looking for. Thanks for the code too, I'll have a look through and maybe learn a few things from it &#128077;
Sorry, you need to Log In to post a reply to this thread.