Creating Timescale Per Player

Hello,

I am looking to see if there is any easy way to create (or simulate) a timescale for a player that is independent of the server. game.SetTimeScale works fine but unfortunately it will set the entire servers timescale (obviously) and I am looking to essentially make slow motion on a per player basis.

I am curious to see if there are any simple methods to do this that I have not uncovered yet. Otherwise I assume I will just have to create it in a move hook and hope for the best.

Thanks!

What do you expect to happen other players while only one player uses slow motion?

[editline]29th May 2015[/editline]

How do you expect the slow motion user to see the prop physics? How do you expect the non slow motion users see the props?

( What you are asking is impossible due to common sense )

One person controlling everyone else’s timescale is impossible for more than 2 players. However each person controlling their own timescale, and the props they own, could be entirely possible. Heck if it wasn’t possible, how do we have speed hackers (changing just thair own timescale, not including props and shit).

Could be doable.

I really just need players movement to be in slow motion in a simple way. I know this is entirely possible using move data but am wondering if anyone else has done this… All I need is player movement not props or anything.

A simple way to explain this would be I need someones movements that would happen in lets say 4 ticks to be spread out to 16 ticks while still maintaining smoothness. There are a lot of maps that employ this and I am curious if there is a function I am missing or its just an entity that they are using.

If there is no way to do this other than writing my own movement then I got what I needed from this thread.

Speed hackers do it by forcing the timescale convar on their client which cant be done normally so it cant apply to this situation (Unless I had everyone use a bypasser…).

This is 100% possible I am just trying to see what others have done and if there are simpler ways of doing this before I waste my time.

The simplest way for this would be to edit the player’s m_flLaggedMovementValue.
You currently cannot do this without a server-side module. However, I would be willing to write a simple module for this on Friday if you want me to.
I made a request here for this.

[editline]29th May 2015[/editline]

If you have a Lua port of CGameMovement, you can simply do this:
[lua]
_P = debug.getregistry().Player

function _P:SetMovementScale(f)
self:SetNWFloat(“movement_scale”, f)
end

function _P:GetMovementScale()
return self:GetNWFloat(“movement_scale”, 1)
end

__OLDFRAMETIME = __OLDFRAMETIME or FrameTime
local function newFrameTime()

end
hook.Add(“SetupMove”, “movement_scale_setup”, function(ply, mv, cmd)
FrameTime = function()
return __OLDFRAMETIME * ply:GetMovementScale()
end
end)

hook.Add(“FinishMove”, “movement_scale_finish”, function(ply, mv)
FrameTime = __OLDFRAMETIME
end)
[/lua]

Sure as hell you can control your own player speed, but what about the rest of the world?

If all you need is player movement, you can just simply set their movement speed or something like that.

I think that’s what we wants, coupled with slow animations and slower weapons etc.
In any case, it is doable to a ‘certain extent’.

Wouldn’t Player:SetSaveValue( “m_flLaggedMovementValue”, 1 ) work?

I dont think you understand that changing the player speed will not change their air speed and etc… I need a full movement simulation.

As for the c module, if you have a little code snippet I can finish and compile it.

He just wants a specific player’s movement to be slowed down. Nothing else.

[editline]29th May 2015[/editline]

Wow, what a magical function. I didn’t know it could be used to access these networked class members, that’ll save me a TON of work. Yes, it does work perfectly, Thank you!

Will see if the function works for my uses when I get time to test it.

I’m assuming you host a bhop/surf server or something of the sorts. If so, then this is exactly what you’re looking for.