These variables can be read or modified from the console, during game play. The player can change them, to affect the program behavior.
"teamplay" // boolean, true if playing in teams. "samelevel" // boolean, if true, then cannot change level. "noexit" // boolean, true if can't exit level in deathmatch. "timelimit" // number of minutes the deathmatch will last. "fraglimit" // maximum number of frags before deathmatch ends. "skill" // text of skill message (?) "sv_gravity" // gravity pull, normal value is 800. "registered" // boolean, game is registered (do not change). "temp1" // to store custom floating point values
Beware that the variables you can read in Quake-C are those that are defined on the server, not those defined on the client. So if a player sets a value on his console, there is no chance that you can ever get this value (unless his console is also the server console).
Well, at least you can read values set by the server administrator, for what it's worth.
These variables are accessible in every functions.
Quake C function are not supposed to modify them directly.
the server's world object, which holds all global state for the server, like the deathmatch flags and the body ques.
float time; // in secondsThe current game time, a floating point value in seconds. Note that because the entities in the world are simulated sequentially, time is NOT strictly increasing. An impact late in one entity's time slice may set time higher than the think function of the next entity. The difference is limited to 0.1 seconds.
float frametime; // in secondsNo idea what this can be. Used only when jumping in water.
entity self;The entity that is subject to the current function.
entity other;The object concerned by an impact, not used for thinks.
float force_retouch; // counterForce all entities to touch triggers next frame. this is needed because non-moving things don't normally scan for triggers, and when a trigger is created (like a teleport trigger), it needs to catch everything.
string mapname;Name of the level map currently being played, like "start".
float deathmatch; // a boolean value, 0 or 1True if playing deathmatch.
float coop; // a boolean value, 0 or 1True if playing cooperative.
float teamplay; // a boolean value, 0 or 1True if playing by teams.
float serverflags; // bit fieldsPropagated from level to level, and used to keep track of the completed episodes.
float total_secrets; // counterNumber of secrets found by the players. Affected only by trigger_secret.
float found_secrets; // counterNumber of secrets found.
float total_monsters; // counterTotal number of monsters that were spawned, since the begining of the level.
float killed_monsters; // counterStore the total number of monsters killed.
float parm1; // items bit flag (IT_SHOTGUN | IT_AXE ) float parm2; // health float parm3; // armorvalue float parm4, parm5, parm6, parm7; // ammo float parm8; // weapon float parm9; // armortype*100 float parm10, parm11, parm12, parm13, parm14, parm15, parm16;
Those parameters seem to be a bit of hack. They are used when
a client connects.
Spawnparms are used to encode information about clients across server level changes
These functions must be defined in Quake C, since they are invoked by Quake under certain conditions.
void main();Only used for testing progs.
void StartFrame();Called at the start of each frame.
void PlayerPreThink();Called with self=player, for every frame, before physics are run.
void PlayerPostThink();Called with self=player, for every frame, after physics are run.
void ClientKill();Called when a player suicides.
void ClientConnect();Called when a player connects to a server, but also, for every player, when a new level starts.
void PutClientInServer();Call after setting the parm1... parm16.
void ClientDisconnect();Called when a player disconnects from a server
void SetNewParms();Called when a client first connects to a server. Sets parm1...parm16 so that they can be saved off for restarts.
void SetChangeParms();Call to set parms for self so they can?