xhookLua
Game

movement

The movement sim behind edgebug and jumpbug: tick-exact PM_PlayerMove from where you are now, in the air and (ground = true) on the ground.

Functions

movement.simulate

movement.simulate(cmd, ticks [, msec [, start]]) -> table[]
NameTypeDescription
cmdtable | nil{viewangles, forwardmove, sidemove, upmove, buttons}, all optional; nil = no keys.
ticksinteger1 to 1000.
msecoptionalintegerPer tick. Default 10.
startoptionaltable{jump = true} starts as if you jumped now; origin / velocity / ducked start anywhere; ground = true adds ground moves.

Flies you forward, repeating cmd each tick.

Returns {origin, velocity, ducked, outcome} per tick (+ jumped, land_fall with ground = true)

  • outcome: "air", "bug" (an edgebug), "touch" (a wall), "land"; with ground = true also "ground" and "jump".
  • Default: airborne only. It stops at the landing tick; empty on the ground, in water or on a ladder unless start is given.
  • ground = true: walking, friction, steps and jumping (IN_JUMP in buttons) too, from the ground and on through landings. "jump" from the air is a jumpbug.
  • land_fall: the fall speed a landing carried (CS hurts above 500 u/s).
  • Each tick traces the map: keep ticks small in per-frame code.
movement ยท Lua API ยท xhook