State expression used for think function state-machines. More...
Data Fields | |
| struct expr_s * | frame |
| the frame to which to change in this state More... | |
| struct expr_s * | step |
| time step until the next state More... | |
| struct expr_s * | think |
| think function for the next state More... | |
State expression used for think function state-machines.
State expressions are of the form [framenum, nextthink] (standard) or [framenum, nextthink, timestep] (QF extension) and come before the opening brace of the function. If the state expression is of the former form, then step will be null. Normally, framenum and nextthink must be constant (though nextthink may be a forward reference), but qfcc allows both framenum and nextthink, and also timestep, to be variable.
void() name = [framenum, nextthink] {code};
expands to:
void name ()
{
self.frame=framenum;
self.nextthink = time + 0.1;
self.think = nextthink
[code]
};
Although the above expansion shows three expressions, a state expression using constant values is just one instruction: either state framenum, nextthink (standard) or state.f framenum, nextthink, timestep (QF, optional).
| struct expr_s* frame |
the frame to which to change in this state
| struct expr_s* step |
time step until the next state
| struct expr_s* think |
think function for the next state