Forum

> > CS2D > Scripts > How does the move hook work
Forums overviewCS2D overview Scripts overviewLog in to reply

English How does the move hook work

3 replies
To the start Previous 1 Next To the start

old How does the move hook work

Mami Tomoe
User Off Offline

Quote
How exactly does it work?

Does it get triggered based on server ticks? Or client frames?
Does it have a cap of some sort?
Does speed modifications influence how many times it can trigger per X duration?

Does -25 speedmod vs 100 speedmod affect how fast my move hook will trigger?
Does a player with 100 speedmod trigger it more often?
From my experience, speedmod has no impact, so does it trigger by frames? But who's?

old Re: How does the move hook work

DC
Admin Off Offline

Quote
It's complicated because of our friend the internet.

in general:
cs2d lua hook move is (in theory) limited to max 1 movement per frame (client frame rate). Based on network conditions it may trigger more often or less often. It also triggers less often depending on client settings (cs2d cmd connection 0 and 1 will reduce the rate with which the client sends movements to the server).

Does it get triggered based on server ticks? Or client frames?
> client sends a network package (max once per frame), server processes it at its own frame rate as soon as it arrives. So the answer is: Triggered by client frames but server frames also have an impact.

Does it have a cap of some sort?
> under perfect network conditions and with cs2d cmd connection set to 2 (on client side) the - theoretical - cap is 1 time per client frame. In practice it may be called more often (e.g. after network congestion / lag)

Does speed modifications influence how many times it can trigger per X duration?
Does -25 speedmod vs 100 speedmod affect how fast my move hook will trigger?
Does a player with 100 speedmod trigger it more often?

> No, not at all. speedmod has zero impact on how often it is called. If player's can't move anymore at all (because of super low speedmod values) I THINK the hook won't be invoked anymore - but I'm not entirely sure.

old Re: How does the move hook work

Mami Tomoe
User Off Offline

Quote
How does cs2d cmd connection work?

It seems that the client can't execute it.
connection 0

1
ERROR: Unknown command '0' (connection 0). Maybe missing quotes? Reference at CS2D.com/help

But,
connection speed
, prints nothing?

Yet
connection speed 0
also doesn't work.

And it also seems to have been removed from the
Net
tab of the options menu for the client.

Printing
game('connection')
prints
2
which I assume is the default, but how does one change it?

old Re: How does the move hook work

DC
Admin Off Offline

Quote
Oh, sorry. I forgot that connection has been removed with v1.0.0.2 already. So you can ignore that part.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview