]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/dpdefs/doc.md
Merge branch 'master' into Mario/showspecs
[xonotic/xonotic-data.pk3dir.git] / qcsrc / dpdefs / doc.md
1 # CSQC
2
3 ```
4
5 // input:
6 //   self
7 .void() predraw;
8
9 // input:
10 //   time
11 //   self
12 .void() think;
13
14 // 0 = keydown, key, character (EXT_CSQC)
15 // 1 = keyup, key, character (EXT_CSQC)
16 // 2 = mousemove relative, x, y (EXT_CSQC)
17 // 3 = mousemove absolute, x, y (DP_CSQC)
18 bool CSQC_InputEvent(int eventtype, int x, int y);
19
20 void CSQC_UpdateView(int width, int height);
21 bool CSQC_ConsoleCommand(string cmd);
22 bool CSQC_Parse_TempEntity();
23 bool CSQC_Parse_StuffCmd(string msg);
24 bool CSQC_Parse_Print(string msg);
25 bool CSQC_Parse_CenterPrint(string msg);
26 bool CSQC_Event_Sound(int ent, int channel, string sample, float volume, float attenuation, vector pos, float speed, int flags);
27
28 entity CSQC_Ent_Spawn(int entnum);
29 void CSQC_Ent_Update(bool isnew);
30 void CSQC_Ent_Remove();
31
32 void CSQC_Init();
33 void CSQC_Shutdown();
34
35 // input:
36 //   time
37 //   self
38 //   v_forward: forward
39 //   v_right: right
40 //   v_up: up
41 // output:
42 //   origin
43 //   v_forward: forward
44 //   v_right: right
45 //   v_up: up
46 //   trace_endpos: visorigin
47 .vector camera_transform(vector pos, vector ang);
48
49 // control start position of sound()
50 // calculated as ofs = time - sound_starttime
51 float sound_starttime;
52
53 ```
54
55 # SVQC
56
57 ```
58
59 .entity clientcamera;
60
61 // input:
62 //   time
63 //   self
64 void ClientDisconnect();
65
66 // input:
67 //   time
68 void SV_Shutdown();
69
70 // input:
71 //   time
72 void SV_PausedTic(float elapsed);
73
74 // input:
75 //   time
76 //   self
77 void SV_ChangeTeam(int color);
78
79 // input:
80 //   time
81 //   self
82 void ClientKill();
83
84 // input:
85 //   time
86 //   self
87 void RestoreGame();
88
89 // Called when a client connects to the server
90 // input:
91 //   time
92 //   self
93 //   parm1..n
94 void ClientConnect();
95
96 // Called when a client spawns in the server
97 // input:
98 //   time
99 //   self
100 //   parm1..n
101 void PutClientInServer();
102
103 // return false to remove
104 .bool SendEntity(entity to, int sf);
105
106 // input:
107 //   time
108 //   self
109 void SV_OnEntityPreSpawnFunction();
110
111 // input:
112 //   time
113 //   self
114 void SV_OnEntityNoSpawnFunction();
115
116 // input:
117 //   time
118 //   self
119 void SV_OnEntityPostSpawnFunction();
120
121 // input:
122 //   time
123 // output:
124 //   parm1..n
125 void SetNewParms();
126
127 // Runs every frame
128 // input:
129 //
130 .bool customizeentityforclient();
131
132 // input:
133 //   time
134 //   self
135 // output:
136 //   parm1..n
137 void SetChangeParms();
138
139 // input:
140 //   time
141 //   self
142 //   other
143 //   trace_allsolid
144 //   trace_startsolid
145 //   trace_fraction
146 //   trace_inwater
147 //   trace_inopen
148 //   trace_endpos: self.origin
149 //   trace_plane_normal
150 //   trace_plane_dist
151 //   trace_ent: other
152 //   trace_dpstartcontents
153 //   trace_dphitcontents
154 //   trace_dphitq3surfaceflags
155 //   trace_dphittexturename
156 .void touch();
157
158 // when .watertype changes:
159 .void contentstransition(int prev, int current);
160
161 // input:
162 //   time
163 //   self
164 //   other
165 .void blocked();
166
167 // input:
168 //   time
169 //   self
170 .void movetypesteplandevent(vector vel);
171
172 // input:
173 //   time
174 //   self
175 void PlayerPreThink();
176
177 // input:
178 //   time
179 //   self
180 void PlayerPostThink();
181
182 // input:
183 //   time
184 //   frametime
185 void StartFrame();
186
187 // input:
188 //   time
189 void EndFrame();
190
191 // input:
192 //   time
193 //   self
194 void SV_PlayerPhysics();
195
196 // input:
197 //   time
198 //   self
199 void SV_ParseClientCommand(string cmd);
200
201 ```
202
203 # MENUQC
204
205 ```
206
207 void m_keydown(int key, int ascii);
208
209 void m_keyup(int key, int ascii);
210
211 void m_draw(int width, int height);
212
213 void m_toggle(int mode);
214
215 int m_gethostcachecategory(int entry);
216
217 void m_shutdown();
218
219 void m_init();
220
221 ```
222
223 # All
224
225 ```
226
227 void URI_Get_Callback(int id, int status, string data);
228
229 void GameCommand(string cmd);
230
231 ```