Callback objects
Command, View, and GameEvent userdata is valid only until its callback returns. Copy scalar values or returned snapshots if needed later. Invalidated proxy reads return nil and writes do nothing; this does not make retaining them useful.
Command fields
| Field | Type | Writable | Meaning |
|---|---|---|---|
command_number | integer | No | Command sequence number |
tick_count | integer or nil | No | Base command tick count |
view_angles | Vector or nil | Assign Vector | Copied angles; assign a Vector to update native angles |
forward_move | number or nil | Yes | Forward movement |
side_move | number or nil | Yes | Side movement |
up_move | number or nil | Yes | Vertical movement |
weapon_select | integer or nil | Yes | Selected weapon index; numeric assignment casts to native uint32 |
simulation_mode | integer or nil | No | Native simulation mode |
first_prediction | boolean or nil | No | Native first-time-predicted flag |
Base-dependent reads can return nil without a base command. Unknown reads return nil. Writes to unrecognized/read-only names do not change native state; numeric validation may still raise an error. Editing a returned view_angles vector alone does not update the command: assign it back.
Command buttons
Boolean button properties are readable and writable. Truthy assignment adds a native button; false/nil removes it. Every name below supports the short and in_ alias shown.
| Short name | Alias |
|---|---|
attack | in_attack |
attack2 | in_attack2 |
jump | in_jump |
duck | in_duck |
forward | in_forward |
back | in_back |
use | in_use |
left | in_left |
right | in_right |
move_left | in_moveleft |
move_right | in_moveright |
subticks
command:subticks() returns an ipairs-style iterator triple: iterator, snapshot table, initial index. Use it directly in a generic for loop; it does not return only a table. Missing command/base/subtick data gives an empty iterator. Each Subtick record has the fields in returned structures.
history
command:history() returns an ipairs-style iterator triple over HistoryEntry snapshots. Missing command/history gives an empty iterator. Native sparse entries can make ipairs stop at the first hole. See returned structures.
button
command:button(name) accepts a button name or alias and returns a ButtonState table. An unknown string raises unknown command button; an invalidated command returns nil, reason. This records held/pressed/released/toggled/scrolled state without modifying it.
local traceless = require("traceless")
traceless.events.on("command.setup", function(command)
local state = command:button("jump")
if state and state.pressed then traceless.console.info("Jump pressed") end
for index, step in command:subticks() do
traceless.console.info(index, ": ", step.when)
end
end)
View fields
x, y, and z are world origin numbers. pitch, yaw, and roll are angle numbers in degrees. fov is numeric field of view. All seven are readable and writable during override_view. Unknown reads return nil; unknown writes are ignored after numeric value validation. Invalidated view writes do nothing.
GameEvent fields
event.name returns the event name. Dynamic fields first try a native string lookup, then an integer lookup with default 0. Unknown fields can therefore return 0 rather than nil. Invalidated events return nil. This proxy has no public writable fields and does not preserve arbitrary native float/boolean types.