Script:Files:script/events.script

From Mod Wiki

Jump to: navigation, search
/***********************************************************************

events.script

Defines game events available to script.

***********************************************************************/

/***********************************************************************

	all entities

***********************************************************************/

// Removes this entity from the game.
scriptEvent    void     remove();

// Checks the entity's type
scriptEvent float    isClass( float typeHandle );

// Returns the name of this entity.
scriptEvent    string    getName();

//
scriptEvent    entity     getMaster();

// Activates this entity as if it was activated by a trigger.
// Activator is the entity that caused the action (usually the player).
scriptEvent    void     activate( entity activator );

// Fixes this entity's position and orientation relative to another entity,
// such that when the master entity moves, so does this entity.
scriptEvent    void     bind( entity master );

scriptEvent    void     enableAxisBind( boolean loop );

// Fixes this entity's position (but not orientation) relative to another entity,
// such that when the master entity moves, so does this entity.
scriptEvent    void     bindPosition( entity master );

// Fixes this entity's position and orientation relative to a bone on another entity,
// such that when the master's bone moves, so does this entity.
scriptEvent    void     bindToJoint( entity master, string boneName, boolean rotateWithMaster );

// Detaches this entity from its master.
scriptEvent    void     unbind();

// Removes all attached entities from the game.
scriptEvent    void     removeBinds();

// Sets the model this entity uses.
scriptEvent    void     setModel( string modelName );

// Sets the skin this entity uses.  Set to "" to turn off the skin.
scriptEvent    void     setSkin( string skinName );

scriptEvent    void     setCoverage( float v );

scriptEvent    vector    getWorldAxis( float index );
scriptEvent    void    setWorldAxis( vector fwd, vector right, vector up );

scriptEvent    vector    getGravityNormal();

// Returns the current worldspace position of this entity (regardless of any bind parent).
scriptEvent    vector    getWorldOrigin();

// Sets the current position of this entity (regardless of any bind parent).
scriptEvent    void    setWorldOrigin( vector origin );

// Returns the current position of this entity (relative to bind parent if any).
scriptEvent    vector    getOrigin();

// Sets the current position of this entity (relative to it's bind parent if any).
scriptEvent    void     setOrigin( vector origin );

// Returns the current orientation of this entity (relative to bind parent if any).
scriptEvent    vector    getAngles();

// Sets the current orientation of this entity (relative to bind parent if any).
scriptEvent    void     setAngles( vector angles );

// Sets the gravity activating on this entity
scriptEvent    void     setGravity( vector gravity );

scriptEvent    void     alignToAxis( vector vec, float axis );

// Gets the current linear velocity of this entity. The linear velocity of a physics
// object is a vector that defines the translation of the center of mass in units per second.
scriptEvent    vector    getLinearVelocity();

// Sets the current linear velocity of this entity in units per second. The linear velocity of
// a physics object is a vector that defines the translation of the center of mass in units per second.
scriptEvent    void     setLinearVelocity( vector velocity );

// Gets the current angular velocity of this entity. The angular velocity of
// a physics object is a vector that passes through the center of mass. The
// direction of this vector defines the axis of rotation and the magnitude
// defines the rate of rotation about the axis in radians per second.
scriptEvent    vector    getAngularVelocity();

// Sets the current angular velocity of this entity. The angular velocity of
// a physics object is a vector that passes through the center of mass. The
// direction of this vector defines the axis of rotation and the magnitude
// defines the rate of rotation about the axis in radians per second.
scriptEvent    void     setAngularVelocity( vector velocity );

// Gets the mass of this entity
scriptEvent    float     getMass();

// Gets the center of mass of this entity
scriptEvent    vector     getCenterOfMass();

// Sets the friction of this entity if it is a rigid body
scriptEvent void    setFriction( float linear, float angular, float contact );

// Gets the size of this entity's bounding box.
scriptEvent    vector    getSize();

// Sets the size of this entity's bounding box.
scriptEvent    void     setSize( vector mins, vector maxs );

// Gets the corners of this entity's bounding box
scriptEvent    vector    getMins();
scriptEvent    vector    getMaxs();

// Gets the corners of this entity's absolute (world-space) bounding box
scriptEvent    vector    getAbsMins();
scriptEvent    vector    getAbsMaxs();

// Gets the corners of this entity's render entity bounding box
scriptEvent    vector    getRenderMins();
scriptEvent    vector    getRenderMaxs();

// Overrides the generated render entity bounds
scriptEvent    void    setRenderBounds( vector mins, vector maxs );


// checks if the entity's model is invisible.
scriptEvent    boolean    isHidden();

// Makes this entity invisible.
scriptEvent    void     hide();

// Makes this entity visible if it has a model.
scriptEvent    void     show();

// Returns true if this entity touches the other entity.
scriptEvent    boolean    touches( entity other, boolean ignoreNonTrace );

// Returns true if this entity touches the other entity. Using clip models.
scriptEvent    boolean    touchesBounds( entity other );

// Gets the value of the specified shader parm.
scriptEvent    float    getShaderParm( float parm );

// Sets the value of the specified shader parm.
scriptEvent    void     setShaderParm( float parm, float value );

// Sets shader parms Parm0, Parm1, Parm2, and Parm3 (red, green, blue, and alpha respectively).
scriptEvent    void     setShaderParms( float parm0, float parm1, float parm2, float parm3 );

// Sets the RGB color of this entity (shader parms Parm0, Parm1, Parm2).
scriptEvent    void     setColor( float red, float green, float blue );

// Gets the color of this entity (shader parms Parm0, Parm1, Parm2).
scriptEvent    vector    getColor();

// Stops a specific sound shader on the channel.
scriptEvent    void     stopSound( float channel );

// Plays the sound specified by the snd_* key/value pair on the channel and returns
// the length of the sound. This is the preferred method for playing sounds on an
// entity since it ensures that the sound is precached.
scriptEvent    float    startSound( string sound, float channel );

// Fades the sound on this entity to a new level over a period of time.  Use SND_ANY for all currently playing sounds.
scriptEvent    void     fadeSound( float channel, float newLevel, float fadeTime );

// specify pitch shifting for a channel
scriptEvent    void     setChannelPitchShift( float channel, float shift );

// override sound shader flags for a channel
scriptEvent    void     setChannelFlags( float channel, float flags );
scriptEvent    void     clearChannelFlags( float channel, float flags );

// searches for the name of a spawn arg that matches the prefix.  for example,
// passing in "attack_target" matches "attack_target1", "attack_targetx", "attack_target_enemy",
// etc. The returned string is the name of the key which can then be passed into
// functions like getKey() to lookup the value of that spawn arg.  This
// is usefull for when you have multiple values to look up, like when you
// target multiple objects.  To find the next matching key, pass in the previous
// result and the next key returned will be the first one that matches after
// the previous result.  pass in "" to get the first match.  returns "" when no
// more keys match.  Note to coders: this is the same as MatchPrefix in the game code.
scriptEvent    string    getNextKey( string prefix, string lastMatch );

// Sets a key on this entity's spawn args. Note that most spawn args are evaluated when
// this entity spawns in, so this will not change the entity's behavior in most cases.
// This is chiefly for saving data the script needs in an entity for later retrieval.
scriptEvent    void     setKey( string key, string value );

// Retrieves the value of a specific spawn arg.
scriptEvent    string    getKey( string key );

// Retrieves the integer value of a specific spawn arg.
scriptEvent    float    getIntKey( string key );

// Retrieves the floating point value of a specific spawn arg.
scriptEvent    float    getFloatKey( string key );

// Retrieves the vector value of a specific spawn arg.
scriptEvent    vector    getVectorKey( string key );

// Retrieves the entity specified by the spawn arg.
scriptEvent    entity    getEntityKey( string key );

// Retrieves the value of a specific spawn arg, returning defaultValue if the key is not found.
scriptEvent    string    getKeyWithDefault( string key, string defaultValue );

// Retrieves the integer value of a specific spawn arg, returning defaultValue if the key is not found.
scriptEvent    float    getIntKeyWithDefault( string key, float defaultValue );

// Retrieves the floating point value of a specific spawn arg, returning defaultValue if the key is not found.
scriptEvent    float    getFloatKeyWithDefault( string key, float defaultValue );

// Retrieves the vector value of a specific spawn arg, returning defaultValue if the key is not found.
scriptEvent    vector    getVectorKeyWithDefault( string key, vector defaultValue );

// Retrieves the value of a specific spawn arg stored as playerClass data
scriptEvent    string    getClassKey( string key );

// Returns the distance of this entity to another entity.
scriptEvent    float    distanceTo( entity other );

// Returns the distance of this entity to a point.
scriptEvent    float    distanceToPoint( vector point );

// Suspends execution of the current thread for the given number of seconds.
scriptEvent    void     wait( float time );

scriptEvent void    disablePhysics();
scriptEvent void    enablePhysics();

scriptEvent float    entitiesInTranslation( vector start, vector end, float contentMask, entity passEntity );
scriptEvent float    entitiesInBounds( vector mins, vector maxs, float contentMask, boolean absoluteCoords );
scriptEvent float    entitiesInLocalBounds( vector mins, vector maxs, float contentMask );
scriptEvent float    entitiesInRadius( vector centre, float radius, float contentMask, boolean absoluteCoords );
scriptEvent float    entitiesOfType( float typeHandle );
scriptEvent float    entitiesOfClass( float typeHandle, boolean additive );
scriptEvent float    entitiesOfCollection( string name );
scriptEvent float    filterEntitiesByRadius( vector origin, float radius, boolean inclusive );
scriptEvent float    filterEntitiesByClass( string typeName, boolean inclusive );
scriptEvent float    filterEntitiesByAllegiance( float allegianceFlags, boolean inclusive );
scriptEvent float    filterEntitiesByDisguiseAllegiance( float allegianceFlags, boolean inclusive );
scriptEvent float    filterEntitiesByFilter( float filterIndex, boolean inclusive );
scriptEvent float    filterEntitiesByTouching( boolean inclusive );

scriptEvent float    getBoundsCacheCount();
scriptEvent entity    getBoundsCacheEntity( float index );
scriptEvent float    getSavedCacheCount( float index );
scriptEvent entity    getSavedCacheEntity( float index, float entityIndex );
scriptEvent float    saveCachedEntities();
scriptEvent void    freeSavedCache( float index );


scriptEvent float    getEntityAllegiance( entity other );
scriptEvent boolean    inCollection( string name );

scriptEvent float    getEntityContents();
scriptEvent float    getMaskedEntityContents( float mask );

scriptEvent boolean    takesDamage();
scriptEvent void    setTakesDamage( boolean value );
scriptEvent void    applyDamage( entity inflictor, entity attacker, vector dir, float damageIndex, float damageScale, object traceObject );

scriptEvent void    setNetworkSynced( boolean value );

scriptEvent float    hasAbility( string abilityName );
scriptEvent void    sync( string fieldName );
scriptEvent void    syncBroadcast( string fieldName );
scriptEvent void    syncCallback( string fieldName, string syncFuncName );

scriptEvent handle    playMaterialEffect( string effectname, vector color, string jointname, string materialType, boolean loop );
scriptEvent handle    playJointEffect( string effectname, float jointHandle, boolean loop );
scriptEvent handle    playJointEffectViewSuppress( string effectname, float jointHandle, boolean loop, boolean suppress );
scriptEvent handle    playEffect( string effectname, string jointname, boolean loop );
scriptEvent handle    playOriginEffect( string effectname, string materialType, vector origin, vector forward, boolean loop );

scriptEvent handle    playEffectMaxVisDist( string effectname, string jointname, boolean loop, float maxVisDist, boolean isStatic );
scriptEvent handle    playOriginEffectMaxVisDist( string effectname, string materialType, vector origin, vector forward, boolean loop, float maxVisDist, boolean isStatic );

scriptEvent handle    playBeamEffect( string effectname, string materialType, vector origin, vector endOrigin, boolean loop );
scriptEvent    string    lookupEffect( string effectname, string materialType );

scriptEvent void    stopEffect( string effectname );
scriptEvent void    killEffect( string effectname ); // Will destroy all of the current particles as well
scriptEvent void    stopEffectHandle( handle effectHandle );
scriptEvent void    unBindEffectHandle( handle effectHandle );
scriptEvent void    setEffectAttenuation( handle effectHandle, float attenuation );
scriptEvent void    setEffectRenderBounds( handle effectHandle, boolean loop );
scriptEvent void    setEffectColor( handle effectHandle, vector color, float alpha );
scriptEvent void    setEffectOrigin( handle effectHandle, vector origin );
scriptEvent void    setEffectAngles( handle effectHandle, vector angles );
scriptEvent vector    getEffectOrigin( handle effectHandle );
scriptEvent vector    getEffectEndOrigin( handle effectHandle );
scriptEvent void    stopAllEffects();

scriptEvent void    detachRotationBind( handle effectHandle );

scriptEvent void    clearContacts();
scriptEvent void    setContents( float contents );
scriptEvent void    setClipmask( float clipmask );
scriptEvent void    putToRest();
scriptEvent boolean    hasForceDisableClip();
scriptEvent void    forceDisableClip();
scriptEvent void    forceEnableClip();
scriptEvent boolean    hasGroundContacts();
scriptEvent void    disableGravity( boolean disable );
scriptEvent void    setComeToRest( boolean enabled );
scriptEvent void    applyImpulse( vector point, vector impulse );
scriptEvent void    addForce( vector force );
scriptEvent void    addForceAt( vector force, vector pos );
scriptEvent void    addTorque( vector torque );
scriptEvent void    activatePhysics();

// returns true if object is not moving
scriptEvent    boolean    isAtRest();

// returns true if object is bound
scriptEvent    boolean    isBound();

scriptEvent void    turnTowards( vector dir, float maxAngularSpeed );
scriptEvent object    getGameTeam();
scriptEvent void    setGameTeam( object team );
scriptEvent entity    launchMissileSimple( entity owner, entity owner2, entity enemy, float projectileDefIndex, float projectileDefIndex, float spread, vector origin, vector velocity );
scriptEvent void    launchBullet( entity owner, entity ignoreEntity, float projectileDefIndex, float spread, vector origin, vector direction, float tracer, boolean useAntiLag ); // hit scan

scriptEvent entity    getLocalPlayer();
scriptEvent entity    getLocalViewPlayer();

scriptEvent float    getGUI( string name );
scriptEvent void    setGUITheme( float guiHandle, string name );
scriptEvent void     guiPostNamedEvent( float guiHandle, string window, string eventName );

scriptEvent boolean    pointInRadar( vector point, float type, boolean ignoreJammers );

scriptEvent void     disableImpact();
scriptEvent void     enableImpact();

scriptEvent void     disableKnockback();
scriptEvent void     enableKnockback();

scriptEvent void     sendNetworkCommand( string message );
scriptEvent void     sendNetworkEvent( entity p, string message );

scriptEvent void    preventDeployment( boolean prevent );

scriptEvent float    allocBeam( string shader );
scriptEvent void    updateBeam( float beamHandle, vector start, vector end, vector color, float alpha, float width );
scriptEvent void    freeBeam( float beamHandle );
scriptEvent void    freeAllBeams();

scriptEvent entity    getNextTeamEntity();

// smaller values are drawn after larger values
scriptEvent float    allocHudModule( string name, float sort, boolean allowInhibit );
scriptEvent void    freeHudModule( float handle );

scriptEvent boolean    requestDeployment( entity p, float deployObjectIndex, vector position, float yaw, float delay );
scriptEvent boolean    requestCheckedDeployment( entity p, float deployObjectIndex, float yaw, float delay );

scriptEvent vector    getWorldMins();
scriptEvent vector    getWorldMaxs();

scriptEvent void    setDeploymentObject( float deployObjectIndex );
scriptEvent void    setDeploymentState( float deployObjectState );

scriptEvent void    setDeploymentMode( boolean mode );
scriptEvent boolean    getDeploymentMode();
scriptEvent float    getDeploymentRotation();
scriptEvent boolean    allowDeploymentRotation();

scriptEvent float    getDefaultFov();

scriptEvent    void     setHealth( float health );
scriptEvent    float    getHealth();
scriptEvent    void     setMaxHealth( float health );
scriptEvent    float    getMaxHealth();
scriptEvent    entity    getEnemy();

scriptEvent void    setCanCollideWithTeam( boolean canCollide );

// creates an OBJECT and returns a reference to it
scriptEvent    entity    spawnClientEffect( string classname );
scriptEvent    entity    spawnClientCrawlEffect( string classname, entity ent, float crawlTime );

scriptEvent void    setEffectEndOrigin( vector endPos );
scriptEvent void    setEffectLooping( boolean looping );
scriptEvent void    endEffect( boolean destroyParticles );

// returns the spawn ID of the entity as a hex-encoded string
scriptEvent string    getSpawnID();

scriptEvent float    isSpotted();
scriptEvent void    setSpotted( entity spotter );

scriptEvent void    forceNetworkUpdate();

scriptEvent float    getEntityNumber();

scriptEvent void    disableCrosshairTrace( boolean value );

scriptEvent float    isInWater();

scriptEvent float    getDamageScale();
scriptEvent string    getDefaultSurfaceType();

/***********************************************************************

	system events (called via 'sys.')

***********************************************************************/

scriptEvent void    addCheapDecal( entity attachTo, vector origin, vector normal, string decalKeyName, string surfaceTypeName );

scriptEvent object    createMaskEditSession();

scriptEvent    string    handleToString( handle h );
scriptEvent    handle    stringToHandle( string s );

scriptEvent    wstring    toWStr( string str );

// Pushes a localization argument for formatting
scriptEvent    void     pushLocString( wstring str );
scriptEvent void    pushLocStringIndex( handle index );

// Returns a localized string for the current language, formatting in any 
// arguments pushed via pushLocString
scriptEvent wstring    localizeStringIndexArgs( handle index );
scriptEvent    wstring    localizeStringArgs( string str );

// Returns a localized string handle
scriptEvent    handle     localizeString( string str );

// Terminates a thread.
scriptEvent    void     terminate( float threadNumber );

// Suspends execution of the current thread for the given number of seconds.
scriptEvent    void     wait( float time );

// Suspends execution for one game frame.
scriptEvent    void     waitFrame();

// Prints the given string to the console.
scriptEvent    void     print( string text );

// Prints the given line to the console.
scriptEvent    void     println( string text );

// Breaks if the condition is zero. (Only works in debug builds.)
scriptEvent    void     assert( boolean condition );

// Returns a wrapper object for a cvar.
scriptEvent    object    getCVar( string name, string defaultValue );

// Returns a random value X where 0 <= X < range.
scriptEvent    float    random( float range );

// Returns the current game time in seconds.
scriptEvent    float    getTime();

// Kills all threads with the specified name
scriptEvent    void     killThread( string threadName );

// Sets the name of the current thread.
scriptEvent    void     threadName( string name );

// Returns a reference to the entity with the specified hex-encoded spawn ID.
scriptEvent    entity    getEntityByID( string id );

// Returns a reference to the entity with the specified name.
scriptEvent    entity    getEntity( string name );

// Creates an entity of the specified classname and returns a reference to the entity.
scriptEvent    entity    spawn( string classname );

// Creates a client entity of the specified classname and returns a reference to it.
scriptEvent    entity    spawnClient( string classname );

// Creates an entity of the specified class type index and returns a reference to the entity.
scriptEvent    entity    spawnType( float entityDefIndex );

// Returns a forward vector for the given Euler angles.
scriptEvent    vector    angToForward( vector angles );

// Returns a right vector for the given Euler angles.
scriptEvent    vector    angToRight( vector angles );

// Returns an up vector for the given Euler angles.
scriptEvent    vector    angToUp( vector angles );

// Returns the sine of the given angle in degrees.
scriptEvent    float    sin( float degrees );

// Returns the inverse sine of the given value in degrees.
scriptEvent float    asin( float a );

// Returns the cosine of the given angle in degrees.
scriptEvent    float    cos( float degrees );

// Returns the angle in degrees of the given dot.
scriptEvent    float    acos( float dot );

scriptEvent    float    atan( float a );
scriptEvent    float    atan2( float a1, float a2 );
scriptEvent    float    getRoot( float index );
scriptEvent    float    solveRoots( float a, float b, float c );

// Returns an angle in the range -180 -> 180
scriptEvent    float    angleNormalize180( float angle );

// Returns the absolute value of a number
scriptEvent    float    fabs( float value );

// Returns the floor of a number
scriptEvent    float    floor( float value );

// Returns the ceil of a number
scriptEvent    float    ceil( float value );

// Returns value % modulus
scriptEvent    float    mod( float value, float modulus );        // integer mod
scriptEvent    float    fmod( float value, float modulus );        // floating point mod

// Returns the square root of the given number.
scriptEvent    float    sqrt( float square );

// Returns the normalized version of the given vector.
scriptEvent    vector    vecNormalize( vector vec );

// Returns the length of the given vector.
scriptEvent    float    vecLength( vector vec );

scriptEvent    float    vecLengthSquared( vector vec );

// Returns the cross product of the two vectors.
scriptEvent    vector    crossProduct( vector vec1, vector vec2 );

// Returns Euler angles for the given direction.
scriptEvent    vector    vecToAngles( vector vec );

// Rotates a vector by a set of angles
scriptEvent    vector    rotateVecByAngles( vector vec, vector angles );

// Rotates a one set of angles by another set of angles
scriptEvent    vector    rotateAngles( vector ang1, vector ang2 );

// Rotates a vector about an axis
scriptEvent    vector    rotateVec( vector vec, vector axis, float angle );

// Transforms a vector into the local space of an entity
scriptEvent    vector    toLocalSpace( vector vec, entity ent );

// Transforms a vector from the local space of an entity to world space
scriptEvent    vector    toWorldSpace( vector vec, entity ent );

// Returns the contents in the bounds specified by mins & maxs & origin, based on the mask
// The 'passEntity' is considered non-solid for the check.
scriptEvent float    checkContents( vector origin, vector mins, vector maxs, float contents_mask, object passEntity );

// Returns the fraction of movement completed before the box from 'mins' to 'maxs' hits solid geometry
// when moving from 'start' to 'end'. The 'passEntity' is considered non-solid during the move.
scriptEvent    float    trace( vector start, vector end, vector mins, vector maxs, float contents_mask, object passEntity );

// Returns the fraction of movement completed before the trace hits solid geometry
// when moving from 'start' to 'end'. The 'passEntity' is considered non-solid during the move.
scriptEvent    float    tracePoint( vector start, vector end, float contents_mask, object passEntity );

// Returns the fraction of movement completed before the box from 'mins' to 'maxs' at 'angles' hits solid geometry
// when moving from 'start' to 'end'. The 'passEntity' is considered non-solid during the move.
scriptEvent    float    traceOriented( vector start, vector end, vector mins, vector maxs, vector angles, float contents_mask, object passEntity );

scriptEvent    object    saveTrace();
scriptEvent    void    freeTrace( object index );

// Returns the fraction of movement completed during the last call to trace or tracePoint.
scriptEvent float    getTraceFraction();

// Returns the position the trace stopped due to a collision with solid geometry during the last call to trace or tracePoint
scriptEvent vector    getTraceEndPos();

// Returns the collision point from a collision with solid geometry during the last call to trace or tracePoint
scriptEvent vector    getTracePoint();

// Returns the normal of the hit plane during the last call to trace or tracePoint
scriptEvent vector    getTraceNormal();

// Returns a reference to the entity which was hit during the last call to trace or tracePoint
scriptEvent entity    getTraceEntity();

// Returns the flags of the surface type hit during the last call to trace
scriptEvent float    getTraceSurfaceFlags();

// Returns the name of the surface type hit during the last call to trace
scriptEvent string    getTraceSurfaceType();

// Returns the color of the surface type hit during the last call to trace
scriptEvent vector    getTraceSurfaceColor();

// Returns the number of the skeletal joint closest to the location on the entity which was hit
// during the last call to trace or tracePoint
scriptEvent string    getTraceJoint();

// Returns the number of the body part of the entity which was hit during the last call to trace or tracePoint
scriptEvent string    getTraceBody();

// Starts playing background music.
scriptEvent    void     music( string shaderName );

// Plays a sound on the local player head, on the specified channel
scriptEvent    void     startSoundDirect( string shaderName, float channel );

// Issues an error.
scriptEvent    void     error( string text );

// Issues a warning.
scriptEvent    void     warning( string text );

// Returns the number of characters in the string
scriptEvent    float    strLength( string text );

// Returns a string composed of the first num characters
scriptEvent    string    strLeft( string text, float num );

// Returns a string composed of the last num characters
scriptEvent    string    strRight( string text, float num );

// Returns the string following the first num characters
scriptEvent    string    strSkip( string text, float num );

// Returns a string composed of the characters from start to start + num
scriptEvent    string    strMid( string text, float start, float num );

// Returns the numeric value of a string
scriptEvent float    strToFloat( string text );

// networking - checks for client
scriptEvent boolean    isClient();

// networking - are you running a server? ( listen or dedicated )
scriptEvent boolean    isServer();

// networking - running a demo or have a local client.
scriptEvent boolean    doClientSideStuff();

// returns the length of time between game frames.  this is not related to renderer frame rate.
scriptEvent float    getFrameTime();

// returns the number of game frames per second.  this is not related to renderer frame rate.
scriptEvent float    getTicsPerSecond();

// line drawing for debug visualization.  lifetime of 0 == 1 frame.
scriptEvent    void     debugLine( vector color, vector start, vector end, float lifetime );
scriptEvent    void     debugArrow( vector color, vector start, vector end, float size, float lifetime );
scriptEvent    void     debugCircle( vector color, vector origin, vector dir, float radius, float numSteps, float lifetime );
scriptEvent    void     debugBounds( vector color, vector mins, vector maxs, float lifetime );

// Command map icon stuff
scriptEvent    float     allocCMIcon( entity owner, float sort );
scriptEvent    void     freeCMIcon( entity owner, float iconHandle );
scriptEvent    void     setCMIconSize( float iconHandle, float size );
scriptEvent    void     setCMIconUnknownSize( float iconHandle, float size );
scriptEvent    void     setCMIconSize2d( float iconHandle, float sizeX, float sizeY );
scriptEvent    void     setCMIconUnknownSize2d( float iconHandle, float sizeX, float sizeY );
scriptEvent    void     setCMIconSizeMode( float iconHandle, float mode );
scriptEvent    void     setCMIconPositionMode( float iconHandle, float mode );
scriptEvent    void     setCMIconOrigin( float iconHandle, vector origin );
scriptEvent    void     setCMIconColor( float iconHandle, vector color, float alpha );
scriptEvent    void     setCMIconColorMode( float iconHandle, float mode );
scriptEvent    void     setCMIconDrawMode( float iconHandle, float mode );
scriptEvent    void     setCMIconAngle( float iconHandle, float angle );
scriptEvent    void     setCMIconSides( float iconHandle, float sides );
scriptEvent    void     showCMIcon( float iconHandle );
scriptEvent    void     hideCMIcon( float iconHandle );
scriptEvent    void     addCMIconRequirement( float iconHandle, string requirement );
scriptEvent    void     setCMIconMaterial( float iconHandle, float material );
scriptEvent    void     setCMIconUnknownMaterial( float iconHandle, float material );
scriptEvent    void     setCMIconFireteamMaterial( float iconHandle, float material );
scriptEvent    void     setCMIconGuiMessage( float iconHandle, string message );
scriptEvent    void     setCMIconFlag( float iconHandle, float flag );
scriptEvent    void     clearCMIconFlag( float iconHandle, float flag );
scriptEvent    void     setCMIconArcAngle( float iconHandle, float arcAngle );
scriptEvent    void     setCMIconShaderParm( float iconHandle, float index, float value );
scriptEvent float    getCMIconFlags( float iconHandle );
scriptEvent    void     flashCMIcon( float iconHandle, float materialIndex, float seconds, float setFlags );

// text drawing for debugging.  align can be 0-left, 1-center, 2-right.  lifetime of 0 == 1 frame.
scriptEvent    void     drawText( string text, vector origin, float scale, vector color, float align, float lifetime );

scriptEvent void    broadcastToolTip( float toolTipIndex, entity other, wstring str1, wstring str2, wstring str3, wstring str4 );

scriptEvent float    getDeclType( string name );
scriptEvent float    getDeclCount( float declType );
scriptEvent float    getDeclIndex( float declType, string name );
scriptEvent string    getDeclName( float declType, float declIndex );
scriptEvent void    applyRadiusDamage( vector org, entity inflictor, entity attacker, entity ignore, entity ignorePush, float damageIndex, float damageScale, float radiusScale );
scriptEvent boolean    filterEntity( float filterIndex, entity other );
scriptEvent float    getTableCount( float tableIndex );
scriptEvent float    getTableValue( float tableIndex, float valueIndex );
scriptEvent float    getTableValueExact( float tableIndex, float valueIndex );

scriptEvent float    allocDecal( string materialName );
scriptEvent void    projectDecal( float decalHandle, vector origin, vector direction, float depth, boolean parallel, vector size, float angle, vector color );
scriptEvent void    freeDecal( float decalHandle );
scriptEvent void    resetDecal( float decalHandle );

// Gets a type handle for a type name
scriptEvent float    getTypeHandle( string typename );

scriptEvent float    argc();
scriptEvent string    argv( float index );
scriptEvent float    argvf( float index );
scriptEvent void    setActionCommand( string message );

scriptEvent object    getTeam( string name );
scriptEvent void    setWinningTeam( object team );
scriptEvent void    endGame();
scriptEvent void    setEndGameCamera( entity other );

// Play an effect in the world.  Effect name is an actual string,
// not a dict entry.  Make sure to precache the effect.  Also note that these can't loop.
scriptEvent void    playWorldEffect ( string effectName, vector color, vector org, vector forward );
scriptEvent void    playWorldEffectRotate ( string effectName, vector color, vector org, vector forward, vector rot );
scriptEvent void    playWorldEffectRotateAlign ( string effectName, vector color, vector org, vector forward, vector rot, entity ent );
scriptEvent void    playWorldBeamEffect( string effectname, vector color, vector origin, vector endOrigin );

scriptEvent void    setGUIFloat( float guiHandle, string name, float value );
scriptEvent void    setGUIHandle( float guiHandle, string name, handle value );
scriptEvent void    setGUIVec2( float guiHandle, string name, float x, float y );
scriptEvent void    setGUIVec3( float guiHandle, string name, float x, float y, float z );
scriptEvent void    setGUIVec4( float guiHandle, string name, float x, float y, float z, float w );
scriptEvent void    setGUIString( float guiHandle, string name, string value );
scriptEvent void    setGUIWString( float guiHandle, string name, wstring value );
scriptEvent float    getGUIFloat( float guiHandle, string name );
//scriptEvent float	addNotifyIcon( float guiHandle, string window, string material );
//scriptEvent void	removeNotifyIcon( float guiHandle, string window, float handle );
//scriptEvent void	bumpNotifyIcon( float guiHandle, string window, float handle );

scriptEvent void    clearDeployRequest( float deployIndex );
scriptEvent float    getDeployMask( string name );
scriptEvent float    checkDeployMask( vector mins, vector maxs, float deployMaskHandle );
scriptEvent float    getWorldPlayZoneIndex( vector point );

scriptEvent float    allocTargetTimer( string name );
scriptEvent float    getTargetTimerValue( float targetTimerHandle, entity p );
scriptEvent void    setTargetTimerValue( float targetTimerHandle, entity p, float value );

scriptEvent string    getEntityDefKey( float entityDefIndex, string key );
scriptEvent float    getEntityDefIntKey( float entityDefIndex, string key );
scriptEvent float    getEntityDefFloatKey( float entityDefIndex, string key );
scriptEvent vector    getEntityDefVectorKey( float entityDefIndex, string key );

scriptEvent float    getMaxClients();
scriptEvent entity    getClient( float index );

scriptEvent entity    getTerritoryForPoint( vector point, object team, boolean requireTeam, boolean requireActive );

scriptEvent float    getMatchTimeRemaining();
scriptEvent float    getMatchState();                    // see GS_* defines

// stats
scriptEvent handle    allocStatInt( string name );
scriptEvent handle    allocStatFloat( string name );
scriptEvent void    increaseStatInt( handle h, float playerIndex, float count );
scriptEvent void    increaseStatFloat( handle h, float playerIndex, float count );
scriptEvent float    getStatValue( handle h, float playerIndex );

scriptEvent string    getClimateSkin( string key );

// both sender and recipient can be null, sender == null = high command message, recipient == null = team or global message
scriptEvent void    sendQuickChat( entity sender, float quickChatIndex, entity recipient );

scriptEvent entity    getContextEntity();

scriptEvent void    pushEndGameStat( entity p, float value );
scriptEvent void    sendEndGameStats();

// a very approximate point trace using the heightmap - great for really really rough approximations
scriptEvent float    heightMapTrace( vector start, vector end );
scriptEvent void    enableBotReachability (string name, float team, boolean enable);

scriptEvent float    getNextBotActionIndex( float statIndex, float type );
scriptEvent vector    getBotActionOrigin( float index );
scriptEvent float    getBotActionDeployableType( float index );
scriptEvent float    getBotActionBaseGoalType( float index, object team );

/***********************************************************************

	lights

***********************************************************************/

// Turns the light/speaker on.
scriptEvent    void     turnOn();

// Turns the light/speaker off.
scriptEvent    void     turnOff();

/***********************************************************************

	func_forcefield

***********************************************************************/

// Turns the forcefield on and off.
scriptEvent    void     toggle();


/***********************************************************************

	func_animate

***********************************************************************/

// Switches to a ragdoll taking over the animation.
scriptEvent    void     startRagdoll();

/***********************************************************************

	func_movers

***********************************************************************/

scriptEvent void    setToggle( boolean toggle );

/***********************************************************************

	doors

***********************************************************************/

// Enables the door.
scriptEvent    void     enable();

// Disables the door.
scriptEvent    void     disable();

// Opens the door.
scriptEvent    void     open();

// Closes the door.
scriptEvent    void     close();

// Door state queries
scriptEvent    boolean    isOpen();
scriptEvent    boolean    isClosed();
scriptEvent    boolean    isOpening();
scriptEvent    boolean    isClosing();

// Gets the master entity of a door chain
scriptEvent    entity    getMoveMaster();

// Gets the next entity in the door chain
scriptEvent    entity    getNextSlave();

/***********************************************************************

	func_moveable

***********************************************************************/

// Makes the moveable non-solid for other entities.
scriptEvent    void     becomeNonSolid();

// enable/disable damage
scriptEvent void    enableDamage( boolean enable );


/***********************************************************************

	sdGeneralMover

***********************************************************************/

// start the entity moving specifying the duration of the move
scriptEvent void    startTimedMove( float from, float to, float seconds );

// move directly to the position
scriptEvent void    setPosition( float index );

// gets the number of positions available for use
scriptEvent float    getNumPositions();

// add a position to the end of the list, dir should be normalised or zero (to not change dir)
scriptEvent float    addPosition( vector pos, vector dir );

// get the state of the entity
scriptEvent float    getMoverState();

// whether or not to apply damage (using damage_mover_crush) to the blocking entity (on by default)
scriptEvent void    killBlockingEntity( boolean kill );


/***********************************************************************

	skeletal