Currently, I’m working on a mod to redesign and rebalance some of the basic mechanics of TTT, because the existing shooting mechanics are honestly just plain bad. I’ve made a lot of progress, but there’s a few things I’ve ran into I can’t seem to figure out and which I can’t seem to find by searching.
self:SetJumpPower() seems to work a little unexpectedly.
Obviously, how high you actually go on the jump will depend on the gravity in the server, that’s a given. However, setting sv_gravity doesn’t appear to take full effect on jumppower until after restarting the server. It still has SOME effect without restarting, the gravity is clearly higher, yet the jump is far too high. On an actual hosted server, not even restarting it appears to fix it.
Two things with this. For one, player max speed appears to be affected by sv_accelerate, but only if it’s under 8.
If it’s under 8, actual max speed seems to be given by the formula maxspeed0.125sv_accelerate.
I did get a patchwork fix for this in my code in the form of this:
But it’s not very pretty, and I can’t seem to figure out how to actually call the var, so I just wrote the number instead. If this really is the only way to do it, could anyone tell me how to actually call the var for it?
Second off, I’m struggling to figure out how to actually set shiftwalking speed.
SetWalkSpeed appears to simply set your normal walking speed. SetCrouchedWalkSpeed obviously sets your crouch multiplier, and SetRunSpeed doesn’t appear to do anything discernible to me. Shiftwalking speed, I’m struggling to figure out if does anything at all, at least in this mode, and I couldn’t find anything online. Any tips?
Viewmodels generally seem to work alright, but particularly the M4 and USP’s seems to break very easily.
The M4’s is off centre until I fire at least one bullet. It gets reset to the broken state on deploy or reload.
The USP’s silencer simply disappears after the first shot.
Server sided stuff
This might be beyond my programming ability, but does anyone have any pointers on how to deal with server/client being out of sync when shooting?
Basically, while client side prediction is fine for bulletholes, I’d like to at least have bloodsplatter only appear when it’s a confirmed hit by the server.
I use fairly buck-standard SWEP with my own custom recoil system(first based it on this guy’s recoil system, but it basically has no resemblance at this point, beyond sharing a few variable names). My base is at the bottom, but do note that it is EXTREMELY messy, basically uncommented and not quite finished yet. I need to clean it up and comment it at some point, but today is not that day.