This is a function reference for scripters and modders.  If you're not familiar with data types, you may find this helpful:

int = a whole number like 0, 1, 55 etc.
bool = can have two values - true or false.
float = a "real number" with six decimal places e.g. 1, 5.589, 6.2, 3.14 ....
string = a combination or "string" of characters and/or numbers.  These are put in quotes e.g. "this is a string"

entity = an object which represents a unit in the game.  Each entity has its own set of functions and attributes.
handle = each entity has a number assigned to it that the engine uses as its "ID". 
  
============================================================
Class: Output

WriteLog(...) - accepts any number of arguments of any type.  All parameters are converted to strings.  Output is NORMAL style log.
==============================================================
Class: Entity

getEntityByHandle( int handle ) - returns the entity with the specified handle.
getEntityTemplateName( string name ) - returns the entity template object that has the specified name.

issueCommand( entity(s), int order_type, args[0], args[1]) - this will create a command, or order, for an entity or group of entities.  This entity(s) is specified in the first parameter.  order_type should be one of the net messages listed in the "net message order" section.  args is an array that contains the data necessary for the order.  For example, if it is a location message such as NMT_GOTO, args[0] should be the x coordinate of the destination and args[1] should be the y coordinate.  See functions_sim_entity.js worldClickHandler for more information.

createEntityFormation( entities, string name ) - creates a formation of type "name" out of the units in "entities".
removeFromFormation( entity(s) ) - removes the entity(s) from their formation.  It is required that if it is a group, they are all in the same formation.
lockEntityFormation( entity, bool lock ) - If lock is true, the formation "entity" is in will be locked.  Otherwise, it will be unlocked.
isFormationLocked( entity ) -returns true if the entity's formation is locked, otherwise false.

startPlacing( string name ) - Activates the building placement cursor for placing a building.  "name" is the name of the entity to place.  Returns true on sucess
==========================================================
Class: Events
 
AddGlobalHandler(  string event_name, function handler ) - Registers a global handler for the specified DOM event.  function handler can be a fragment or function.  Returns true on success, else false.
RemoveGlobalHandler(  string event_name, function handler ) -  Removes a global handler.   function handler can be a fragment or function.  Returns true success.
==========================================================
Class Timer:

setTimeout( code, int time ) - time is a delay in milliseconds.  When this time has elapsed, "code" is executed once.  Code can be a fragment or function 
Example: setTimeout( console.write("1 second passed"), 1000 ); Returns the ID of the timer (int).

setIntervel( code, int time ) - nearly the same as setTimeout(), but "code" is executed every "time" milliseconds instead of once after a single delay.
cancelIntervel() - causes all functions registered with setInterval to no longer be called.
cancelTimer(int ID) - causes the timer or interval with this ID to longer be called.
====================================================
Class GameSetup:

createServer() - creates and returns a network server object
createClient() – creates and returns a client server object

startGame() – begins the process of starting the game.  Returns true on success.  –may be changed soon

endGame() – immediately ends the game
=================================================
Class Internationalization:

loadLanguage( string language ) – replaces the current langauge with “language”.
getLanguageID() - returns the name of the current language [string].
=================================================
Class GUI:

getGUIGlobal() - returns the "global" object associated with the current GUI.
=================================================
Class Misc. Engine:

getFPS() - returns the frame rate of the game [int].
exitProgram() - causes the game to exit.
changeCursor(string cursor) - changes the cursor to [string]. Cursors are stored in "art\textures\cursors" and "cursor" is the basename of the texture.
_lodbias(float sharpness) - changes the sharpness of textures (to "sharpness).
setCameraTarget(CVector3D position) - move the camera to look at "position".  Returns true on success. 

v3dist( CVector3D a, CVector3D b ) - returns the distance between vectors a and b [float].
toggleWater() - toggles the rendering of water.
===============================================
Class water:

setWaterHeight( float height ) - changes the height of the water to "height".
getWaterHeight() - returns the height of the water plane [float].
setWaterColor( float r, float g, float b ) - sets the color of the water plane to the specified components.
setWaterMaxAlpha( float max ) - sets the maximum alpha value (when the water is at WaterFullDepth or deeper)
setWaterFullDepth( float depth ) - sets WaterFullDepth to "depth"-lower values result in water becoming opaque faster as the water gets deeper.
setAlphaWaterOffset( float offset ) - sets the water alpha offset (added to tweak water alpha near the shore).
==================================================
isPaused() - returns true if the game is paused (else false).
setPaused(bool pause) -  if true, the game is paused, else unpaused.
getGameTime() - returns the amount of time elapsed since the start of the game.