text
stringlengths
0
774
A compound_statement can enclose simple_statements and other compound_statements.
Assignment Statements:
assignment_statement β‡’ variable_name = expression;
An assignment_statement replaces the current value of a variable with the result of evaluating an expression.
If Statements:
if_statement β‡’ if (condition) simple_statement [else simple_statement]
if_statement β‡’ if (condition) { compound_statement [else
compound_statement] }
condition β‡’ boolean_expression
An if_statement selects for execution at most one of the enclosed simple_statement or
compound_statements, depending on the (truth) value of one or more corresponding conditions.
Note that a conditional statement returning a nonzero value always evaluates as TRUE, while a value of
zero evaluates as FALSE.
Loop Statements:
while (condition) sequence_of_statements
do sequence_of_statments while (condition)
A loop_statement includes a sequence_of_statements that is to be executed repeatedly zero or more
times."</s>
<s>[INST] What are Subprograms in QuakeC?[/INST]
" A subprogram_declaration declares a procedure or function.
Subprogram Declaration:
function_declaration β‡’ type (formal_parameter[, formal_parameter …]) name
A subprogram must be declared before it is used.
Procedures are declared by specifying a type of void.
Subprogram Specification:
procedure_specification β‡’ type (formal_parameter[, formal_parameter …])
name = { sequence_of_statements return(expression) }
function_specification β‡’ type (formal_parameter[, formal_parameter …])
name = { sequence_of_statements return(expression) }
There is a maximum of eight (8) formal parameters.
frame_function_specification β‡’ void() framename = [$framenum, nextthink] {
sequence_of_statements }
Frame functions (also called states) are special functions made for convenience. They are meant to
facilitate the definition of animation frames, by making them more readable.
It is strictly equivalent to:
void() framename = {
self.frame= $framenum; // the model frame to displayed
self.nextthink = time + 0.1; // next frame happens in 1/10 of second
self.think = nextthink; // the function to call at the next frame
sequence_of_statements }
Subprogram Calls:
subprogram_call β‡’ name (actual_parameter[, actual_parameter …])
There is a maximum of eight (8) parameters."</s>
<s>[INST] What are Predefined Constants in QuakeC?[/INST]
" Entities:
Temporary Entities:
// point entity is a small point-like entity.
0 TE_SPIKE // unknown
1 TE_SUPERSPIKE // superspike hits (spike traps)
2 TE_GUNSHOT // hit on the wall (Axe, Shotgun)
3 TE_EXPLOSION // grenade/missile explosion
4 TE_TAREXPLOSION // explosion of a tarbaby
7 TE_WIZSPIKE // wizard's hit
8 TE_KNIGHTSPIKE // hell knight's shot hit
10 TE_LAVASPLASH // Chthon awakes and falls dead
11 TE_TELEPORT // teleport end
// large entity is a 2 dimensional entity.
5 TE_LIGHTNING1 // flash of the Shambler
6 TE_LIGHTNING2 // flash of the Thunderbolt
9 TE_LIGHTNING3 // flash in e1m7 to kill Chthon
Items:
Values used for the entity field .items.
IT_SHOTGUN = 1;
IT_SUPER_SHOTGUN = 2;
IT_NAILGUN = 4;
IT_SUPER_NAILGUN = 8;
IT_GRENADE_LAUNCHER = 16;
IT_ROCKET_LAUNCHER = 32;
IT_LIGHTNING = 64;
IT_EXTRA_WEAPON = 128;
IT_SHELLS = 256;
IT_NAILS = 512;
IT_ROCKETS = 1024;
IT_CELLS = 2048;
IT_AXE = 4096;
IT_ARMOR1 = 8192;
IT_ARMOR2 = 16384;
IT_ARMOR3 = 32768;
IT_SUPERHEALTH = 65536;
IT_KEY1 = 131072;
IT_KEY2 = 262144;
IT_INVISIBILITY = 524288;
IT_INVULNERABILITY = 1048576;
IT_SUIT = 2097152;
IT_QUAD = 4194304;"</s>
<s>[INST] Is there more predefined constants in QuakeC?[/INST]
" Yes! For example: Behavior of Solid Objects
Values used with the entity field .solid.
SOLID_NOT = 0; // no interaction with other objects: or inactive triggers
SOLID_TRIGGER = 1; // touch on edge, but not blocking active or triggers: pickable items (.MDL models, like armors)
SOLID_BBOX = 2; // touch on edge, block: pickable items or (.BSP models, like ammo box, grenades, missiles
SOLID_SLIDEBOX = 3; touch on edge, but not an onground: most monsters
SOLID_BSP = 4; // BSP clip, touch on edge, block: buttons, platforms, doors, missiles
Movement Types