types
color_t
Color is a Lua table created by color_t.
Fields:
| Field | Type |
|---|---|
r |
number |
g |
number |
b |
number |
a |
number |
vec2_t
Screen positions returned by render.get_screen_size and render.world_to_screen.
| Field | Type |
|---|---|
x |
number |
y |
number |
vec3_t
World position, direction vector, or angle-like three-component table.
| Field | Type |
|---|---|
x |
number |
y |
number |
z |
number |
angle_t
Angle table. Uses the same shape as vec3_t.
| Field | Type |
|---|---|
x |
number |
y |
number |
z |
number |
ray_t
Ray object created by ray_t().
| Field | Type | Description |
|---|---|---|
start |
vec3_t |
Start point |
end |
vec3_t |
End point |
mins |
vec3_t |
Shape minimum bounds |
maxs |
vec3_t |
Shape maximum bounds |
type |
number | Ray type |
trace_filter_t
Trace filter object created by trace_filter_t(mask, layer, skip).
| Field | Type | Description |
|---|---|---|
mask |
number | Trace mask |
layer |
number | Collision layer |
trace_t
Trace result returned by trace.shape, trace.line, and engine.trace_shape.
| Field | Type | Description |
|---|---|---|
hit |
boolean | Trace hit something |
fraction |
number | Trace fraction |
pos |
vec3_t |
Hit position |
end_pos |
vec3_t |
End position |
normal |
vec3_t |
Hit normal |
entity |
userdata | Hit entity pointer |
contents |
number | Contents mask |
hitbox |
number | Hitbox id |
hitgroup |
number | Hitgroup id |
all_solid |
boolean | Trace started or ended inside solid |
hit_world |
boolean | Hit world geometry |
bullet_trace_t
Bullet trace result returned by trace.fire_bullet and engine.trace_bullet.
| Field | Type | Description |
|---|---|---|
valid |
boolean | Bullet data is valid |
damage |
number | Scaled damage |
hitgroup |
number | Hitgroup id |
hitbox |
number | Hitbox id |
penetrated |
boolean | Bullet penetrated material |
image_t
Texture object returned by render.setup_texture, render.setup_texture_rgba, render.setup_texture_from_memory, and render.create_panorama_svg_texture.
| Method | Returns | Description |
|---|---|---|
get_size() |
vec2_t |
Texture size |
edge_bug_t
Edge bug state passed to register_callback("edge_bug", function(edge_bug) ... end).
| Field | Type | Description |
|---|---|---|
active |
boolean | Edge bug setting/bind is active |
assisting |
boolean | Edge bug is currently correcting movement |
hit |
boolean | Edge bug was reported on this command |
pixel_surf_t
Pixel surf state passed to register_callback("pixel_surf", function(pixel_surf) ... end).
| Field | Type | Description |
|---|---|---|
active |
boolean | Pixel surf setting/bind is active |
surfing |
boolean | Pixel surf is currently assisting |
hit |
boolean | Pixel surf was reported on this command |
pawn_t
Pawn wrapper returned by entitylist.get_local_player_pawn.
Methods:
| Method | Description |
|---|---|
get_weapon_name() |
Active weapon name |
get_weapon_id() |
Active weapon definition index |
get_bone_position(index) |
Bone world position |
get_hitbox_position(index) |
Hitbox world position |
get_eye_pos() |
Eye position, using prediction data for the local pawn |
is_scoped() |
Scoped state, using prediction data for the local pawn |
as_ptr() |
Raw uint8_t* |
Pawn supports FFI pointer arithmetic:
input_bit_mask_t
Button bit masks used by user_cmd.
| Name | Description |
|---|---|
in_attack |
Primary attack |
in_attack2 |
Secondary attack |
in_jump |
Jump |
in_duck |
Duck |
in_forward |
Move forward |
in_back |
Move backward |
in_moveleft |
Move left |
in_moveright |
Move right |
in_use |
Use |
in_reload |
Reload |
in_speed |
Walk |
in_score |
Scoreboard |
in_zoom |
Zoom |