Complete Function List

For the syntax of each function, refer to the page of the function's type.

Standard functions

break() -- jump out of current loop
continue() -- jump to start of next loop
return() -- exit script
goto(label) -- jump to a label in the script
include(lump) -- read the contents of a lump

print(mess, mess, ...) -- print a message to the console
rnd() -- return a random number from 0 to 255
beep() -- make a beeping sound
clock() -- get the current time (100 clocks = 1 second)
wait(n) -- delay for n clocks
startscript(scriptnum) -- start off a new instance of a script


Player-Related Functions



consoleplayer [variable] -- player controlled from this computer
displayplayer [variable] -- player being viewed
playerobj([player]) -- the mobj controlled by a player
playername([player]) -- players name
playermsg(player, mess, ...) -- message to a particular player
playertip(player, mess, ...) -- centremsg to certain player
playeringame(player) -- player in game?


Sector-Related Functions



floorheight(sectag) -- get floor height of sector
floorheight(sectag, newval) -- set floor height
movefloor(sectag, newheight, [speed])
-- gradual move floor height
floortext(sectag) -- floor texture in sector
floortext(sectag, newtexture) -- set floor texture

ceilheight(sectag) -- get ceiling height of sector
ceilheight(sectag, newval) -- set ceiling height
moveceil(sectag, newheight, [speed])
-- gradual move ceiling
ceiltext(sectag) -- get texture of ceiling
ceiltext(sectag, newval) -- set texture of ceiling

lightlevel(sectag) -- get lightlevel
lightlevel(sectag, newval) -- set lightlevel
fadelight(sectag, newval, [speed]) -- fade lightlevel to new value

The following are promised to be implemented in later versions of SMMU:

special -- get/set special sector type
friction -- get/set sector friction
colormap -- get/set sector colormap


Thing-Related Functions



trigger [variable] -- object which triggered script
spawn(type,x,y,[angle]) -- spawn object
removeobj(obj) -- remove object
kill([obj]) -- kill object
teleport([obj], tag) -- teleport object
silentteleport([obj], tag) -- silent teleport object
player([obj]) -- playernum of mobj's controlling player
damageobj([obj]) -- damage an object
objsector([obj]) -- sector tag of sector object is in
objflags(flagnum) -- get flagnum of trigger object
objflags(obj, flagnum) -- get flagnum of object
objflags(obj, flagnum, newval) -- set flag of obj
objhealth([obj]) -- object health
objangle([obj]) -- angle a thing is facing
objx([obj]) -- x co-ordinate of thing
objy([obj]) -- y co-ordinate of thing
objz([obj]) -- z co-ordinate of thing
pushobj(obj, angle, force) -- apply momentum to a thing


Miscellaneous Functions



Messages:

tip(mess, mess, ...) -- centre-of-screen message
message(mess,mess,..) -- normal message

Cameras:

setcamera(obj,[angle]) -- switch to an alternative camera view
clearcamera() -- switch off camera

Levels:

exitlevel() -- same as console command

Sounds:

startsound(thing, lump) -- start sound at a thing
startsectorsound(sectag, lump) -- start sound in sector

Mathematical Functions:

pointtoangle(x1,y1,x2,y2) -- angle of one position from another
pointtodist(x1,y1,x2,y2) -- distance between two points

Other:

zoom [variable] -- zoom in