Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
checkpoint.qc
Go to the documentation of this file.
1#include "checkpoint.qh"
2
3#ifdef SVQC
4
5/*QUAKED turret_checkpoint (1 0 1) (-32 -32 -32) (32 32 32)
6-----------KEYS------------
7target: .targetname of next waypoint in chain.
8wait: Pause at this point # seconds.
9-----------SPAWNFLAGS-----------
10---------NOTES----------
11If a loop is of targets are formed, any unit entering this loop will patrol it indefinitly.
12If the checkpoint chain is not looped, the unit will go "Roaming" when the last point is reached.
13*/
15{
16 traceline(this.origin + '0 0 16', this.origin - '0 0 1024', MOVE_WORLDONLY, this);
17 setorigin(this, trace_endpos + '0 0 32');
18
19 if(this.target && this.target != "")
20 {
21 this.enemy = find(NULL, targetname, this.target);
22 if(!this.enemy)
23 LOG_TRACE("A turret_checkpoint failed to find its target!");
24 }
25}
26
27spawnfunc(turret_checkpoint)
28{
29 setorigin(this, this.origin);
31}
32
33// Compat.
34spawnfunc(walker_checkpoint)
35{
36 spawnfunc_turret_checkpoint(this);
37}
38
39#endif
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void turret_checkpoint_init(entity this)
Definition checkpoint.qc:14
const int INITPRIO_FINDTARGET
Definition constants.qh:96
vector trace_endpos
float MOVE_WORLDONLY
vector origin
#define LOG_TRACE(...)
Definition log.qh:76
entity find(entity start,.string field, string match)
#define NULL
Definition post.qh:14
#define spawnfunc(id)
Definition spawnfunc.qh:96
entity enemy
Definition sv_ctf.qh:153
string targetname
Definition triggers.qh:56
string target
Definition triggers.qh:55
void InitializeEntity(entity e, void(entity this) func, int order)
Definition world.qc:2209