Quick start
Export onLoad and write a log line when the script starts.
const sdk = @import("sdk");
export fn onLoad() void {
sdk.info("Script ready", .{});
}Browse the public scripting API by module.
Export onLoad and write a log line when the script starts.
const sdk = @import("sdk");
export fn onLoad() void {
sdk.info("Script ready", .{});
}Export onTick and read the actor list each simulation tick.
const sdk = @import("sdk");
export fn onTick(_: f32, _: i32) void {
const actors = sdk.actors();
sdk.info("Actors: {d}", .{actors.len});
}Export the callbacks your script uses:
export fn onLoad() void: runs once when the script loads.export fn onUnload() void: runs once before the script unloads.export fn onTick(dt: f32, frame: i32) void: runs once per simulation tick.export fn onFrame(dt: f32, frame: i32) void: runs once per rendered frame.export fn onUIFrame(dt: f32, frame: i32) void: runs for interface updates.No declarations match your search.
pub const AbilityKind = enum { ... }Recharge model of an ability slot.
cooldown,Recharges on a cooldown timer.
charged,Recharges by accumulating points up to maxPoints.
passive,Available while active.
pub const AbilityType = enum { ... }Assist class of an ability slot:
.flick: single-shot assisted cast..none (default): no assist class. Slots with castTime > 0 are still treated as castable.flick,none,pub const Ability = struct { ... }State of one ability slot, published by the active SDK package each tick.
kind: AbilityKind = .cooldown,abilityType: AbilityType = .none,effectTarget: EffectTarget = .enemy,aoe: bool = false,Affects an area rather than a single target.
projectileSpeed: f32 = 0,Meters per second; 0 means no travel time.
projectileGravity: f32 = 0,Meters per second squared, along the active SDK package's vertical axis.
castTime: f32 = 0,Seconds from start to execution; 0 is instant.
customDelay: f32 = 0,Seconds after use before an assist consumer may re-engage the slot.
active: bool = false,Currently executing.
enabled: bool = false,An assist consumer may drive this slot this tick.
using: bool = false,Currently being used.
charges: i32 = 0,maxCharges: i32 = 0,Greater than 0 for multi-charge abilities.
cooldown: f32 = 0,Cooldown length in seconds.
cooldownStart: f32 = 0,Simulation time in seconds at which the current cooldown began.
points: f32 = 0,Charge points of a .charged ability.
maxPoints: f32 = 0,Points a .charged ability needs to be ready.
pub fn isMultiCharge(self: Ability) bool;pub fn readyAt(self: Ability) f32;Simulation time in seconds at which the current cooldown ends.
pub fn readyPercent(self: Ability) f32;Readiness in [0, 1], where 1 is ready:
.cooldown: progress through the cooldown window..passive: 1 while active, otherwise 0.pub fn canUse(self: Ability) bool;Whether the ability can be used now, ignoring the cast-time latch:
.cooldown: off cooldown, with a charge left when multi-charge..charged: points >= maxPoints..passive: active.pub const ActorKind = enum { ... }Behavioral class of an actor, independent of its numeric kind:
.player: mobile combatant character..turret: stationary automated attacker..explosive: detonating deployable..support: stationary deployable with a beneficial effect..unknown: unrecognized role; full actor state, but no kind-specific abilities or guns.player,Behavioral class of an actor, independent of its numeric kind:
.player: mobile combatant character..turret: stationary automated attacker..explosive: detonating deployable..support: stationary deployable with a beneficial effect..unknown: unrecognized role; full actor state, but no kind-specific abilities or guns.turret,Behavioral class of an actor, independent of its numeric kind:
.player: mobile combatant character..turret: stationary automated attacker..explosive: detonating deployable..support: stationary deployable with a beneficial effect..unknown: unrecognized role; full actor state, but no kind-specific abilities or guns.explosive,Behavioral class of an actor, independent of its numeric kind:
.player: mobile combatant character..turret: stationary automated attacker..explosive: detonating deployable..support: stationary deployable with a beneficial effect..unknown: unrecognized role; full actor state, but no kind-specific abilities or guns.support,Behavioral class of an actor, independent of its numeric kind:
.player: mobile combatant character..turret: stationary automated attacker..explosive: detonating deployable..support: stationary deployable with a beneficial effect..unknown: unrecognized role; full actor state, but no kind-specific abilities or guns.unknown,Behavioral class of an actor, independent of its numeric kind:
.player: mobile combatant character..turret: stationary automated attacker..explosive: detonating deployable..support: stationary deployable with a beneficial effect..unknown: unrecognized role; full actor state, but no kind-specific abilities or guns.pub const Actor = struct { ... }One actor in the scene. Pointers and slices in this struct borrow the current scene snapshot and are valid until the next snapshot update.
id: i32,kind: u64,Type id of this actor's kind; its meaning depends on the active SDK package (entity-def id, character id, or another stable id).
actorKind: ActorKind = .player,team: Team = .unknown,Relationship to the local actor.
transform: Transform = .{},Position in meters, SDK world coordinates.
velocity: runtime.Vec3 = .{},Meters per second.
terminalVelocity: f32 = 0,Maximum fall speed for motion prediction in m/s; at or below 1 means no limit.
horizontalDrag: f32 = 0,Horizontal damping for motion prediction.
gravity: f32 = 0,Downward acceleration for motion prediction in m/s², along the active SDK package's vertical axis.
onGround: bool = false,masterEntity: u32 = 0,Id of the owning actor (e.g. the thrower of a projectile); 0 when unowned.
motionHistory: []const MotionSample = &.{},Recent per-tick motion, newest first.
serverTransform: Transform = .{},Lag-compensated transform: where the server sees the actor, one history window ago. Equals the live transform when lag compensation is off. Rotation comes from the recorded history sample; the fallback keeps the live rotation.
health: f32 = 0,maxHealth: f32 = 0,healthPools: ?*HealthPools = null,Armor, shields, and other extra pools.
isInvincible: bool = false,Cannot be damaged.
isInvulnerable: bool = false,Cannot be affected by normal interactions.
isVisible: bool = false,Visible from the local camera. False when visibility was not established (obstructed or unknown).
abilities: []Ability = &.{},guns: []Gun = &.{},skeleton: ?*Skeleton = null,hitboxes: ?*HitboxSet = null,pub fn ability(self: *const Actor, comptime A: type) Ability;Copy of the slot of ability declaration A, which must belong to this actor's kind.
pub fn gun(self: *const Actor, comptime G: type) Gun;Copy of the slot of gun declaration G, which must belong to this actor's kind.
pub const ActorListEntry = struct { ... }One entry of a module's actor roster.
id: u64,Actor kind id used for per-actor settings scoping; never shown to users. Must be non-zero.
name: []const u8,Display name, 1 to 64 bytes.
pub fn ActorList(comptime entries: []const ActorListEntry) type;Declare this module's actor roster for per-actor configuration. Ids must be non-zero and unique; names 1 to 64 bytes. The roster is emitted only when the returned type is referenced, e.g. through .count.
pub const verticalLimitAlias of verticalLimit in the Aim / Steering module.
pub fn nearVertical(dir: Vec3) bool;Whether dir lies in the near-vertical cone (|up| > verticalLimit after normalizing). Zero and non-finite vectors count as near-vertical so callers skip steering on them.
pub fn slerpTrack(viewDir: Vec3, dirToTarget: Vec3, smoothX: f32, smoothY: f32) Vec3;Step viewDir toward dirToTarget in yaw/pitch space. Each axis moves angle between the directions, so both axes arrive together. smoothX/smoothY are radians per call. Returns a unit direction.
pub fn slerpTime(viewDir: Vec3, dirToTarget: Vec3, t: f32) Vec3;Spherical interpolation from viewDir (t = 0) to dirToTarget (t = 1). Returns a unit direction.
pub fn isInFov(eye: Vec3, viewDir: Vec3, point: Vec3, fovDeg: f32) bool;Whether point is inside the view cone from eye along viewDir. fovDeg is the full cone angle; above 170 every point is inside.
pub const AimTargetAlias of AimTarget in the Aim / Target module.
pub const HitboxPickAlias of HitboxPick in the Aim / Target module.
pub const TargetScoreAlias of TargetScore in the Aim / Target module.
pub const TargetCtxAlias of TargetCtx in the Aim / Target module.
pub const TargetTrackerAlias of TargetTracker in the Aim / Target module.
pub fn pickAimPoint(actor: *Actor, mode: HitboxPick, eye: Vec3, viewDir: Vec3) ?Vec3;The aim point of actor for mode, or null when the required volumes are missing. .nearest measures from eye along viewDir.
pub fn combineMaxRange(a: f32, b: f32) f32;The tighter of two range caps where 0 means unlimited.
pub const LatchKindAlias of LatchKind in the Aim / Slots module.
pub const EnabledLatchAlias of EnabledLatch in the Aim / Slots module.
pub const GunLatchAlias of GunLatch in the Aim / Slots module.
pub const AimSlotRefAlias of AimSlotRef in the Aim / Slots module.
pub const AimSlotLatchAlias of AimSlotLatch in the Aim / Slots module.
pub const LatchKind = enum { ... }lost,A slot was tracked and none is current now.
swapped,The current slot differs from the tracked one, or tracking started.
held,The current slot is the tracked one, or neither exists.
pub const EnabledLatch = struct { ... }Tracks the index of the enabled slot. Call observe once per update with the enabled index, or null when none is enabled.
pub fn observe(self: *EnabledLatch, currentSlot: ?u8) LatchKind;pub fn reset(self: *EnabledLatch) void;pub const GunLatch = struct { ... }Tracks a gun by pointer identity, e.g. LocalActor.firstEnabledGun().
pub fn observe(self: *GunLatch, current: ?*const Gun) LatchKind;pub fn reset(self: *GunLatch) void;pub const AimSlotRef = union(enum) { ... }A gun or ability slot that assist consumers treat uniformly. Fields an ability lacks read as neutral values: no track or bow behavior, no range cap, no owned target, .standard kind.
gun: *Gun,ability: *Ability,pub fn isFlick(self: AimSlotRef) bool;pub fn isTrack(self: AimSlotRef) bool;pub fn isBow(self: AimSlotRef) bool;pub fn isNone(self: AimSlotRef) bool;pub fn projectileSpeed(self: AimSlotRef) f32;pub fn projectileGravity(self: AimSlotRef) f32;pub fn maxRange(self: AimSlotRef) f32;pub fn cooldown(self: AimSlotRef) f32;pub fn cooldownStart(self: AimSlotRef) f32;pub fn effectTarget(self: AimSlotRef) EffectTarget;pub fn ownedTargetDef(self: AimSlotRef) u64;pub fn kind(self: AimSlotRef) GunKind;pub fn ptrEquals(self: AimSlotRef, other: AimSlotRef) bool;Same variant and same slot pointer.
pub const AimSlotLatch = struct { ... }GunLatch for AimSlotRef, so gun and ability slots share one signal.
pub fn observe(self: *AimSlotLatch, current: ?AimSlotRef) LatchKind;pub fn reset(self: *AimSlotLatch) void;pub const verticalLimit: f32Up component beyond which a direction counts as straight up or down. Yaw is ill-defined there, so yaw/pitch steering would spin the view.
pub fn nearVertical(dir: Vec3) bool;Whether dir lies in the near-vertical cone (|up| > verticalLimit after normalizing). Zero and non-finite vectors count as near-vertical so callers skip steering on them.
pub fn slerpTrack(viewDir: Vec3, dirToTarget: Vec3, smoothX: f32, smoothY: f32) Vec3;Step viewDir toward dirToTarget in yaw/pitch space. Each axis moves angle between the directions, so both axes arrive together. smoothX/smoothY are radians per call. Returns a unit direction.
pub fn slerpTime(viewDir: Vec3, dirToTarget: Vec3, t: f32) Vec3;Spherical interpolation from viewDir (t = 0) to dirToTarget (t = 1). Returns a unit direction.
pub fn isInFov(eye: Vec3, viewDir: Vec3, point: Vec3, fovDeg: f32) bool;Whether point is inside the view cone from eye along viewDir. fovDeg is the full cone angle; above 170 every point is inside.
pub const AimTarget = struct { ... }Result of a target evaluation. actor borrows the current scene snapshot.
actor: *Actor,aimPoint: Vec3,World position in meters.
priority: f32,Lower is better.
isValid: bool,When false, actor and aimPoint are unspecified.
pub const HitboxPick = enum { ... }Which point of a target to aim at. Every mode except .origin needs the actor's hit volumes; actors without the required volumes are skipped.
defined,Center of the first critical volume.
head,Same as .defined.
body,Center of the bounds of all volumes.
origin,The actor origin. Selection still requires some valid volume.
nearest,The volume point needing the smallest view correction.
pub const TargetScore = enum { ... }Candidate scoring for TargetTracker.step; lower wins.
fitts,targets close to the crosshair.
crosshair,Angle to the crosshair.
pub const TargetCtx = struct { ... }Per-update selection settings for TargetTracker.step.
fovDeg: f32,Full view-cone angle in degrees around the view direction.
fovScale: f32 = 1.0,Multiplier on fovDeg.
swapDelayMs: f32 = 150.0,Minimum milliseconds between target switches.
lockTarget: bool = false,Keep the current target over better candidates and through brief out-of-view gaps.
hitbox: HitboxPick = .defined,aim point selection.
projectileSpeed: f32 = 0,Projectile speed in m/s.
projectileGravity: f32 = 0,Projectile gravity in m/s².
score: TargetScore = .fitts,maxRange: f32 = 0,Maximum distance in meters from the local actor to a candidate's serverTransform position; 0 is unlimited.
effectTarget: EffectTarget = .enemy,ownedTargetDef: u64 = 0,Entity type of the local actor's own deployables that are also targetable, from the slot's ownedTargetDef; 0 disables.
pub const TargetTracker = struct { ... }Target selection with locking: switches are debounced by swapDelayMs, and with lockTarget a target survives up to 500 ms out of view.
pub fn reset(self: *TargetTracker) void;pub fn step(self: *TargetTracker, actors: []Actor, local: *LocalActor, ctx: TargetCtx, nowMs: f32) AimTarget;Pick a target from actors for local. nowMs drives the lock, grace, and debounce timers. Owned targets score at a quarter of their raw score.
pub fn pickAimPoint(actor: *Actor, mode: HitboxPick, eye: Vec3, viewDir: Vec3) ?Vec3;The aim point of actor for mode, or null when the required volumes are missing. .nearest measures from eye along viewDir.
pub fn combineMaxRange(a: f32, b: f32) f32;The tighter of two range caps where 0 means unlimited.
pub fn getRealBacktrackMs() i32;History window in milliseconds after disabling and the cap are applied; 0 means prediction uses the live position.
pub fn capMs() i32;Upper bound in milliseconds for dynamically selected windows.
pub fn dynamicEnabled() bool;Whether the window is recomputed per target, overriding the resolved value.
pub const MAX_NODES: usizeSections per frame; extra sections are dropped.
pub const NAME_CAPACITY: usizeLabel bytes kept per section; longer labels are truncated.
pub const Node = extern struct { ... }One timed section of the frame tree.
name: [NAME_CAPACITY]u8 = [_]u8{0} ** NAME_CAPACITY,UTF-8; see label.
nameLen: u8 = 0,depth: u8 = 0,0 for top-level sections.
totalNs: i64 = 0,Nanoseconds summed over every call this frame.
callCount: u32 = 0,pub fn label(self: *const Node) []const u8;pub fn frameSeq() u32;Advances once per published frame; a change means a fresh profile.
pub fn nodeCount() usize;pub fn rootTotalNs() i64;Nanoseconds spanned by the whole frame, the denominator for per-node percentages.
pub fn nodes() []const Node;Current frame's sections in pre-order, valid until the next published frame. Empty until a profile is published.
pub fn position() ?runtime.Vec3;Eye position in world meters while a camera is active, else null. The eye sits above the actor origin; use it as the ray origin for view-direction math and fall back to the actor origin when null.
pub fn active() bool;Whether a camera and projection are published for the current frame. Frame callbacks run regardless; gate projection and 3D draws on this.
pub fn w2s(pos: runtime.Vec3) ?runtime.Vec2;Project a world position in meters to screen pixels (y down). Null when no projector is installed or the point is behind the camera or not finite. Off-screen points may project outside the viewport; clip before drawing.
pub fn step(value: *bool) bool;One frame of editing: Enter toggles value, Escape cancels. Returns true when editing ends.
pub fn render(x: f32, y: f32, w: f32, h: f32, value: bool, color: i32) void;Draw [x] or [ ] right-aligned in the row (x, y, w, h).
pub fn step(value: *u32) bool;One frame of editing an 0xAARRGGBB color: Left/Right shift the hue with wraparound, Up/Down change alpha, all with auto-repeat. Enter or Escape ends editing (returns true).
pub fn render(x: f32, y: f32, w: f32, h: f32, value: u32, is_editing: bool) void;Draw a hue bar inset in the row with a cursor at value's hue. The caller draws any editing outline; is_editing is unused.
pub fn down(vk: u8) bool;pub fn pressed(vk: u8) bool;True on the frame the key goes down.
pub fn released(vk: u8) bool;True on the frame the key goes up.
pub fn pressedRepeat(vk: u8, initial_delay: u16, repeat_period: u16) bool;True on the press, then while held: after initial_delay frames and every repeat_period frames from then on.
pub fn firstPressed() u8;VK code of the first key pressed this frame, or 0.
pub fn step(value: *u32) bool;One frame of key capture: stores the first pressed key's VK code in value; Escape cancels. Returns true when editing ends.
pub fn render(x: f32, y: f32, w: f32, h: f32, value: u32, editing: bool, color: i32) void;Draw the bound key right-aligned in the row, or ... while editing. 0xFFFFFFFF shows as Default and 0 as none.
pub fn step(value: *u32, option_count: u32) bool;One frame of editing an index into option_count options: Left/Right move with wraparound, Enter or Escape ends editing (returns true).
pub fn render(x: f32, y: f32, w: f32, h: f32, value: u32, options: []const []const u8, color: i32) void;Draw < label > for options[value] in the row, truncating the label to fit. Out-of-range values show the last option.
pub const inputpub const booleanpub const sliderpub const keybindpub const multipub const colorpickerpub fn step(value: *u32, min: u32, max: u32) bool;One frame of editing an integer in [min, max]: Left/Right step by a 64th of the range with auto-repeat, or by 1 per press with Shift held. Enter or Escape ends editing (returns true).
pub fn stepF32(value: *f32, min: f32, max: f32) bool;Float variant of step; Shift steps by exactly 1.
pub fn render(x: f32, y: f32, w: f32, h: f32, value: u32, min: u32, max: u32, fg: i32, bg: i32) void;Draw a bg track filled with fg up to value's position in [min, max]. The caller draws the value text.
pub fn renderF32(x: f32, y: f32, w: f32, h: f32, value: f32, min: f32, max: f32, fg: i32, bg: i32) void;Float variant of render.
pub const GunKind = enum { ... }Physical class of a weapon slot. The assist class is separate; see AimType.
standard,scoped,Fired while aiming down a scope.
bow,Drawn; releasing fires the projectile.
casted,Fired after a cast or wind-up.
pub const AimType = enum { ... }Assist class of a weapon slot, independent of GunKind:
.flick: single-shot snap, then fire..track: continuous follow while fire is held..bow: hold the game button through the snap and release on target; the release fires..none (default): no assist, so new slots opt in explicitly.flick,track,bow,none,pub const EffectTarget = enum { ... }Which actors a slot may target:
.enemy (default): opponents..ally: allies, e.g. a healing weapon..both: opponents and allies.enemy,Which actors a slot may target:
.enemy (default): opponents..ally: allies, e.g. a healing weapon..both: opponents and allies.ally,Which actors a slot may target:
.enemy (default): opponents..ally: allies, e.g. a healing weapon..both: opponents and allies.both,Which actors a slot may target:
.enemy (default): opponents..ally: allies, e.g. a healing weapon..both: opponents and allies.pub const Gun = struct { ... }State of one weapon slot, published by the active SDK package each tick.
kind: GunKind = .standard,aimType: AimType = .none,effectTarget: EffectTarget = .enemy,ownedTargetDef: u64 = 0,Type id of an owned deployable this slot may also target when the local actor owns it; 0 disables.
aoe: bool = false,Affects an area rather than a single target.
charging: bool = false,Charges before firing.
projectileSpeed: f32 = 0,Meters per second; 0 means no travel time.
projectileGravity: f32 = 0,Meters per second squared, along the active SDK package's vertical axis.
maxRange: f32 = 0,Target-selection range cap in meters; 0 means none. See combineMaxRange.
active: bool = false,Currently firing or executing.
chargePercent: f32 = 0,Charge progress in [0, 1] for charging weapons.
enabled: bool = false,An assist consumer may drive this slot this tick.
reloading: bool = false,ammo: i32 = 0,maxAmmo: i32 = 0,cooldown: f32 = 0,Shot cooldown length in seconds.
cooldownStart: f32 = 0,Simulation time in seconds at which the current cooldown began.
pub const HealthPoolKind = enum(u8) { ... }normal,armor,Damage-absorbing armor.
shield,Regenerating shield.
overhealth,Temporary health above the maximum.
pub const HealthPool = struct { ... }kind: HealthPoolKind,current: f32,max: f32,pub const HealthPools = struct { ... }Health pools of one entity, in no particular order. pools borrows the current scene snapshot.
pools: []HealthPool,pub fn ofKind(self: HealthPools, kind: HealthPoolKind) ?HealthPool;pub const Sphere = extern struct { ... }Spherical hit volume in world meters.
center: runtime.Vec3,radius: f32,bone: i16,Skeleton bone the volume follows; negative when none.
critical: bool,Critical hit area, e.g. a head.
pub const Capsule = extern struct { ... }Capsule hit volume in world meters, with its axis from a to b.
a: runtime.Vec3,b: runtime.Vec3,radius: f32,bone: i16,Skeleton bone the volume follows; negative when none.
critical: bool,Critical hit area, e.g. a head.
pub const Box = extern struct { ... }Oriented box hit volume in world meters.
center: runtime.Vec3,halfExtents: runtime.Vec3,Positive half-extents along the box's local axes.
rotation: runtime.Quat,Unit quaternion from the box's local axes to world space.
bone: i16 = -1,Skeleton bone the volume follows; negative when none.
critical: bool = false,Critical hit area, e.g. a head.
pub const HitboxSet = struct { ... }Hit volumes of one entity. The slices borrow the current scene snapshot.
spheres: []Sphere,capsules: []Capsule,boxes: []Box = &.{},pub const GameButton = enum(u8) { ... }Game command slot. Unknown numeric codes are preserved.
pub const DesireSentinel = enum(i8) { ... }Desired state for a game button written by a module.
none = -1,forceUp = 0,forceDown = 1,pub const Key = enum(u8) { ... }Common key codes. Where possible the value is the ASCII code of the character, so isKeyDown(.a) and keyDown('A') are equivalent.
backspace = 0x08,tab = 0x09,enter = 0x0D,shift = 0x10,ctrl = 0x11,alt = 0x12,pause = 0x13,capslock = 0x14,escape = 0x1B,space = 0x20,pageup = 0x21,pagedown = 0x22,end = 0x23,home = 0x24,left = 0x25,up = 0x26,right = 0x27,down = 0x28,insert = 0x2D,delete = 0x2E,a = 0x41,b = 0x42,c = 0x43,d = 0x44,e = 0x45,f = 0x46,g = 0x47,h = 0x48,i = 0x49,j = 0x4A,k = 0x4B,l = 0x4C,m = 0x4D,n = 0x4E,o = 0x4F,p = 0x50,q = 0x51,r = 0x52,s = 0x53,t = 0x54,u = 0x55,v = 0x56,w = 0x57,x = 0x58,y = 0x59,z = 0x5A,backtick = 0xC0,numpad1 = 0x61,numpad2 = 0x62,numpad3 = 0x63,numpad4 = 0x64,numpad5 = 0x65,numpad6 = 0x66,numpad7 = 0x67,numpad8 = 0x68,numpad9 = 0x69,multiply = 0x6A,add = 0x6B,subtract = 0x6D,decimal = 0x6E,divide = 0x6F,f1 = 0x70,f2 = 0x71,f3 = 0x72,f4 = 0x73,f5 = 0x74,f6 = 0x75,f7 = 0x76,f8 = 0x77,f9 = 0x78,f10 = 0x79,f11 = 0x7A,f12 = 0x7B,oem_plus = 0xBB,oem_comma = 0xBC,oem_minus = 0xBD,oem_period = 0xBE,oem_2 = 0xBF,oem_4 = 0xDB,oem_5 = 0xDC,oem_6 = 0xDD,oem_7 = 0xDE,pub const MouseButton = enum(u8) { ... }pub fn keyName(code: u32) ?[]const u8;Display name for a key code: mouse buttons, left/right modifiers, and the keys named in Key. Null for unnamed codes.
pub fn keyState(k: Key) u8;pub fn keyStateCode(code: u8) u8;Raw state byte for key code code. Bit 0x10 means the key is down; bit 0x01 means its state changed this input frame (0x11 = pressed, 0x01 = released).
pub fn keyDown(code: u8) bool;pub fn keyPressed(code: u8) bool;Whether the key went down this input frame.
pub fn keyReleased(code: u8) bool;Whether the key went up this input frame.
pub fn isKeyDown(k: Key) bool;pub fn isKeyPressed(k: Key) bool;Whether the key went down this input frame.
pub fn isKeyReleased(k: Key) bool;Whether the key went up this input frame.
pub fn firstKeyPressed() u8;Lowest key code pressed this input frame, or 0 when none was.
pub fn firstKeyDown() u8;Lowest key code currently down, or 0 when none is.
pub fn isMouseButtonPressed(b: MouseButton) bool;Whether mouse button b is currently held.
pub fn mouseDeltaX() f32;Horizontal mouse movement since the previous input frame.
pub fn mouseDeltaY() f32;Vertical mouse movement since the previous input frame.
pub fn mouseX() f32;Mouse X in screen coordinates.
pub fn mouseY() f32;Mouse Y in screen coordinates.
pub fn requestMouseDelta(dx: f32, dy: f32) bool;Request a relative mouse movement. dx is horizontal and dy is vertical; positive dx moves right and positive dy moves down. Values are relative pointer units, not absolute screen coordinates. Each axis is clamped independently to [-4096, 4096] before it is queued. Returns true when the current module kind and relative-pointer backend accept the request. The request is rejected (false) when either value is nonfinite, both are zero, no relative-pointer backend is available, or the module kind is unsupported. A pending request is replaced by each newer accepted request, including requests from other modules, before input is drained. true means only that the request was accepted into the queue; it does not guarantee delivery to the operating system.
pub fn setDisabled(disable: bool) void;Suppress game input while disable is true. Sticky until cleared with setDisabled(false).
pub fn isDisabled() bool;Whether input suppression is requested. False until a module requests it.
pub fn setSensitivity(value: f32) void;Override mouse sensitivity until resetSensitivity restores the value in effect before the override.
pub fn resetSensitivity() void;Clear the sensitivity override. No-op when none is active.
pub const GameButtonAlias of GameButton in the Input module.
pub const DesireSentinelAlias of DesireSentinel in the Input module.
pub const EnabledGunIter = struct { ... }pub fn next(self: *EnabledGunIter) ?*Gun;pub const EnabledAbilityIter = struct { ... }pub fn next(self: *EnabledAbilityIter) ?*Ability;pub const EnabledAimSlotIter = struct { ... }Iterator over the enabled slots that request aim assistance (gun aimType != .none or ability abilityType != .none): guns first, then abilities.
pub fn next(self: *EnabledAimSlotIter) ?AimSlotRef;pub const LocalActor = extern struct { ... }The local player's actor and its input/view state, published each tick by the active SDK package. Requests made through the setters are applied by the package during the tick; isPressed and viewDirection reflect the latest state the package reported.
controller: ?*Actor,Entity controlling the local player; may differ from avatar.
avatar: ?*Actor,In-world character the local player controls.
viewDirection: runtime.Vec3,Unit vector, SDK world coordinates.
pub fn isPressed(self: *const LocalActor, button: GameButton) bool;pub fn setPressed(self: *LocalActor, button: GameButton, down: bool) void;Request button held (down = true) or released for the current tick.
pub fn setViewDir(self: *LocalActor, dir: runtime.Vec3) void;Request a view direction for the current tick; dir need not be normalized.
pub fn firstEnabledGun(self: *const LocalActor) ?*Gun;pub fn enabledGuns(self: *const LocalActor) EnabledGunIter;pub fn firstEnabledAbility(self: *const LocalActor) ?*Ability;pub fn enabledAbilities(self: *const LocalActor) EnabledAbilityIter;pub fn enabledAimSlots(self: *const LocalActor) EnabledAimSlotIter;pub fn isKeyOrGameButtonDown(local: *const LocalActor, setting: u32, fallback: GameButton) bool;Resolve a keybind setting against live input:
0xFFFF_FFFF (Default): the fallback game button.0: unbound; never down.pub const MotionSample = struct { ... }One recorded motion sample of an actor.
timeMs: f32,Simulation-clock timestamp in milliseconds.
transform: Transform,Pose and motion at timeMs: meters, meters per second, SDK world coordinates.
pub fn predict(actor: *const Actor, projectileSpeed: f32, projectileGravity: f32, timeAddition: f32) ?Vec3;Offset in meters to add to the aim point so a projectile of projectileSpeed (m/s) and projectileGravity (m/s²), launched after timeAddition seconds, intercepts actor. Null for hitscan, without a solver, or when no lead solves.
pub fn refine(actor: *const Actor, aimPoint: Vec3, projectileSpeed: f32, projectileGravity: f32) Vec3;aimPoint moved by predict, or unchanged when there is no lead.
pub fn computeOptimalBacktrack(actor: *const Actor, camPos: Vec3, viewDir: Vec3, nowSec: f32) i32;Deepest history window in milliseconds that keeps actor under the view ray from camPos along unit viewDir, for dynamic lag compensation; 0 when unavailable.
pub const Prop = struct { ... }Non-character scene object such as a deployable, pickup, or effect marker.
id: i32,kind: u64,Type id; its meaning depends on the active SDK package.
team: Team = .unknown,owner: i32 = 0,Id of the owning actor; 0 when unowned.
transform: Transform = .{},pub fn viewport() Vec2;Render surface size in logical pixels; zero until the host publishes it shortly after startup.
pub fn scale() f32;UI scale: viewport height over 1080, rounded to a multiple of 0.5 and at least 0.5. 1 before the viewport is published.
pub fn windowPos() Vec2;Top-left of the window in screen pixels.
pub fn windowSize() Vec2;pub fn clientPos() Vec2;Top-left of the client area in screen pixels; differs from windowPos by the border and titlebar in windowed mode.
pub fn clientSize() Vec2;pub fn titlebarHeight() f32;0 for borderless and fullscreen windows.
pub fn uploadBitmap(bgra: []const u8, w: u32, h: u32) u32;Create a texture from tightly packed BGRA8 pixels (w * h * 4 bytes). The pixels are copied, so bgra may be reused immediately. Returns the texture id, or 0 when the size does not match or the upload fails. The texture lives until freeTexture.
pub fn freeTexture(texid: u32) void;The id must not be used afterwards. 0 is ignored.
pub fn drawTexture(texid: u32, x: f32, y: f32) void;Draw a texture at its native size. 0 is ignored.
pub fn drawTextureScaled(texid: u32, x: f32, y: f32, w: f32, h: f32) void;Draw a texture scaled to w by h with nearest-neighbor sampling. 0 is ignored.
pub fn drawLine(x1: f32, y1: f32, x2: f32, y2: f32, color: i32) void;pub fn drawRect(x: f32, y: f32, w: f32, h: f32, color: i32, lineWidth: f32) void;Outlined rectangle with a lineWidth stroke.
pub fn drawFilledRect(x: f32, y: f32, w: f32, h: f32, color: i32) void;pub fn drawCircle(x: f32, y: f32, radius: f32, color: i32, filled: bool) void;pub fn drawGradientLine(x1: f32, y1: f32, x2: f32, y2: f32, color1: i32, color2: i32) void;Line whose color blends from color1 at the first point to color2 at the second.
pub fn drawGradientRect(x: f32, y: f32, w: f32, h: f32, topLeft: i32, topRight: i32, bottomRight: i32, bottomLeft: i32) void;Filled rectangle with one color per corner; diagonal blends split along the top-left to bottom-right diagonal.
pub fn drawRadialCircle(x: f32, y: f32, radius: f32, center: i32, edge: i32) void;Filled disc blending from center at its center to edge at its rim.
pub fn drawGradientTriangle(x0: f32, y0: f32, x1: f32, y1: f32, x2: f32, y2: f32, color0: i32, color1: i32, color2: i32) void;Filled triangle with colors interpolated from its vertices.
pub fn drawText(text: []const u8, x: f32, y: f32, size: f32, color: i32) void;Single-line text with its top-left at (x, y); size is the font height in pixels. At most 256 bytes are drawn.
pub fn drawTextCentered(text: []const u8, x: f32, y: f32, size: f32, color: i32) void;Like drawText, centered horizontally on x.
pub fn drawSphere3D(center: Vec3, radius: f32, color: i32) void;pub fn drawWireSphere3D(center: Vec3, radius: f32, color: i32) void;pub fn drawCapsule3D(a: Vec3, b: Vec3, radius: f32, color: i32) void;Capsule with its axis from a to b.
pub fn drawWireCapsule3D(a: Vec3, b: Vec3, radius: f32, color: i32) void;pub fn drawBox3D(center: Vec3, halfExtents: Vec3, rotation: Quat, color: i32) void;Oriented box with positive local halfExtents and an xyzw unit quaternion rotation.
pub fn drawBox3DWireframe(center: Vec3, halfExtents: Vec3, rotation: Quat, color: i32) void;pub fn drawGradientSphere3D(center: Vec3, radius: f32, colorA: i32, colorB: i32, axis: Vec3) void;Sphere blending from colorA at its -axis extreme to colorB at its +axis extreme. axis must be finite and non-zero.
pub fn drawGradientCapsule3D(a: Vec3, b: Vec3, radius: f32, colorA: i32, colorB: i32) void;Capsule blending from colorA at a to colorB at b; a and b must differ.
pub fn drawGradientBox3D(center: Vec3, halfExtents: Vec3, rotation: Quat, colorA: i32, colorB: i32, axis: Vec3) void;Box like drawBox3D, blending from colorA at its -axis extreme to colorB at its +axis extreme.
pub fn rgba(r: i32, g: i32, b: i32, a: i32) i32;Pack 0-255 channels into a draw color: red in the low byte, alpha in the high byte (0xAABBGGRR).
pub const runtimepub const utilpub fn log(msg: []const u8) void;Emit msg unformatted.
pub fn info(comptime fmt: []const u8, args: anytype) void;Emit an INFO line. Lines are formatted into a 1 KiB buffer; a line that fails to format is replaced by <fmt error>.
pub fn warn(comptime fmt: []const u8, args: anytype) void;Emit a WARN line; see info.
pub fn err(comptime fmt: []const u8, args: anytype) void;Emit an ERROR line; see info.
pub fn logCount() i32;Number of log lines emitted since startup. Only the latest ~1024 lines are retained.
pub fn logHistory(from: i32, to: i32) []const u8;Newline-joined text of log lines [from, to). The result is overwritten by the next call; it is empty when the range is invalid, no longer retained, or over 4 KiB.
pub fn sinf(x: f32) f32;Sine of x radians.
pub fn cosf(x: f32) f32;Cosine of x radians.
pub fn tanf(x: f32) f32;Tangent of x radians.
pub fn asinf(x: f32) f32;Arcsine of x, result in radians.
pub fn acosf(x: f32) f32;Arccosine of x, result in radians.
pub fn atan2f(y: f32, x: f32) f32;Two-argument arctangent of y/x in radians, honoring signs.
pub fn powf(base: f32, exp: f32) f32;base raised to the power exp.
pub fn clampf(val: f32, lo: f32, hi: f32) f32;Clamp val into the inclusive range [lo, hi].
pub fn lerpf(a: f32, b: f32, t: f32) f32;Linear interpolation from a to b by fraction t. t is unclamped.
pub fn distance(x1: f32, y1: f32, x2: f32, y2: f32) f32;Euclidean distance between two-dimensional SDK world-space points (x1, y1) and (x2, y2), returned in meters.
pub fn normalizeAngle(radians: f32) f32;Wrap radians into the range (-π, π].
pub fn random(min: f32, max: f32) f32;Uniform random value in [min, max] from the runtime RNG.
pub fn seedRandom(seed: i32) void;Seed the runtime RNG; deterministic sequences follow for random.
pub const Vec2Alias of Vec2 in the Runtime module.
pub const Vec3Alias of Vec3 in the Runtime module.
pub const Vec4Alias of Vec4 in the Runtime module.
pub const QuatAlias of Quat in the Runtime module.
pub const Mat4Alias of Mat4 in the Runtime module.
pub const quatFromDirectionAlias of Quat.fromDirection in the Runtime module.
pub const quatToDirectionAlias of Quat.toDirection in the Runtime module.
pub const quatAngleBetweenAlias of Quat.angleBetween in the Runtime module.
pub const renderpub fn rgba(r: i32, g: i32, b: i32, a: i32) i32;Pack 0-255 channels into a draw color: red in the low byte, alpha in the high byte (0xAABBGGRR).
pub const elementspub const camerapub const tracepub const benchmarkpub const aimpub const backtrackpub const predictionpub const inputpub fn tickTime() f32;Accumulated simulation time in seconds. Advances once per simulation update by the elapsed time of that update; never decreases within a run.
pub fn frameTime() f32;Accumulated render-frame time in seconds. Advances once per rendered frame; it is wall-clock-paced and does not track game pause.
pub fn isLogicFrame() bool;Whether the current update is a game-logic frame. Set before each simulation update; true when no value has been set.
pub fn Settings(
comptime displayName: []const u8,
comptime Spec: type,
comptime Constraints: anytype,
) type;Declare a user-editable settings category that persists across sessions. displayName must be unique among categories. Each field of Spec is a setting of type bool, i32, u32, i64, f32, or f64 and needs a default value; the settings UI lists fields in declaration order. Constraints maps field names to structs with any of:
.min, .max: bounds of a numeric field..displayName, .description: UI text..control: UI widget, e.g. "multi" or "keybind"..options: labels of a "multi" control. The returned type's data holds the live values.pub fn ActorList(comptime entries: []const ActorListEntry) type;Declare this module's actor roster for per-actor configuration. Ids must be non-zero and unique; names 1 to 64 bytes. The roster is emitted only when the returned type is referenced, e.g. through .count.
pub const ActorListEntryAlias of ActorListEntry in the Actor List module.
pub const KeyAlias of Key in the Input module.
pub const MouseButtonAlias of MouseButton in the Input module.
pub const GameButtonAlias of GameButton in the Input module.
pub const DesireSentinelAlias of DesireSentinel in the Input module.
pub fn keyState(k: Key) u8;pub fn keyStateCode(code: u8) u8;Raw state byte for key code code. Bit 0x10 means the key is down; bit 0x01 means its state changed this input frame (0x11 = pressed, 0x01 = released).
pub fn keyDown(code: u8) bool;pub fn keyPressed(code: u8) bool;Whether the key went down this input frame.
pub fn keyReleased(code: u8) bool;Whether the key went up this input frame.
pub fn isKeyDown(k: Key) bool;pub fn isKeyPressed(k: Key) bool;Whether the key went down this input frame.
pub fn isKeyReleased(k: Key) bool;Whether the key went up this input frame.
pub fn firstKeyPressed() u8;Lowest key code pressed this input frame, or 0 when none was.
pub fn firstKeyDown() u8;Lowest key code currently down, or 0 when none is.
pub fn isMouseButtonPressed(b: MouseButton) bool;Whether mouse button b is currently held.
pub fn mouseDeltaX() f32;Horizontal mouse movement since the previous input frame.
pub fn mouseDeltaY() f32;Vertical mouse movement since the previous input frame.
pub fn mouseX() f32;Mouse X in screen coordinates.
pub fn mouseY() f32;Mouse Y in screen coordinates.
pub const ActorAlias of Actor in the Actor module.
pub const ActorKindAlias of ActorKind in the Actor module.
pub const MotionSampleAlias of MotionSample in the Motion module.
pub const LocalActorAlias of LocalActor in the LocalActor module.
pub fn isKeyOrGameButtonDown(local: *const LocalActor, setting: u32, fallback: GameButton) bool;Resolve a keybind setting against live input:
0xFFFF_FFFF (Default): the fallback game button.0: unbound; never down.pub const PropAlias of Prop in the Prop module.
pub const TeamAlias of Team in the Team module.
pub const TransformAlias of Transform in the Transform module.
pub const GunAlias of Gun in the Gun module.
pub const GunKindAlias of GunKind in the Gun module.
pub const AimTypeAlias of AimType in the Gun module.
pub const EffectTargetAlias of EffectTarget in the Gun module.
pub const AbilityAlias of Ability in the Ability module.
pub const AbilityKindAlias of AbilityKind in the Ability module.
pub const AbilityTypeAlias of AbilityType in the Ability module.
pub const AimSlotRefAlias of AimSlotRef in the Aim module.
pub const AimSlotLatchAlias of AimSlotLatch in the Aim module.
pub const ButtonHolderAlias of ButtonHolder in the ButtonHolder module.
pub const HealthPoolAlias of HealthPool in the HealthPool module.
pub const HealthPoolsAlias of HealthPools in the HealthPool module.
pub const HealthPoolKindAlias of HealthPoolKind in the HealthPool module.
pub const SkeletonAlias of Skeleton in the Skeleton module.
pub const BoneAlias of Bone in the Skeleton module.
pub const LineAlias of Line in the Skeleton module.
pub const SphereAlias of Sphere in the Hitbox module.
pub const CapsuleAlias of Capsule in the Hitbox module.
pub const BoxAlias of Box in the Hitbox module.
pub const HitboxSetAlias of HitboxSet in the Hitbox module.
pub fn actors() []Actor;Actors of the current tick; empty when the active SDK package publishes none.
pub fn props() []Prop;Props of the current tick; empty when the active SDK package publishes none.
pub fn localActor() ?*LocalActor;The local actor of the current tick, or null when none is available.
pub fn actors() []Actor;Actors of the current tick; empty when the active SDK package publishes none.
pub fn props() []Prop;Props of the current tick; empty when the active SDK package publishes none.
pub fn localActor() ?*LocalActor;The local actor of the current tick, or null when none is available.
pub fn Settings(
comptime displayName: []const u8,
comptime Spec: type,
comptime Constraints: anytype,
) type;Declare a user-editable settings category that persists across sessions. displayName must be unique among categories. Each field of Spec is a setting of type bool, i32, u32, i64, f32, or f64 and needs a default value; the settings UI lists fields in declaration order. Constraints maps field names to structs with any of:
.min, .max: bounds of a numeric field..displayName, .description: UI text..control: UI widget, e.g. "multi" or "keybind"..options: labels of a "multi" control. The returned type's data holds the live values.pub const Bone = extern struct { ... }position: runtime.Vec3,Meters, SDK world coordinates.
parent: i32,Index of the parent in the skeleton's bones; negative for a root.
pub const Line = extern struct { ... }Segment between two world positions in meters.
from: runtime.Vec3,to: runtime.Vec3,pub const Skeleton = struct { ... }Skeleton of one entity. bones borrows the current scene snapshot.
bones: []const Bone,pub fn lines(self: Skeleton) []const Line;Parent-to-child segments of the skeleton, at most 256. The result lives in a shared static buffer that the next call on any skeleton overwrites.
pub fn findRoot(self: Skeleton) ?usize;Index of the first root bone.
pub const Team = enum { ... }Relationship of an entity to the local actor.
ally,enemy,neutral,Excluded from ordinary target selection.
unknown,pub fn tickTime() f32;Accumulated simulation time in seconds. Advances once per simulation update by the elapsed time of that update; never decreases within a run.
pub fn frameTime() f32;Accumulated render-frame time in seconds. Advances once per rendered frame; it is wall-clock-paced and does not track game pause.
pub fn isLogicFrame() bool;Whether the current update is a game-logic frame. Set before each simulation update; true when no value has been set.
pub const TraceHit = struct { ... }position: runtime.Vec3,Obstacle position in meters, or the ray end when nothing was hit.
entity: i32,Hit entity id; -1 for geometry hits and misses.
hit: bool,False when the ray completed freely or no collision service is installed.
pub fn trace(from: runtime.Vec3, to: runtime.Vec3, ignoreActorId: i32) TraceHit;Cast a ray between two world points in meters, ignoring the actor with id ignoreActorId (pass the caller's own id to avoid self-hits). Without a collision service the ray always completes freely.
pub const Transform = struct { ... }Pose and motion of an entity. Axis conventions follow the active SDK package.
position: runtime.Vec3 = .{},Meters, SDK world coordinates.
rotation: runtime.Quat = .{},velocity: runtime.Vec3 = .{},Meters per second.
pub fn log(msg: []const u8) void;Emit msg unformatted.
pub fn info(comptime fmt: []const u8, args: anytype) void;Emit an INFO line. Lines are formatted into a 1 KiB buffer; a line that fails to format is replaced by <fmt error>.
pub fn warn(comptime fmt: []const u8, args: anytype) void;Emit a WARN line; see info.
pub fn err(comptime fmt: []const u8, args: anytype) void;Emit an ERROR line; see info.
pub fn logCount() i32;Number of log lines emitted since startup. Only the latest ~1024 lines are retained.
pub fn logHistory(from: i32, to: i32) []const u8;Newline-joined text of log lines [from, to). The result is overwritten by the next call; it is empty when the range is invalid, no longer retained, or over 4 KiB.
pub fn sinf(x: f32) f32;Sine of x radians.
pub fn cosf(x: f32) f32;Cosine of x radians.
pub fn tanf(x: f32) f32;Tangent of x radians.
pub fn asinf(x: f32) f32;Arcsine of x, result in radians.
pub fn acosf(x: f32) f32;Arccosine of x, result in radians.
pub fn atan2f(y: f32, x: f32) f32;Two-argument arctangent of y/x in radians, honoring signs.
pub fn powf(base: f32, exp: f32) f32;base raised to the power exp.
pub fn random(min: f32, max: f32) f32;Uniform random value in [min, max] from the runtime RNG.
pub fn seedRandom(seed: i32) void;Seed the runtime RNG; deterministic sequences follow for random.
pub fn clampf(val: f32, lo: f32, hi: f32) f32;Clamp val into the inclusive range [lo, hi].
pub fn lerpf(a: f32, b: f32, t: f32) f32;Linear interpolation from a to b by fraction t. t is unclamped.
pub fn distance(x1: f32, y1: f32, x2: f32, y2: f32) f32;Euclidean distance between two-dimensional SDK world-space points (x1, y1) and (x2, y2), returned in meters.
pub fn normalizeAngle(radians: f32) f32;Wrap radians into the range (-π, π].
pub const Vec2 = extern struct { ... }2-component vector with component-wise arithmetic. Methods take operands and return results; none mutate in place.
x: f32,y: f32,pub fn init(x: f32, y: f32) Vec2;pub fn add(a: Vec2, b: Vec2) Vec2;pub fn sub(a: Vec2, b: Vec2) Vec2;pub fn scale(a: Vec2, s: f32) Vec2;pub fn dot(a: Vec2, b: Vec2) f32;pub fn lengthSq(a: Vec2) f32;pub fn length(a: Vec2) f32;pub fn normalized(a: Vec2) Vec2;pub fn negate(a: Vec2) Vec2;pub fn lerp(a: Vec2, b: Vec2, t: f32) Vec2;pub fn dist(a: Vec2, b: Vec2) f32;pub fn angle(a: Vec2) f32;pub fn rotate(a: Vec2, rad: f32) Vec2;pub const Vec3 = extern struct { ... }3-component vector with component-wise arithmetic. Components represent unit direction vectors remain dimensionless. Methods take operands and return results; none mutate in place.
x: f32 = 0,y: f32 = 0,z: f32 = 0,pub fn init(x: f32, y: f32, z: f32) Vec3;pub fn add(a: Vec3, b: Vec3) Vec3;pub fn sub(a: Vec3, b: Vec3) Vec3;pub fn mul(a: Vec3, b: Vec3) Vec3;pub fn scale(a: Vec3, s: f32) Vec3;pub fn dot(a: Vec3, b: Vec3) f32;pub fn lengthSq(a: Vec3) f32;pub fn length(a: Vec3) f32;pub fn normalized(a: Vec3) Vec3;pub fn negate(a: Vec3) Vec3;pub fn cross(a: Vec3, b: Vec3) Vec3;pub fn reflect(v: Vec3, n: Vec3) Vec3;pub fn lerp(a: Vec3, b: Vec3, t: f32) Vec3;pub fn dist(a: Vec3, b: Vec3) f32;pub const Vec4 = extern struct { ... }4-component vector with component-wise arithmetic. Methods take operands and return results; none mutate in place.
x: f32 = 0,y: f32 = 0,z: f32 = 0,w: f32 = 0,pub fn init(x: f32, y: f32, z: f32, w: f32) Vec4;pub fn add(a: Vec4, b: Vec4) Vec4;pub fn sub(a: Vec4, b: Vec4) Vec4;pub fn mul(a: Vec4, b: Vec4) Vec4;pub fn scale(a: Vec4, s: f32) Vec4;pub fn dot(a: Vec4, b: Vec4) f32;pub fn lengthSq(a: Vec4) f32;pub fn length(a: Vec4) f32;pub fn normalized(a: Vec4) Vec4;pub fn negate(a: Vec4) Vec4;pub fn lerp(a: Vec4, b: Vec4, t: f32) Vec4;pub const Quat = extern struct { ... }Quaternion with x, y, z vector components and scalar w (identity has w = 1). Methods take operands and return results; none mutate in place.
x: f32 = 0,y: f32 = 0,z: f32 = 0,w: f32 = 1,pub fn identity() Quat;pub fn fromAxisAngle(axis: Vec3, angleRad: f32) Quat;pub fn fromEuler(pitch: f32, yaw: f32, roll: f32) Quat;pub fn mul(a: Quat, b: Quat) Quat;pub fn dot(a: Quat, b: Quat) f32;pub fn length(q: Quat) f32;pub fn normalized(q: Quat) Quat;pub fn conjugate(q: Quat) Quat;pub fn inverse(q: Quat) Quat;pub fn rotateVec3(q: Quat, v: Vec3) Vec3;pub fn slerp(a: Quat, b: Quat, t: f32) Quat;pub fn fromDirection(dir: Vec3) Quat;Create the rotation that takes the default forward axis (0, 0, 1) to dir.
pub fn toDirection(q: Quat) Vec3;The default forward axis (0, 0, 1) rotated by q.
pub fn angleBetween(a: Quat, b: Quat) f32;Shortest angle in radians between two quaternions.
pub const Mat4 = struct { ... }4x4 matrix stored column-major in m (m[col * 4 + row]). World-space transforms use SDK positions in meters; projection matrices therefore consume meter coordinates. Constructors build common transforms; mulVec4/transformPoint/transformDir apply them to vectors.
m: [16]f32,pub fn identity() Mat4;pub fn mul(a: Mat4, b: Mat4) Mat4;pub fn transpose(a: Mat4) Mat4;pub fn mulVec4(a: Mat4, v: Vec4) Vec4;pub fn translation(x: f32, y: f32, z: f32) Mat4;pub fn scaling(x: f32, y: f32, z: f32) Mat4;pub fn rotationX(rad: f32) Mat4;pub fn rotationY(rad: f32) Mat4;pub fn rotationZ(rad: f32) Mat4;pub fn perspective(fovy: f32, aspect: f32, near: f32, far: f32) Mat4;pub fn ortho(left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32) Mat4;pub fn lookAt(eye: Vec3, center: Vec3, up: Vec3) Mat4;pub fn fromQuat(q: Quat) Mat4;pub fn transformPoint(a: Mat4, v: Vec3) Vec3;pub fn transformDir(a: Mat4, v: Vec3) Vec3;pub fn exit(code: i32) void;Request shutdown with status code. Exit happens later, after pending logs are flushed and unload handlers run, so execution continues after this returns.
pub fn sinf(x: f32) f32;Sine of x radians.
pub fn cosf(x: f32) f32;Cosine of x radians.
pub fn tanf(x: f32) f32;Tangent of x radians.
pub fn asinf(x: f32) f32;Arcsine of x, result in radians.
pub fn acosf(x: f32) f32;Arccosine of x, result in radians.
pub fn atan2f(y: f32, x: f32) f32;Two-argument arctangent of y/x in radians, honoring signs.
pub fn powf(base: f32, exp: f32) f32;base raised to the power exp.
pub fn clampf(val: f32, lo: f32, hi: f32) f32;Clamp val into the inclusive range [lo, hi].
pub fn lerpf(a: f32, b: f32, t: f32) f32;Linear interpolation from a to b by fraction t. t is unclamped.
pub fn distance(x1: f32, y1: f32, x2: f32, y2: f32) f32;Euclidean distance between two-dimensional SDK world-space points (x1, y1) and (x2, y2), returned in meters.
pub fn normalizeAngle(radians: f32) f32;Wrap radians into the range (-π, π].
pub fn random(min: f32, max: f32) f32;Uniform random value in [min, max] from the runtime RNG.
pub fn seedRandom(seed: i32) void;Seed the runtime RNG; deterministic sequences follow for random.
pub const Vec2Alias of Vec2 in the Math module.
pub const Vec3Alias of Vec3 in the Math module.
pub const Vec4Alias of Vec4 in the Math module.
pub const QuatAlias of Quat in the Math module.
pub const Mat4Alias of Mat4 in the Math module.
pub fn log(msg: []const u8) void;Emit msg unformatted.
pub fn info(comptime fmt: []const u8, args: anytype) void;Emit an INFO line. Lines are formatted into a 1 KiB buffer; a line that fails to format is replaced by <fmt error>.
pub fn warn(comptime fmt: []const u8, args: anytype) void;Emit a WARN line; see info.
pub fn err(comptime fmt: []const u8, args: anytype) void;Emit an ERROR line; see info.
pub fn logCount() i32;Number of log lines emitted since startup. Only the latest ~1024 lines are retained.
pub fn logHistory(from: i32, to: i32) []const u8;Newline-joined text of log lines [from, to). The result is overwritten by the next call; it is empty when the range is invalid, no longer retained, or over 4 KiB.
pub fn boxCorners(box: anytype) [8]Vec3;The eight world corners of an oriented box. Bit 0 of the index selects +X, bit 1 +Y, and bit 2 +Z; the rotation is normalized first.
pub fn targetWidthDeg(actor: anytype, eye: Vec3) f32;Angular width in degrees of the actor's first valid volume (capsules, then spheres, then boxes) seen from eye. Boxes use their true angular extent; capsules and spheres use their radius at the actor's distance.
pub fn targetRadius(actor: anytype) f32;Radius of the first valid capsule, sphere, or box; for a box, its smallest half-extent. A tuning metric, not hit geometry.
pub const YawPitchDelta = struct { ... }Signed yaw and pitch from one direction to another, in radians, and the length of that pair.
yaw: f32,pitch: f32,magnitude: f32,pub fn yawPitchDistance(viewDir: Vec3, dirToTarget: Vec3) YawPitchDelta;Yaw/pitch difference from viewDir to dirToTarget, each wrapped to (-π, π].
pub fn perturbDirection(baseDir: Vec3, yawRad: f32, pitchRad: f32) Vec3;baseDir turned by yawRad about world up and pitchRad upward, with pitch clamped short of vertical.
pub fn hasUsableHitboxes(actor: anytype, criticalOnly: bool) bool;Whether actor has a valid volume, optionally a critical one.
pub fn pointInHitboxes(actor: anytype, point: Vec3, criticalOnly: bool) bool;Whether point is in or on a valid volume, optionally a critical one.
pub fn rayHitsHitboxes(actor: anytype, rayStart: Vec3, rayDir: Vec3, lead: Vec3, scale: f32, criticalOnly: bool) bool;Whether the ray from rayStart along rayDir hits a valid volume, optionally a critical one. Each volume is first moved by lead (e.g. motion over the flight time); a scale below 1 shrinks volumes toward the actor horizontally. Tangent contact and starting inside count as hits.
pub fn rayHitboxEntryDistance(actor: anytype, from: Vec3, to: Vec3) ?f32;Distance along the segment from -> to to the first valid volume entered, in the endpoints' units; null when the segment misses. Starting inside a volume is distance 0; tangent contact and entering exactly at to count.
pub fn nearestHitboxPoint(actor: anytype, eye: Vec3, viewDir: Vec3, criticalOnly: bool) ?Vec3;The valid volume point needing the smallest angular correction from viewDir. A point where the view ray already enters a volume wins; otherwise the closest silhouette point of the spheres and capsules and the corners and edges of the boxes.
pub const pi: f32pub const tau: f32pub const radToDeg: f32pub const degToRad: f32pub fn normalizeRadians(radians: f32) f32;Wrap radians into the range (-π, π].
pub fn clampPitch(pitch: f32) f32;Clamp a pitch angle to the near-vertical bounds ±1.553343 rad (±89°).
pub fn angleDeg(a: runtime.Vec3, b: runtime.Vec3) f32;Angle in degrees between directions a and b (both are normalized first; a == b yields 0).
pub fn yawPitch(dir: runtime.Vec3) runtime.Vec2;Decompose direction dir into (yaw, pitch): yaw is atan2(z, x) in radians in the XZ plane; pitch is asin(y) in radians.
pub fn fromYawPitch(yaw: f32, pitch: f32) runtime.Vec3;Build a unit direction from yaw and pitch radians (inverse of yawPitch).
pub fn u32ToF32(value: u32) f32;value as a float, for integer settings used in float math.
pub fn clampU32(value: u32, low: u32, high: u32) u32;pub fn accuracyMul(accuracy: u32) f32;Scale an accuracy value in [1, 100] into a [0.02, 1.98] multiplier where 50 maps to 1.0, via (200 - accuracy * 2) * 0.01.
pub fn tickDeltaSeconds(nowSeconds: f32, lastSeconds: *f32) f32;Seconds elapsed between the previous nowSeconds value (tracked through lastSeconds, which this updates) and nowSeconds. Returns 1/60 when the clock did not advance, so callers always get a positive delta.
pub fn logf(x: f32) f32;Natural logarithm of x; returns 0 for non-positive input.
pub fn expf(x: f32) f32;pub fn randomRange(lo: f32, hi: f32) f32;Uniform random value in [lo, hi] from the runtime RNG.
pub fn normalSample() f32;Sample from the standard normal distribution (mean 0, variance 1) via Box-Muller.
pub fn normalCdf(x: f32) f32;Standard normal CDF Φ(x) via the Abramowitz/Stegun 7.1.26 approximation.
pub fn lognormalCdf(t: f32, t0: f32, mu: f32, sigma: f32) f32;Lognormal CDF P(X ≤ t) for a distribution with shift t0, log-space mean mu, and log-space standard deviation. Returns 0 when t ≤ t0.
pub fn lognormalPdf(t: f32, t0: f32, mu: f32, sigma: f32) f32;Lognormal PDF at t for a distribution with shift t0, log-space mean mu, and log-space standard deviation. Returns 0 when t ≤ t0.
pub const Color = struct { ... }8-bit RGBA color.
r: u8,g: u8,b: u8,a: u8,pub fn loadBool(address: usize) bool;Read a bool at linear-memory address, unchecked.
pub fn loadU32(address: usize) u32;Read a u32 at linear-memory address, unchecked.
pub fn loadI32(address: usize) i32;Read an i32 at linear-memory address, unchecked.
pub fn loadF32(address: usize) f32;Read an f32 at linear-memory address, unchecked.
pub fn readU32Le(slot: [16]u8) u32;Little-endian u32 from the first 4 bytes of a settings value slot.
pub fn readF32Le(slot: [16]u8) f32;Little-endian f32 from the first 4 bytes of a settings value slot.
pub fn maskPanelColor(color: u32) u32;color with its alpha byte set to 0xCC.
pub fn argbToHost(color: u32) u32;Convert 0xAARRGGBB to the draw-color order of rgba (0xAABBGGRR).
pub fn containsAsciiLower(haystack: []const u8, needle_lower: []const u8) bool;Whether lowercase ASCII needle_lower occurs in haystack, ignoring the case of haystack.
pub fn asciiLower(ch: u8) u8;pub fn copyText(dst: []u8, src: []const u8) usize;Copy as much of src as fits into dst; returns the bytes copied.
pub const mathpub const randompub const aim