originally from cataboligne
|
|
|
Returns angle in degree, modulo 360. |
|
Returns val, rounded up to the closest integer value. |
|
Returns val, rounded up to the integer below (like the equivalent function in C). |
|
Returns val, rounded up to the integer above (like the equivalent function in C). |
|
Returns absolute value of val (like the equivalent function in C). |
|
Returns a random floating point number between 0.0 and 1.0. |
|
Float to string: converts value to string. |
|
|
|
Returns a vector of length 1. Gives the vector colinear to v, but of length 1. This can be useful for calculation of distance along an axis. |
|
Returns the length of vector v (never < 0). |
|
Returns and angle in degree. Vector to yaw : calculates the yaw angle (bearing) corresponding to a given 3D direction v. |
|
returns vector 'pitch yaw 0 ' Vector to angles : calculates the pitch angle (aiming) and yaw angle (bearing) corresponding to a given 3D direction v. |
|
Vector to String : print a vector, as a string. |
|
Calculate the vectors pointing forward, right and up, according to the provided angles.
Returns result in the global variables :
|
|
|
|
source = entity emiting the sound (ex: self) channel = channel to use for sound sample = name of the sample WAV file (ex: "ogre/ogdrag.wav") volume = 0.0 for low volume, 1.0 for maximum volume attenuation= attenuation of sound The entity emits a sound, on one of it's 8 channels. |
|
position = position, in 3D space, inside the level
sample = name of the sample WAV file (ex: "ogre/ogdrag.wav") volume = 0.0 for low volume, 1.0 for maximum volume attenuation = attenuation of sound An ambient sound is emited, from the given position. |
|
|
|
Returns an empty entity. Create a new entity, totally empty. You can manually set every field, or just set the origin and call one of the existing entity setup functions. |
|
Removes entity e from the world (R.I.P.). |
|
Make an entity static to the world, by sending a broadcast message to the network. The entity is then removed from the list of dynamic entities in the world, and it cannot be deleted (until the level ends). |
|
Returns entity that is just after e in the entity list. Useful to browse the list of entities, because it skips the undefined ones. |
|
start = begining of list to search (world, for the begining of list) field = entity field that must be examined (ex: targetname) match = value that must be matched (ex: other.target) Returns the entity found, or world if no entity was found. Searches the server entity list beginning at start, looking for an entity that has entity.field = match. Example : find the first player entity |
|
origin = origin of sphere radius = radius of sphere Returns a chain of entities that have their origins within a spherical area. The entity returned is e, and the next in the chain is e.chain, until e==FALSE. Typical usage: find and harm the victims of an explosion. Example : |
|
e = entity whose model is to be set model = name of the model (ex: "progs/soldier.mdl") Changes the model associated to an entity. This model should also be declared by precache_model. Please set e.movetype and e.solid first. |
|
style = index of the light style, from 0 to 63. value = (ex: "abcdefghijklmlkjihgfedcb") Modifies a given light style. The light style is used to create cyclic lighting effects, like torches or teleporter lighting. There are 64 light tyles, from 0 to 63. If style is not strictly comprised in these values, the game may crash. Styles 32-62 are assigned by the light program for switchable lights. Value is a set of characters, whose ascii value indicates a light level, from "a" (0) to "z" (30). |
|
|
|
Change the horizontal orientation of self. Turns towards self.ideal_yaw
at self.yaw_speed, and sets the global variable current_yaw. Called every 0.1 sec by monsters. |
|
Returns TRUE or FALSE. Moves self in the given direction. Returns FALSE if could not move (used to detect blocked monsters). |
|
Returns TRUE or FALSE. Drops self to the floor, if the floor is less than -256 coordinates below. Returns TRUE if landed on floor. Mainly used to spawn items or walking monsters on the floor. |
|
e = entity to be moved position = new position for the entity Move an entity to a given location. That function is to be used when spawning an entity or when teleporting it. This is the only valid way to move an object without using the physics of the world (setting velocity and waiting). DO NOT change directly e.origin, otherwise internal links would be screwed, and entity clipping would be messed up. |
|
e = entity whose bounding box is to be set min = minimum, for bounding box (ex: VEC_HULL2_MIN) max = maximum, for bounding box (ex: VEC_HULL2_MAX) Set the size of the entity bounding box, relative to the entity origin. The size box is rotated by the current angle. |
|
Move self toward it's goal. Used for monsters. |
|
|
|
Returns a vector along which the entity e can shoot. Usually, e is a player, and the vector returned is calculated by auto-aiming to the closest enemy entity. |
|
origin = initial position dir = initial direction color = color index (73,75...) count = time to live, in seconds .Create a particle effect (small dot that flies away). color = 0 for chunk color = 75 for yellow color = 73 for blood red color = 225 for entity damage |
|
Returns client (or object that has a client enemy) that would be a valid
target. If there are more than one valid options, they are cycled each frame. If (self.origin + self.viewofs) is not in the PVS of the target, 0 (false) is returned. |
|
|
|
v1= start of line v2= end of line nomonster= if TRUE, then see through other monsters, else FALSE. forent= ignore this entity, it's owner, and it's owned entities. if forent = world, then ignore no entity. Trace a line of sight, possibly ignoring monsters, and possibly ignoring the entity forent (usually, forent = self). This function is used very often, tracing and shot targeting. Traces are blocked by bounding boxes and exact bsp entities. Returns the results in the global variables : |
|
Returns true if the given entity can move to the given position from it's current position by walking or rolling. |
|
e = entity that is to be checked Return TRUE or FALSE. Returns TRUE if on the ground. Used only for jumping monster, that need to jump randomly not to get hung up (or whatever it actually means). |
|
Returns the contents of the area situated at position pos. Used to know if an area is in water, in slime or in lava. Makes use of the BSP tree, and is supposed to be very fast. |
|
|
|
Warp to the game map named mapname. Actually executes the console command "changelevel" + mapname, so if you want to alias it... |
|
Restore the original spawn parameters of a client entity. Doesn't work if client is not a player. |
|
client = player that is to receive the command text = text of the command, ended by \n (newline). Send a command to a given player, as if it had been typed on the player's console. Don't forget the \n (newline) at the end, otherwise your command will not be executed, and will stand still on the console window. Examples : |
|
|
|
text = text of the message Broadcast a message to all players on the current server. |
|
client = player that is to receive the message text = text of the message Sends a message to a specific player, and print it centered. |
|
client = player that is to receive the message text = text of the message Sends a message to a player. |
|
|
|
text = text of the command, ended by \n (newline). Execute a command on the server, as if it had been typed on the server's console. Examples : |
|
text = text of the message Prints a message to the server console. |
|
variable = see console variables Returns the value of a console variable. |
|
variable = see console variables Sets the value of a console variable. |
|
|
|
e = entity to print Print details about a given entity (for debug purposes). |
|
Print all entities |
|
Start tracing functions, end them with traceoff() |
|
End traces started by traceon() |
|
Exit the programs. Never used? |
|
Print an error message. |
|
Print an error message related to object self. |
|
|
|
file = name of the file to include in PAK file. Does nothing during game play. Use precache_file2 for registered Quake. |
|
file = name of the MDL or BSP file to include in PAK file. Does nothing during game play. Must be used in a model's spawn function, to declare the model file. Use precache_model2 for registered Quake. |
|
file = name of the WAV file to include in PAK file. Does nothing during game play. Must be used in a model's spawn function, to declare the sound files. Use precache_sound2 for registered Quake. |