United Offensive stock script API registry

Scope

This appendix records the callable and field names registered by the stock multiplayer game module. The project’s recovered STRICT_STOCK source is the exclusive authority. Names added only by maintained compatibility, diagnostic, or safety code are not included.

This is a registry reference, not a promise that every method accepts every object subtype. A method name can compile because it exists in the global method resolver and still reject the receiver or arguments at runtime. The language rules and call syntax are specified in United Offensive scripting language.

Name resolution

Global function names are searched in a 120-entry table. Method names are searched in this exact order:

  1. player methods (60 entries);

  2. script-mover methods (12 entries);

  3. vehicle methods (31 entries);

  4. HUD-element methods (14 entries);

  5. generic built-in methods (56 entries).

Each table uses exact string comparison. Script identifiers have already been canonicalized to lowercase by the scanner.

The registry contains two deliberate duplicate slots:

  • precacheturret appears twice in the global-function table and resolves to the same callback;

  • getentitynumber appears twice in the generic-method table and resolves to the same callback.

The first matching entry wins.

Global functions

Developer-only functions

These names are marked developer-only by the stock registry:

  • print

  • println

  • assert

All other global registry entries have the ordinary availability flag. Outside /# ... #/, a developer-only call is legal only as a statement and the compiler conditionally retains it as developer code. Inside a developer region, it follows the ordinary call-expression rules.

Console, messaging, and diagnostics

  • print

  • println

  • iprintln

  • iprintlnbold

  • print3d

  • line

  • assert

  • logprint

  • exec

  • resettimeout

  • prof_begin

  • prof_end

prof_begin and prof_end are present but their stock game callbacks have empty bodies.

Entity creation, lookup, and testing

  • getent

  • getentarray

  • spawn

  • spawntriggermount

  • spawnturret

  • spawnstruct

  • isdefined

  • isalive

  • isvalidplayer

  • getentbynum

  • getbrushmodelcenter

  • bullettrace

  • worldentnumber

  • positionwouldtelefrag

  • isplayer

  • isplayernumber

  • getnumparts

  • getpartname

Cvars, time, and level control

  • getcvar

  • getcvarint

  • getcvarfloat

  • setcvar

  • makecvarserverinfo

  • gettime

  • getstarttime

  • map_restart

  • exitlevel

  • addtestclient

  • setarchive

Weapons and animation queries

  • getweaponmodel

  • getweaponclassname

  • getfullclipammo

  • getanimlength

  • animhasnotetrack

Objectives and multiplayer state

  • objective_add

  • objective_delete

  • objective_state

  • objective_icon

  • objective_position

  • objective_onentity

  • objective_current

  • objective_team

  • setwinningplayer

  • setwinningteam

  • announcement

  • clientannouncement

  • getteamscore

  • setteamscore

  • setclientnamemode

  • updateclientnames

  • getteamplayersalive

  • obituary

Scalar, random, vector, and angle operations

  • getmovedelta

  • getangledelta

  • randomint

  • randomfloat

  • randomintrange

  • randomfloatrange

  • sin

  • cos

  • tan

  • asin

  • acos

  • atan

  • distance

  • distancesquared

  • length

  • lengthsquared

  • closer

  • vectordot

  • vectornormalize

  • vectortoangles

  • anglestoup

  • anglestoright

  • anglestoforward

Audio

  • musicplay

  • musicstop

  • soundfade

  • ambientplay

  • ambientstop

Precache and registration

  • precachemodel

  • precacheshellshock

  • precacheitem

  • precacheshader

  • precachestring

  • precachevehicle

  • precacheturret (two registry slots)

  • precachemenu

  • precachestatusicon

  • precacheheadicon

Effects, damage, and environment

  • loadfx

  • rewindfx

  • playfx

  • playfxontag

  • playloopedfx

  • playfxonplayer

  • setwind

  • setcullfog

  • setexpfog

  • grenadeexplosioneffect

  • radiusdamage

  • setplayerignoreradiusdamage

  • earthquake

HUD and vehicles

  • newhudelem

  • newclienthudelem

  • newteamhudelem

  • getnumvehicles

Method registries

Player methods

  • giveweapon

  • takeweapon

  • takeallweapons

  • getcurrentweapon

  • hasweapon

  • switchtoweapon

  • givestartammo

  • giveclipammo

  • givemaxammo

  • getfractionstartammo

  • getfractionmaxammo

  • setorigin

  • setplayerangles

  • usebuttonpressed

  • attackbuttonpressed

  • meleebuttonpressed

  • isads

  • isinvehicle

  • isonground

  • pingplayer

  • setviewmodel

  • getviewmodel

  • sayall

  • sayteam

  • saysquad

  • allowcomplaint

  • showscoreboard

  • setspawnweapon

  • dropitem

  • finishplayerdamage

  • suicide

  • openmenu

  • openmenunomouse

  • closemenu

  • freezecontrols

  • disableweapon

  • enableweapon

  • setreverb

  • getweaponslotweapon

  • setweaponslotweapon

  • getweaponslotammo

  • setweaponslotammo

  • getweaponslotclipammo

  • setweaponslotclipammo

  • iprintln

  • iprintlnbold

  • spawn

  • setentertime

  • cloneplayer

  • setclientcvar

  • islookingat

  • playlocalsound

  • playlocalannouncersound

  • allowspectateteam

  • getguid

  • getfatigue

  • setfatigue

  • autodemostart

  • autodemostop

  • autoscreenshot

Script-mover methods

These are resolved after player methods and before vehicle methods:

  • moveto

  • movex

  • movey

  • movez

  • movegravity

  • rotateto

  • rotatepitch

  • rotateyaw

  • rotateroll

  • rotatevelocity

  • solid

  • notsolid

Vehicle methods

  • attachpath

  • startpath

  • setswitchnode

  • setwaitnode

  • setwaitspeed

  • setspeed

  • resumespeed

  • joltbody

  • freevehicle

  • getwheelsurface

  • getspeedmph

  • getvehicleowner

  • startenginesound

  • stopenginesound

  • makevehicleusable

  • makevehicleunusable

  • addvehicletocompass

  • removevehiclefromcompass

  • setturrettargetvec

  • setturrettargetent

  • clearturrettarget

  • fireturret

  • firealtturret

  • firegunner

  • isturretready

  • get_fire_time

  • getaltheat

  • getgunnerheat

  • getaltoverheating

  • getgunneroverheating

  • getdismountspot

HUD-element methods

  • settext

  • setshader

  • settimer

  • settimerup

  • settenthstimer

  • settenthstimerup

  • setclock

  • setclockup

  • setvalue

  • fadeovertime

  • scaleovertime

  • moveovertime

  • reset

  • destroy

Generic built-in methods

  • getstance

  • attach

  • detach

  • detachall

  • getattachsize

  • getattachmodelname

  • getattachtagname

  • getattachignorecollision

  • linkto

  • unlink

  • enablelinkto

  • getorigin

  • geteye

  • useby

  • istouching

  • lockdoor

  • unlockdoor

  • isdoorlocked

  • playsound

  • playloopsound

  • stoploopsound

  • delete

  • setmodel

  • getnormalhealth

  • setnormalhealth

  • dodamage

  • dodamagemod

  • settakedamage

  • show

  • hide

  • unlinkfromworld

  • linkintoworld

  • verifyposition

  • clearvehicleposition

  • setcontents

  • setbounds

  • setcursorhint

  • sethintstring

  • shellshock

  • stopshellshock

  • viewkick

  • localtoworldcoords

  • setrightarc

  • setleftarc

  • settoparc

  • setbottomarc

  • getentitynumber (two registry slots)

  • enablegrenadetouchdamage

  • disablegrenadetouchdamage

  • enablegrenadebounce

  • disablegrenadebounce

  • placespawnpoint

  • spawnduplicate

  • getturretheat

  • getturretoverheating

Script-visible fields

Entity and spawn fields

The spawn parser and live entity-field registry expose the same ordered field set. time aliases the storage used by speed; _color aliases color; and shard aliases count.

Field

Value class

Live entity write behavior

classname

string

Read-only after spawn.

origin

vector

Custom origin setter.

model

model/string

Read-only after spawn.

spawnflags

int

Read-only after spawn.

speed, closespeed

float

Writable.

target, targetname, message, teamname

string

Writable.

wait, random

float

Writable.

count, health

int

Writable; health uses its custom setter.

light

light field

Special spawn-time conversion; the live generic field bridge has no getter or setter case for this type.

dmg

int

Writable.

angles

vector

Custom angle setter.

duration

float

Writable.

rotate

vector

Writable.

degrees, time

float

Writable. time aliases speed storage.

_color, color

vector

Writable aliases.

key

int

Writable.

harc, varc

float

Writable.

delay

float

Writable.

radius, missionlevel, start_size, end_size

int

Writable.

shard

int

Writable alias of count.

spawnitem, track

string

Writable.

vehicletype

string

Read-only after spawn.

capturing

int

Writable.

vehicle_owner

entity

Writable entity reference.

Player/client fields

Field

Value class

Access

name

string

Read-only.

sessionteam

custom string/team

Read/write.

sessionsquad

custom string/squad

Read/write.

sessionstate

custom string/state

Read/write.

maxhealth

int

Read/write through custom setter.

maxspeed

int

Read/write through custom setter.

handicap

int

Read-only.

score

int

Read/write through custom setter.

deaths

int

Read/write.

statusicon

custom string/icon

Read/write.

headicon

custom string/icon

Read/write.

headiconteam

custom string/team

Read/write.

spectatorclient

int

Read/write through custom setter.

archivetime

float seconds

Read/write; stored internally in milliseconds.

pers

object-like field

Read-only.

noinactivitykick

int

Read/write. The C registry label is noInactivityKick; source identifiers are canonicalized to lowercase.

HUD-element fields

Field

Value class

Notes

x, y

int

Screen position components.

fontscale

float

Uses the stock font-scale setter.

font

string enum

default, bigfixed, or smallfixed.

alignx

string enum

left, center, or right.

aligny

string enum

top, middle, or bottom.

color

vector

RGB conversion through the stock color setter/getter.

alpha

float

Alpha conversion through the stock setter/getter.

label

localized string

Set through the localized-string field handler.

sort

float

Sort key.

archived

bool/int

Selects archived rather than current HUD transmission.

Vehicle path-node fields

The vehicle path-node field bridge exposes:

Field

Value class

targetname, target

string

origin, angles

vector

speed, lookahead

float

Vehicle path-node fields are read-only through the script object-field bridge.

Implementation basis

The registry counts, names, order, and flags above come from the maintained stock tables in script_builtins.c, script_player.c, vehicle.c, hudelem.c, and client_fields.c. Entity/spawn fields come from the two ordered field tables in script_builtins.c. Method lookup order comes from Scr_GetMethod in that same source area.