
//    Doom FraggleScript functions.
//      subject to change. functions marked with '*' not yet implemeted

//      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
input()                 -- get input from the user (not implemented in doom)
beep()                  -- make a beeping sound
clock()                 -- get the current time (100 clocks = 1 second)
startscript(scriptnum)  -- start off a new instance of a script

// Wait functions

wait(n)                 -- delay for n clocks (1 clock = 1/100 second)
tagwait(n)              -- wait for all sectors w/tag n to stop moving
scriptwait(n)           -- wait for all instances of script n to finish

//      player:         (some functions default to triggering player)
//              eg. 

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:

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                     -- as floor height
moveceil                       -- as movefloor 
ceiltext                       -- as for floortext

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

colormap(sectag)               -- get colormap used in sector
colormap(sectag, newmap)       -- set colormap in sector

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

//      mobj:   (defaults to trigger object on some funcs)

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

//      messaging:

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
changehublevel(levelname, sectag)
                           -- go to another level in the hub
                              levelname: level to go to
                              sectag: must have sector in both levels of the
                                      same shape and with this tag
                                      for 'seamless' movement between levels
*changelevel               -- like 'map' command

//      sound: (lump is string w/o 'ds' eg. "frad" = DSFRAD lump)

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

//      trig 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


// suggestions for new functions: email me
// <sfraggle@sfrag.free-online.co.uk>
