/*********************************************************************** events.script Defines game events available to script. ***********************************************************************/ /*********************************************************************** all entities ***********************************************************************/ // Removes this entity from the game. scriptEvent void remove(); // Returns the name of this entity. scriptEvent string getName(); // Sets the name of this entity. scriptEvent void setName( string name ); // 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 ); // Causes this entity to activate all it's targets. Similar to how a trigger activates entities. // Activator is the entity that caused the action (usually the player). scriptEvent void activateTargets( entity activator ); // Returns the number of entities this entity has targeted. scriptEvent float numTargets(); // Returns the requested target entity. scriptEvent entity getTarget( float num ); // Returns a random targeted entity. Pass in an entity name to skip that entity. scriptEvent entity randomTarget( string ignoreName ); // Fixes this entity's position and orientation relative to another entity, // such that when the master entity moves, so does thisentity. scriptEvent void bind( entity master ); // 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, float rotateWithMaster ); // Detaches this entity from its master. scriptEvent void unbind(); // Removes all attached entities from the game. scriptEvent void removeBinds(); // Sets the owner of this entity. Entity's will never collide with their owner. scriptEvent void setOwner( entity owner ); // 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 ); // 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 ); // 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 size of this entity's bounding box. scriptEvent vector getSize(); // Sets the size of this entity's bounding box. scriptEvent void setSize( vector min, vector max ); // Gets the minimum corner of this entity's bounding box. scriptEvent vector getMins(); // Gets the maximum corner of this entity's bounding box. scriptEvent vector getMaxs(); // checks if the entity's model is invisible. scriptEvent float 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 float touches( entity other ); // Disables the callback function on the specified signal. scriptEvent void clearSignal( float signalNum ); // 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(); // ensure the specified sound shader is loaded by the system. prevents cache hits when playing sound shaders. scriptEvent void cacheSoundShader( string shaderName ); // Plays a specific sound shader on the channel and returns the length of the sound in // seconds. This is not the prefered method of playing a sound since you must ensure // that the sound is loaded. scriptEvent float startSoundShader( string shaderName, float channel ); // Stops a specific sound shader on the channel. scriptEvent void stopSound( float channel, float netSync ); // 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, float netSync ); // Fades the sound on this entity to a new level over a period of time. Use SND_CHANNEL_ANY for all currently playing sounds. scriptEvent void fadeSound( float channel, float newLevel, float fadeTime ); // Sets a parameter on this entity's GUI. scriptEvent void setGuiParm( string key, string value ); // Sets a parameter on this entity's GUI. scriptEvent void setGuiFloat( string key, float value ); // 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 ); // Returns this entity to the position stored in the "origin" spawn arg. // This is the position the entity was spawned in unless the "origin" key is changed. // Note that there is no guarantee that the entity won't be stuck in another entity // when moved, so care should be taken to make sure that isn't possible. scriptEvent void restorePosition(); // 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 ); // Starts an FX on this entity. scriptEvent void startFx( string fx ); // Suspends execution of current thread for one game frame. scriptEvent void waitFrame(); // checks if an entity's script object has a specific function scriptEvent float hasFunction( string functionName ); // calls a function on an entity's script object scriptEvent void callFunction( string functionName ); // enables or prevents an entity from going dormant scriptEvent void setNeverDormant( float enable ); // RAVEN BEGIN // kfuller: added scriptEvent void setSpawnVector(string key, vector vec); // bdube: surface events scriptEvent void hideSurface ( string surfacelist ); scriptEvent void showSurface ( string surfacelist ); scriptEvent void setContents ( float contents ); scriptEvent void guiEvent ( string eventName ); // bdube: effect events scriptEvent void playEffect ( string effectName, string boneName, float loop ); scriptEvent void stopEffect ( string effectName ); scriptEvent float getHealth ( ); // nmckenzie: To check who an entity is bound to. // Returns the bind master for the current entity. scriptEvent entity getBindMaster(); // Applies an impulse to the current entity. scriptEvent void applyImpulse( entity source, vector point, vector impulse ); // abahr: scriptEvent void removeNullTargets(); scriptEvent float isA( string className ); scriptEvent float isSameTypeAs( entity ent ); scriptEvent string matchPrefix( string prefix, string previousPrefix ); scriptEvent void clearTargetList( float destroyContents ); // twhitaker: used to add and remove to and from an entity's list of targets scriptEvent float appendTarget( entity ent ); scriptEvent void removeTarget( entity ent ); // RAVEN END /*********************************************************************** system events (called via 'sys.') ***********************************************************************/ // Terminates a thread. scriptEvent void terminate( float threadNumber ); // Pauses the current thread. scriptEvent void pause(); // 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(); // Waits for the given entity to complete it's move. scriptEvent void waitFor( entity mover ); // Waits for the given thread to terminate. scriptEvent void waitForThread( float threadNumber ); // Prints the given string to the console. scriptEvent void print( string text ); // Prints the given line to the console. scriptEvent void println( string text ); // Multiplayer - Print this line on the network scriptEvent void say( string text ); // Breaks if the condition is zero. (Only works in debug builds.) scriptEvent void assert( float condition ); // Triggers the given entity. scriptEvent void trigger( entity entityToTrigger ); // Sets a cvar. scriptEvent void setcvar( string name, string value ); // Returns the string for a cvar. scriptEvent string getcvar( string name ); // 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 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 ); // Respawn scriptEvent void respawn( ); // copies the spawn args from an entity scriptEvent void copySpawnArgs( entity ent ); // Sets a key/value pair to be used when a new entity is spawned. scriptEvent void setSpawnArg( string key, string value ); // Returns the string for the given spawn argument. scriptEvent string SpawnString( string key, string default ); // Returns the floating point value for the given spawn argument. scriptEvent float SpawnFloat( string key, float default ); // Returns the vector for the given spawn argument. scriptEvent vector SpawnVector( string key, vector default ); // clears data that persists between maps scriptEvent void clearPersistantArgs(); // Sets a key/value pair that persists between maps scriptEvent void setPersistantArg( string key, string value ); // Returns the string for the given persistant arg scriptEvent string getPersistantString( string key ); // Returns the floating point value for the given persistant arg scriptEvent float getPersistantFloat( string key ); // Returns the vector for the given persistant arg scriptEvent vector getPersistantVector( string key ); // 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 cosine of the given angle in degrees. scriptEvent float cos( float degrees ); // 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 ); // Returns the dot product of the two vectors. scriptEvent float DotProduct( vector vec1, vector vec2 ); // 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 ); // Sets a script callback function for when the given signal is raised on the given entity. scriptEvent void onSignal( float signalNum, entity ent, string functionName ); // Clears the script callback function set for when the given signal is raised on the given entity. scriptEvent void clearSignalThread( float signalNum, entity ent ); // Turns over view control to the given camera entity. scriptEvent void setCamera( entity cameraEnt ); // Returns view control to the player entity. scriptEvent void firstPerson(); // 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, entity 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, entity passEntity ); // 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 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 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(); // Fades towards the given color over the given time in seconds. scriptEvent void fadeIn( vector color, float time ); // Fades from the given color over the given time in seconds. scriptEvent void fadeOut( vector color, float time ); // Fades to the given color up to the given alpha over the given time in seconds. scriptEvent void fadeTo( vector color, float alpha, float time ); // Starts playing background music. scriptEvent void music( string shaderName ); // 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 ); // damages entities within a radius defined by the damageDef. inflictor is the entity causing the damage and can be the same as the attacker (in the case // of projectiles, the projectile is the inflictor, while the attacker is the character that fired the projectile). ignore is an entity to not cause damage to. // dmgPower scales the damage (for cases where damage is dependent on time). scriptEvent void radiusDamage( vector origin, entity inflictor, entity attacker, entity ignore, string damageDefName, float dmgPower ); // networking - checks for client scriptEvent float isClient(); // checks if it's a multiplayer game scriptEvent float isMultiplayer(); // 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 ); // 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 ); // checks if an influence is active scriptEvent float influenceActive(); // RAVEN BEGIN // nmckenzie: 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 org, vector angle ); // abahr: scriptEvent entity refProxy( string scriptObjectName ); scriptEvent void releaseProxy( string scriptObjectName ); scriptEvent float clampFloat( float min, float max, float val ); scriptEvent float minFloat( float val1, float val2 ); scriptEvent float maxFloat( float val1, float val2 ); scriptEvent float strFind( string source, string sub ); scriptEvent float randomInt( float range ); // rjohnson: scriptEvent void setSpecialEffect( float effect, float enabled ); scriptEvent void setSpecialEffectParm( float effect, float parm, float value ); // asalmon: // does something on the pc. scriptEvent void awardAchievement(string name); // twhitaker: ceil, floor and intVal scriptEvent float ceil( float val ); scriptEvent float floor( float val ); scriptEvent float intVal( float val ); // jdischler: send named event string to specified gui. // valid guiEnums are: GUI_PLAYERHUD, GUI_CINEMATICHUD, GUI_VEHICLEHUD scriptEvent void sendNamedEvent( float guiEnum, string namedEvent ); // nrausch: change a material's sort order - SS_GUI, SS_DECAL, etc. scriptEvent void setMatSort( string materialname, string materialvalue ); // RAVEN END /*********************************************************************** cameras ***********************************************************************/ // Starts a spline or anim camera moving. scriptEvent void start(); // Stops a spline or anim camera moving. scriptEvent void stop(); // Returns true if a mover is moving scriptEvent float isMoving(); // Returns true if a mover is rotating scriptEvent float isRotating(); // RAVEN BEGIN // bdube: added // Set the cameras FOV scriptEvent void setFOV ( float fov ); // Blend the cameras FOV from the beingFOV to the endFOV over the given blendTime scriptEvent void blendFOV ( float beginFOV, float endFOV, float blendTime ); // Return the cameras current FOV scriptEvent float getFOV ( ); // RAVEN END /*********************************************************************** lights ***********************************************************************/ // Sets the shader to be used for the light. scriptEvent void setShader( string shader ); // Gets a shader parameter. scriptEvent float getLightParm( float parmNum ); // Sets a shader parameter. scriptEvent void setLightParm( float parmNum, float value ); // Sets the red/green/blue/alpha shader parms on the light and the model. scriptEvent void setLightParms( float parm0, float parm1, float parm2, float parm3 ); // Sets the width/length/height of the light bounding box. scriptEvent void setRadiusXYZ( float x, float y, float z ); // Sets the size of the bounding box. scriptEvent void setRadius( float radius ); // Turns the light on. scriptEvent void On(); // Turns the light off. scriptEvent void Off(); // Turns the light out over the given time in seconds. scriptEvent void fadeOutLight( float time ); // Turns the light on over the given time in seconds. scriptEvent void fadeInLight( float time ); // Set current light level (range is 0 to "levels") scriptEvent void setCurrentLightLevel ( float level ); // RAVEN BEGIN // kfuller: added events scriptEvent float isOn(); scriptEvent void break(entity activator, float turnOff); // RAVEN END /*********************************************************************** func_forcefield ***********************************************************************/ // Turns the forcefield on and off. scriptEvent void Toggle(); /*********************************************************************** func_animate ***********************************************************************/ // Launches a projectile. scriptEvent void launchMissiles( string projectilename, string sound, string launchbone, string targetbone, float numshots, float framedelay ); // Switches to a ragdoll taking over the animation. scriptEvent void startRagdoll(); // Changes to left foot and plays footstep sound. scriptEvent void leftFoot(); // Changes to right foot and plays footstep sound. scriptEvent void rightFoot(); // RAVEN BEGIN // bdube: added scriptEvent void setAnimState( string stateFunction, float blendFrames ); // RAVEN END /*********************************************************************** func_movers ***********************************************************************/ // Stops any translational movement. scriptEvent void stopMoving(); // Stops any rotational movement. scriptEvent void stopRotating(); // Sets the movement speed. Set this speed before initiating a new move. scriptEvent void speed( float speed ); // Sets the movement time. Set this time before initiating a new move. scriptEvent void time( float time ); // Sets the deceleration time. Set this deceleration time before initiating a new move. scriptEvent void decelTime( float time ); // Sets the acceleration time. Set this acceleration time before initiating a new move. scriptEvent void accelTime( float time ); // Initiates a translation to the position of an entity. // Uses the current speed/time and acceleration and deceleration settings. scriptEvent void moveTo( entity targetEntity ); // Initiates a translation to an absolute position. // Uses the current speed/time and acceleration and deceleration settings. scriptEvent void moveToPos( vector pos ); // Initiates a translation with the given distance in the given yaw direction. // Uses the current speed/time and acceleration and deceleration settings. scriptEvent void move( float angle, float distance ); // Initiates an acceleration to the given speed over the given time in seconds. scriptEvent void accelTo( float speed, float time ); // Initiates a deceleration to the given speed over the given time in seconds. scriptEvent void decelTo( float speed, float time ); // Initiates a rotation about the given axis by decreasing the current angle towards the given angle. // Uses the current speed/time and acceleration and deceleration settings. scriptEvent void rotateDownTo( float axis, float angle ); // Initiates a rotation about the given axis by increasing the current angle towards the given angle. // Uses the current speed/time and acceleration and deceleration settings. scriptEvent void rotateUpTo( float axis, float angle ); // Initiates a rotation towards the given Euler angles. // Uses the current speed/time and acceleration and deceleration settings. scriptEvent void rotateTo( vector angles ); // Initiates a rotation with the given angular speed. // Uses the current speed/time and acceleration and deceleration settings. scriptEvent void rotate( vector angleSpeed ); // Initiates a rotation towards the current angles plus the given Euler angles. // Uses the current speed/time and acceleration and deceleration settings. scriptEvent void rotateOnce( vector angles ); // Initiates a translation back and forth along the given vector with the given speed and sphase. scriptEvent void bob( float speed, float phase, vector distance ); // Initiates a rotation back and forth along the given angles with the given speed and phase. scriptEvent void sway( float speed, float phase, vector angles ); // Opens the renderer portal associated with this mover. scriptEvent void openPortal(); // Closes the renderer portal associated with this mover. scriptEvent void closePortal(); // Sets the sound to be played when the mover accelerates. scriptEvent void accelSound( string sound ); // Sets the sound to be played when the mover decelerates. scriptEvent void decelSound( string sound ); // Sets the sound to be played when the moving. scriptEvent void moveSound( string sound ); // Enables aligning the mover with the spline direction. scriptEvent void enableSplineAngles(); // Disables aligning the mover with the spline direction. scriptEvent void disableSplineAngles(); // Subtracts the initial spline angles to maintain the initial orientation of the mover. scriptEvent void removeInitialSplineAngles(); // Starts moving along a spline stored on the given entity. scriptEvent void startSpline( entity spline ); // Stops moving along a spline. scriptEvent void stopSpline(); // RAVEN BEGIN // bdube: added // Moves an elevator to the given floor scriptEvent void gotoFloor( float floor ); // abahr: scriptEvent entity getSplineEntity(); // Call after changing floor related key/values to update the floor information of the elevator scriptEvent void updateFloorInfo ( ); // RAVEN END /*********************************************************************** 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(); // Locks or unlocks the door. scriptEvent void lock( float locked ); // Returns true if the door is open. scriptEvent float isOpen(); // Returns true if the door is locked. scriptEvent float isLocked(); /*********************************************************************** four fingered claw ***********************************************************************/ scriptEvent void setFingerAngle( float angle ); scriptEvent void stopFingers(); /*********************************************************************** func_moveable ***********************************************************************/ // Makes the moveable non-solid for other entities. scriptEvent void becomeNonSolid(); // returns true if object is not moving scriptEvent float isAtRest(); // enable/disable damage scriptEvent void canDamage( float enable ); /*********************************************************************** func_moveable_spline ***********************************************************************/ scriptEvent void setSpline( entity spline ); scriptEvent void setAccel( float accel ); scriptEvent void setDecel( float decel ); scriptEvent void setSpeed( float speed ); scriptEvent float getSpeed(); scriptEvent void setIdealSpeed( float speed ); scriptEvent float getIdealSpeed(); scriptEvent void applySpeedScale( float scale ); scriptEvent string getCurrentTrackInfo(); scriptEvent string getTrackInfo( entity track ); scriptEvent void useMountedGun( entity user ); //toggle this on and off to assign the tramCar to be the forwardDamageEnt for the player. scriptEvent void setPlayerDamageEnt( float set ); /*********************************************************************** vehicle_tramCar ***********************************************************************/ scriptEvent void setIdealTrack( string track ); scriptEvent entity driverSpeak( string voKey ); scriptEvent entity getDriver(); scriptEvent void openDoors(); scriptEvent void closeDoors(); /*********************************************************************** skeletal animation (weapons, players, ai, func_animated) ***********************************************************************/ // Looks up the number of the specified joint. Returns INVALID_JOINT if the joint is not found. scriptEvent float getJointHandle( string jointname ); // Clears all animations running on the entity scriptEvent void clearAnims(); // Removes any custom transforms on all joints. scriptEvent void clearAllJoints(); // Removes any custom transforms on the specified joint. scriptEvent void clearJoint( float jointnum ); // Modifies the position of the joint based on the transform type. scriptEvent void setJointPos( float jointnum, float transform_type, vector pos ); // Modifies the orientation of the joint based on the transform type. scriptEvent void setJointAngle( float jointnum, float transform_type, vector angles ); // returns the position of the joint in world space scriptEvent vector getJointPos( float jointnum ); // returns the angular orientation of the joint in world space scriptEvent vector getJointAngle( float jointnum ); // bdube: programmer controlled joint events scriptEvent void setJointAngularVelocity ( string jointName, float pitch, float yaw, float roll, float blendtime ); scriptEvent void collapseJoints ( string jointnames, string collapseToJoint ); /*********************************************************************** actors (players and AI) ***********************************************************************/ // Turns the actors flashlight on and off scriptEvent void flashlight( float enable ); // Moves the constraint with the given name that binds this entity to another entity. scriptEvent void SetConstraintPosition( string constraintName, vector position ); // Enable / Disable eye focus. scriptEvent void enableEyeFocus(); scriptEvent void disableEyeFocus(); // Enable / Disable eye blinking. scriptEvent void enableBlinking(); scriptEvent void disableBlinking(); // Changes to left foot and plays footstep sound. scriptEvent void leftFoot(); // Changes to right foot and plays footstep sound. scriptEvent void rightFoot(); // Stops the animation currently playing on the given channel over the given number of frames. scriptEvent void stopAnim( float channel, float frames ); // Plays the given animation on the given channel. Returns false if anim doesn't exist. scriptEvent float playAnim( float channel, string animName ); // Continuously repeats the given animation on the given channel. Returns false if anim doesn't exist. scriptEvent float playCycle( float channel, string animName ); // Plays the given idle animation on the given channel. Returns false if anim doesn't exist. scriptEvent float idleAnim( float channel, string animName ); // sets the blend amount on multi-point anims. scriptEvent void setSyncedAnimWeight( float channel, float animindex, float weight ); // Sets the number of frames to blend between animations on the given channel. scriptEvent void setBlendFrames( float channel, float blendFrame ); // Returns the number of frames to blend between animations on the given channel. scriptEvent float getBlendFrames( float channel ); // Returns true if the animation playing on the given channel // is completed considering a number of blend frames. scriptEvent float animDone( float channel, float blendOutFrames ); // Disables the animation currently playing on the given channel and syncs // the animation with the animation of the nearest animating channel. scriptEvent void overrideAnim( float channel ); // Prevents any pain animation from being played for the given time in seconds. scriptEvent void preventPain( float duration ); // Enables animation on the given channel. scriptEvent void enableAnim( float channel, float blendFrames ); // Disables pain animations. scriptEvent void disablePain(); // Enables pain animations. scriptEvent void enablePain(); // Sets a string which is placed in front of any animation names. scriptEvent void setAnimPrefix( string prefix ); // Returns true if the actor has one or more enemies. scriptEvent float hasEnemies(); // Returns the next enemy the actor has acquired. scriptEvent entity nextEnemy( entity lastEnemy ); // Returns the enemy closest to the given location. scriptEvent entity closestEnemyToPoint( vector point ); // returns the entity used for the character's head, if it has one. scriptEvent entity getHead(); scriptEvent void enterVehicle ( entity vehicle ); scriptEvent void exitVehicle ( float force ); // adjust the animation rate for an actor, it will be multiplied by the passed in parameter. scriptEvent void setAnimRate ( float multiplier ); // finds an enemy for the AI scriptEvent entity findEnemy ( float distSquared ); //plays specified effect (must be precached ("fx_whatever") in entitydef or map spawnArgs) crawling down joints for specified number of seconds scriptEvent void jointCrawlEffect ( string effectKeyName, float seconds ); /*********************************************************************** players ***********************************************************************/ // Returns the button state from the current user command. scriptEvent float getButtons(); // Returns the movement relative to the player's view angles from the current user command. // vector_x = forward, vector_y = right, vector_z = up scriptEvent vector getMove(); // Returns the player view angles. scriptEvent vector getViewAngles(); // Sets the player view angles. scriptEvent void setViewAngles( vector euler ); // Enables the player weapon. // This will also give the player the default weapon. If weapons were disabled on the world spawn this will enable them. scriptEvent void enableWeapon(); // Lowers and disables the player weapon. scriptEvent void disableWeapon(); // Returns "weaponX" where X is the number of the weapon the player is currently holding. scriptEvent string getCurrentWeapon(); // Returns "weaponX" where X is the number of the weapon the player was previously holding. scriptEvent string getPreviousWeapon(); // Selects the weapon the player is holding. scriptEvent void selectWeapon( string weapon ); // Returns the entity for the player's weapon scriptEvent entity getWeaponEntity(); scriptEvent vector getViewPos(); // Returns data about how much ammo a player has for a given ammoClass. x = current ammo, y = capacity, z = x/y; scriptEvent vector getAmmoData( string ammoClass); // Refills all the ammo for any weapon the player is carrying scriptEvent void refillAmmo(); // RAVEN BEGIN // mekberg: allow enable/disable of objectives scriptEvent void enableObjectives(); scriptEvent void disableObjectives(); scriptEvent void setExtraProjPassEntity( entity passEntity ); //MCG: set armor scriptEvent void setArmor( float armor ); //MCG: damage effect direct call, damageFromEnt is the entity the damage should appear to come from on the indicator, it can be NULL/"none" scriptEvent void damageEffect( string damageDefName, entity damageFromEnt ); //disable or enable falling damage (1/0) //scriptEvent void allowFallDamage( float allow ); /*********************************************************************** AI characters and monsters ***********************************************************************/ // Disable / Enable the entity as a target for the ai (works on ai entities and the player) scriptEvent void enableTarget ( ); scriptEvent void disableTarget ( ); // directly damages the given entity using the given damage def scriptEvent void directDamage ( entity damageTarget, string damageDef ); // returns true if the AI can currently become solid scriptEvent float canBecomeSolid ( ); // swtich to and from a solid state scriptEvent void becomeSolid ( ); scriptEvent void becomeNonSolid ( ); // switch between passive and aggressive scriptEvent void becomePassive ( float ignoreEnemies ); scriptEvent void becomeAggressive ( ); // switch immeidately into ragdoll scriptEvent float becomeRagdoll ( ); // Set the health of the AI scriptEvent void setHealth ( float health ); // Tell the AI if it can take damage or not scriptEvent void takeDamage ( float yesOrNo ); // Tell the AI if he is undying or not scriptEvent void setUndying ( float yesOrNo ); // Face towards the given entity scriptEvent void faceEntity ( entity ent ); // Kills the monster. scriptEvent void kill ( ); // Removes the monster and updates its spawner, if it has one scriptEvent void removeUpdateSpawner ( ); // Set the prefix used on all passive key/values such as "anim__idle" and "lipsync__talk_primary" scriptEvent void setPassivePrefix ( string prefix ); // Sets whether the player can talk to this character or not. The 'idleAnim' is used when switching // to TALK_OK, it will be the animation to play when not talking. If none is given the anim specified // in the "anim" key/value will be used. scriptEvent void setTalkState ( float state ); // Resets back to saying "lipsync_talk_primary" when TALK_OK scriptEvent void resetTalkCount (); // Set the movement speed // - AIMOVESPEED_DEFAULT // - AIMOVESPEED_RUN // - AIMOVESPEED_WALK scriptEvent void setMoveSpeed ( float speed ); // force the posture of a tactical ai entity (posture list is in defs.h as AIPOSTURE_* ) scriptEvent void forcePosture ( float posture ); // Stop the ai from thinking (goes into a wait state) scriptEvent void stopThinking ( ); // Get / Set the current leader (setting the leader to $null_entity will clear it) scriptEvent void setLeader ( entity leader ); scriptEvent entity getLeader ( ); // Get / Set the current enemy scriptEvent void setEnemy ( entity enemy ); scriptEvent entity getEnemy ( ); // Instruct the ai to look at the given target scriptEvent void lookAt ( entity target ); // Set a script hook on the AI entity. Pass a value of "" as the functionName to clear the // function that is currently set for a script. The following is a list of the available scripts: // init - called when the AI is first initialized // first_sight - called the first time and enemy is ever sighted // sight - called each time an enemy is sighted // pain - called each time pain is taken // damage - called each time damage is taken // death - called when AI is dead // attack - called each time the AI attacks // onclick - called when the player clicks on a friendly AI // launch_projectile - called when a projectile is launched // footstep - called for each footstep generated by the AI scriptEvent void setScript ( string scriptName, string functionName ); // Speak using the given voice definition scriptEvent void speak ( string speechDecl ); // Speak using the given voice definition, with random suffix scriptEvent void speakRandom ( string speechDecl ); // Return true if the AI entity is currently speaking scriptEvent float isSpeaking ( ); // Return true if the AI is currently tethered scriptEvent float isTethered ( ); // Return true if the AI is currently within their tether scriptEvent float isWithinTether ( ); // Enables/Disables clipping against the actor scriptEvent void enableClip ( ); scriptEvent void disableClip(); // Enables/Disables gravity scriptEvent void enableGravity ( ); scriptEvent void disableGravity(); // Enables/Disables pushing articulated figures scriptEvent void enableAFPush ( ); scriptEvent void disableAFPush ( ); // Enables/Disables taking damage scriptEvent void enableDamage ( ); scriptEvent void disableDamage ( ); // rvAIMedic ONLY: Enables/Disables healing scriptEvent void enableHeal ( ); scriptEvent void disableHeal ( ); scriptEvent void takePatient ( entity patient ); // Moves to the given entity without interruptions scriptEvent void scriptedMove ( entity destEnt, float minDist, float endWithIdle ); // Faces the given entity without interruptions scriptEvent void scriptedFace ( entity faceEnt, float endWithIdle ); // Plays a full body animation without interruptions scriptEvent void scriptedAnim ( string animname, float blendFrames, float loop, float endWithIdle ); // Starts a scripted playback move scriptEvent void scriptedPlaybackMove ( string playback, float flags, float numFrames ); // Starts a scripted playback aim scriptEvent void scriptedPlaybackAim ( string playback, float flags, float numFrames ); // Starts a scripted action scriptEvent void scriptedAction ( entity actionEnt, float endWithIdle ); // Jump down facing the given yaw scriptEvent void scriptedJumpDown ( float yaw ); // Cancels the current scripted move in progress scriptEvent void scriptedStop ( ); // Returns true if finished with a scripted sequence scriptEvent float scriptedDone ( ); /*********************************************************************** effect entities ***********************************************************************/ scriptEvent void lookAtTarget(); scriptEvent void attenuate( float attenuation ); // twhitaker: scriptEvent float isActive(); /*********************************************************************** vechicle entities ***********************************************************************/ // Locks or unlocks the vehicle scriptEvent void lock( float locked ); // Returns true if the vehicle is locked. scriptEvent float isLocked(); // Enables the vehicles weapons. scriptEvent void enableWeapon(); // Disables the vehicles weapons. scriptEvent void disableWeapon(); // Enables the vehicles movement scriptEvent void enableMovement(); // Disables the vehicles movement scriptEvent void disableMovement(); /*********************************************************************** func_vehicle_driver entities ***********************************************************************/ // Sets the follow offset from the leading vehicle. scriptEvent void followOffset( vector offset ); // Sets the follow offset from the leading vehicle. scriptEvent void fireWeapon( float weapon_index, float time ); scriptEvent void setEnemy( entity newEnemy ); /*********************************************************************** func_spawner ***********************************************************************/ scriptEvent void removeNullActiveEntities(); scriptEvent float numActiveEntities(); scriptEvent entity getActiveEntity( float index ); /*********************************************************************** script events for the Makron ***********************************************************************/ //tell the Makron he can send out more teleport tubes scriptEvent void allowMoreSpawns(); //use this to set the bosses' next action scriptEvent float setNextAction( string strAction ); //Turns on and off the pattern mode flag. scriptEvent void enablePatternMode(); scriptEvent void disablePatternMode(); //causes the Makron to seperate into his flying form. scriptEvent void separate(); //lets the Makron know he's standing in a corner (true / false) scriptEvent void toggleCornerState( float toggle ); /*********************************************************************** script events for the Network Guardian ***********************************************************************/ //force the network guardian into walking mode scriptEvent void forceWalkMode(); //force the network guardian to land-- he does not instantly walk. scriptEvent void forceLanding( ); //force the network guardian into flying mode scriptEvent void forceTakeoff( ); //allow the AI to control landing and flying-- this will likely NOT work for you. Just sayin. scriptEvent void allowAutopilot( float f ); // The NG uses staged combat, use this to set the stage number. scriptEvent void setBattleStage( float f ); /*********************************************************************** target_bossBattle events ***********************************************************************/ //changes the max health on the bar. Useful when switching enemies, or if the boss max health changes scriptEvent void setMaxBossHealth( float f ); //sets the value of the shield bar, from 0.0 to 1.0 scriptEvent void setShieldPercent( float f ); //allows or disallows the shield bar to be drawn on the gui. scriptEvent void allowShieldBar( float f ); //allows or disallows the shield warning bar to be drawn on the gui. scriptEvent void allowShieldWarnBar( float f ); // RAVEN END // RITUAL BEGIN scriptEvent void setSpeederBikeSpeed( float speed, float transitionTime ); scriptEvent void setSpeederBikeMaxGravityDistance( float speed, float transitionTime ); scriptEvent void setSpeederBikeBoostEnabled( float isBoostEnabled ); // Valkaryne events scriptEvent void docked(); scriptEvent void undock(); // Pain Lord events scriptEvent void requestProcessing(); scriptEvent void atProcessingStation(); // Dead Zone multiplayer mode query scriptEvent float controlPointController(); scriptEvent float controlPercentToWin(); // RITUAL END