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------------
7
target: .targetname of next waypoint in chain.
8
wait: Pause at this point # seconds.
9
-----------SPAWNFLAGS-----------
10
---------NOTES----------
11
If a loop is of targets are formed, any unit entering this loop will patrol it indefinitly.
12
If the checkpoint chain is not looped, the unit will go "Roaming" when the last point is reached.
13
*/
14
void
turret_checkpoint_init
(
entity
this
)
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
27
spawnfunc
(turret_checkpoint)
28
{
29
setorigin(
this
, this.
origin
);
30
InitializeEntity
(
this
,
turret_checkpoint_init
,
INITPRIO_FINDTARGET
);
31
}
32
33
// Compat.
34
spawnfunc
(walker_checkpoint)
35
{
36
spawnfunc_turret_checkpoint(
this
);
37
}
38
39
#endif
entity
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
turret_checkpoint_init
void turret_checkpoint_init(entity this)
Definition
checkpoint.qc:14
checkpoint.qh
INITPRIO_FINDTARGET
const int INITPRIO_FINDTARGET
Definition
constants.qh:96
trace_endpos
vector trace_endpos
Definition
csprogsdefs.qc:37
MOVE_WORLDONLY
float MOVE_WORLDONLY
Definition
csprogsdefs.qc:1094
origin
vector origin
Definition
csprogsdefs.qc:105
LOG_TRACE
#define LOG_TRACE(...)
Definition
log.qh:76
find
entity find(entity start,.string field, string match)
NULL
#define NULL
Definition
post.qh:14
spawnfunc
#define spawnfunc(id)
Definition
spawnfunc.qh:96
enemy
entity enemy
Definition
sv_ctf.qh:153
targetname
string targetname
Definition
triggers.qh:56
target
string target
Definition
triggers.qh:55
InitializeEntity
void InitializeEntity(entity e, void(entity this) func, int order)
Definition
world.qc:2209
common
turrets
checkpoint.qc
Generated on
for Xonotic QuakeC by
1.14.0