Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
debug.qc
Go to the documentation of this file.
1#include "debug.qh"
2
3#if DEBUGPATHING
4
5MODEL(SQUARE, "models/pathlib/square.md3");
6MODEL(SQUARE_GOOD, "models/pathlib/goodsquare.md3");
7MODEL(SQUARE_BAD, "models/pathlib/badsquare.md3");
8MODEL(EDGE, "models/pathlib/edge.md3");
9
10#ifdef TURRET_DEBUG
12#endif
13
14void pathlib_showpath(entity start)
15{
16 entity e;
17 e = start;
18 while(e.path_next)
19 {
20 te_lightning1(e,e.origin,e.path_next.origin);
21 e = e.path_next;
22 }
23}
24
25void path_dbg_think(entity this)
26{
27 pathlib_showpath(this);
28 this.nextthink = time + 1;
29}
30
31void __showpath2_think(entity this)
32{
33 #ifdef TURRET_DEBUG
34 mark_info(this.origin,1);
35 #endif
36 if(this.path_next)
37 {
38 setthink(this.path_next, __showpath2_think);
39 this.path_next.nextthink = time + 0.15;
40 }
41 else
42 {
43 setthink(this.owner, __showpath2_think);
44 this.owner.nextthink = time + 0.15;
45 }
46}
47
48void pathlib_showpath2(entity path)
49{
50 setthink(path, __showpath2_think);
51 path.nextthink = time;
52}
53
54void pathlib_showsquare2(entity node ,vector ncolor,float align)
55{
56
57 node.alpha = 0.25;
58 node.scale = pathlib_gridsize / 512.001;
59 node.solid = SOLID_NOT;
60
61 setmodel(node, MDL_SQUARE);
62 setorigin(node, node.origin);
63 node.colormod = ncolor;
64
65 if(align)
66 {
67 traceline(node.origin + '0 0 32', node.origin - '0 0 128', MOVE_WORLDONLY, node);
68 node.angles = vectoangles(trace_plane_normal);
69 node.angles_x -= 90;
70 }
71}
72
73void pathlib_showsquare(vector where,float goodsquare,float _lifetime)
74{
75 entity s;
76
77 if(!_lifetime)
78 _lifetime = time + 30;
79 else
80 _lifetime += time;
81
82 s = spawn();
83 s.alpha = 0.25;
85 s.nextthink = _lifetime;
86 s.scale = pathlib_gridsize / 512.001;
87 s.solid = SOLID_NOT;
88
89 setmodel(s, goodsquare ? MDL_SQUARE_GOOD : MDL_SQUARE_BAD);
90
91 traceline(where + '0 0 32',where - '0 0 128',MOVE_WORLDONLY,s);
92
94 s.angles_x -= 90;
95 setorigin(s, where);
96}
97
98void pathlib_showedge(vector where,float _lifetime,float rot)
99{
100 entity e;
101
102 if(!_lifetime)
103 _lifetime = time + 30;
104 else
105 _lifetime += time;
106
107 e = spawn();
108 e.alpha = 0.25;
110 e.nextthink = _lifetime;
111 e.scale = pathlib_gridsize / 512;
112 e.solid = SOLID_NOT;
113 setorigin(e, where);
114 setmodel(e, MDL_EDGE);
115 //traceline(where + '0 0 32',where - '0 0 128',MOVE_WORLDONLY,e);
116 //e.angles = vectoangles(trace_plane_normal);
117 e.angles_y = rot;
118 //e.angles_x += 90;
119
120}
121
122#endif
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
entity owner
Definition main.qh:87
#define setmodel(this, m)
Definition model.qh:26
const float SOLID_NOT
float time
float nextthink
float MOVE_WORLDONLY
vector origin
vector trace_plane_normal
#define spawn
void SUB_Remove(entity this)
Remove entity.
Definition defer.qh:13
vector vectoangles(vector v)
#define MODEL(name, path)
Definition all.qh:8
entity path_next
Definition pathlib.qh:8
float pathlib_gridsize
Definition pathlib.qh:50
#define setthink(e, f)
vector
Definition self.qh:92