Nuclide
Software Development Kit for id Technology (BETA)
propdata.h
1/*
2 * Copyright (c) 2016-2022 Vera Visions LLC.
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
14 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*/
16
17#warning Rename to PropKit
18
161var string g_curPropData;
162
164{
165 PDFL_BLOCKLOS, /* Does this block an AIs light of sight? */
166 PDFL_AIWALKABLE, /* can AI walk on this? */
167 PDFL_ALLOWSTATIC /* static simulation possible? */
168} propdataFlag_t;
169
170typedef struct
171{
173 int child;
174 float xmin;
175 float xmax;
177 float ymin;
178 float ymax;
180 float zmin;
181 float zmax;
184
185typedef struct
186{
187 int index;
188 string name;
189 string parent;
190 float mass;
192 float damping;
194 float inertia;
195 float volume;
197
199typedef struct
200{
201 string name;
202 string base;
203 float health; /* health until break */
204 propdataFlag_t flags;
205 float damage_bullets; /* dmg multipliers */
208 float explosive_damage; /* once the damage/radius keys are set, make explosion upon break */
210 string breakable_particle; /* name of BreakableModels entry in PropData.txt */
211 string breakable_model; /* name of BreakableModels entry in PropData.txt */
214 float mass;
217 float inertia;
218 float volume;
222 string doll;
223} propdata_t;
224
225/* entity will have to have a .propdata field pointing to a propdata id */
228var hashtable g_hashpropdata;
229
230/* necessary API functions */
231void PropData_Init(void);
232void PropData_Shutdown(void);
233
234int PropData_Load(string); /* called when we read entity data, returns -1 when not found */
235int PropData_ForModel(string); /* called when we set a model, returns -1 when not found */
236//int PropData_Read(string); /* this just handles the contents of a prop_data model string */
237
238void PropData_SetStage(string);
239int PropData_Finish(void);
240
241/* querying API */
242typedef enum
243{
254 /* physics related variables. */
263__variant Prop_GetInfo(int, int);
264
266typedef struct
267{
268 string name;
269 string data;
270 float modelindex; /* only used for networking */
271 bool physics; /* differentiate between Source and GS */
273
274/* entity will have a .breakmodel field pointing to a breakmodel id */
278var hashtable g_hashbreakmodel;
279
280
281#ifdef CLIENT
282void BreakModel_SpawnID(vector smins, vector smaxs, vector dir, float speed, int count, int index);
283void BreakModel_Receive(void);
285#else
286void BreakModel_Spawn(vector pos, vector dir, vector spread, float speed, int count, string type);
287void BreakModel_Entity(ncSurfacePropEntity target, vector dir, float speed);
288void BreakModel_SendClientData(entity);
289#endif
290
291 // end of propdata
293
294/* necessary API functions */
295//void BreakModel_Init(void);
296//void BreakModel_Shutdown(void);
297
298//int BreakModel_Load(string); /* called when we precache a model, returns -1 when not found */
299//int BreakModel_Read(string); /* this just handles the contents of a prop_data model string */
This entity represents an ncRenderableEntity with interactive surface properties.
Definition: NSSurfacePropEntity.h:52
void PropData_SetStage(string)
Definition: propdata.qc:911
void BreakModel_SpawnID(vector smins, vector smaxs, vector dir, float speed, int count, int index)
Definition: propdata.qc:933
var hashtable g_hashbreakmodel
Definition: propdata.h:278
breakModel_t * g_breakmodel
Definition: propdata.h:275
propinfo_t
Definition: propdata.h:243
void BreakModel_Receive(void)
Definition: propdata.qc:1070
int PropData_Finish(void)
Definition: propdata.qc:917
int PropData_Load(string)
Definition: propdata.qc:607
var string g_curPropData
Definition: propdata.h:161
var hashtable g_hashpropdata
Definition: propdata.h:228
void PropData_Init(void)
Definition: propdata.qc:784
void PropData_Shutdown(void)
Definition: propdata.qc:84
int g_propdata_count
Definition: propdata.h:227
propdata_t * g_propdata
Definition: propdata.h:226
__variant Prop_GetInfo(int, int)
Definition: propdata.qc:100
int PropData_ForModel(string)
Definition: propdata.qc:398
int g_breakmodel_count
Definition: propdata.h:276
void BreakModel_ReceiveClientData(void)
Definition: propdata.qc:1105
int g_breakmodel_end
Definition: propdata.h:277
typedef enumflags
Definition: propdata.h:164
@ PROPINFO_DMG_BULLET
Definition: propdata.h:246
@ PROPINFO_DAMPING_LINEAR
Definition: propdata.h:256
@ PROPINFO_EXPLOSIVE_RADIUS
Definition: propdata.h:250
@ PROPINFO_DOLL
Definition: propdata.h:261
@ PROPINFO_VOLUME
Definition: propdata.h:259
@ PROPINFO_INERTIA
Definition: propdata.h:258
@ PROPINFO_BREAKMODEL
Definition: propdata.h:251
@ PROPINFO_DAMPING_ANGULAR
Definition: propdata.h:257
@ PROPINFO_EXPLOSIVE_DMG
Definition: propdata.h:249
@ PROPINFO_DMG_MELEE
Definition: propdata.h:247
@ PROPINFO_FLAGS
Definition: propdata.h:245
@ PROPINFO_SKIN
Definition: propdata.h:253
@ PROPINFO_SURFACEPROP
Definition: propdata.h:260
@ PROPINFO_HEALTH
Definition: propdata.h:244
@ PROPINFO_DMG_EXPLOSIVE
Definition: propdata.h:248
@ PROPINFO_BREAKCOUNT
Definition: propdata.h:252
@ PROPINFO_MASS
Definition: propdata.h:255
Data holding BreakModel entries.
Definition: propdata.h:267
string name
Definition: propdata.h:268
float modelindex
Definition: propdata.h:270
string data
Definition: propdata.h:269
bool physics
Definition: propdata.h:271
Definition: propdata.h:171
float zmax
Definition: propdata.h:181
int parent
Definition: propdata.h:172
float zmin
Definition: propdata.h:180
float xfriction
Definition: propdata.h:176
float ymax
Definition: propdata.h:178
float xmin
Definition: propdata.h:174
float zfriction
Definition: propdata.h:182
float xmax
Definition: propdata.h:175
float yfriction
Definition: propdata.h:179
float ymin
Definition: propdata.h:177
int child
Definition: propdata.h:173
Definition: propdata.h:186
string parent
Definition: propdata.h:189
string surfaceprop
Definition: propdata.h:191
string name
Definition: propdata.h:188
float volume
Definition: propdata.h:195
float inertia
Definition: propdata.h:194
int index
Definition: propdata.h:187
float damping
Definition: propdata.h:192
float rotdamping
Definition: propdata.h:193
float mass
Definition: propdata.h:190
Data holding PropData entries.
Definition: propdata.h:200
float damping_linear
Definition: propdata.h:215
int solids
Definition: propdata.h:220
float volume
Definition: propdata.h:218
string surfaceprop
Definition: propdata.h:219
float mass
Definition: propdata.h:214
float damage_explosive
Definition: propdata.h:207
propdataFlag_t flags
Definition: propdata.h:204
string breakable_model
Definition: propdata.h:211
float health
Definition: propdata.h:203
float damage_bullets
Definition: propdata.h:205
float breakable_skin
Definition: propdata.h:213
string breakable_particle
Definition: propdata.h:210
float explosive_radius
Definition: propdata.h:209
float damage_melee
Definition: propdata.h:206
propdata_solids_t * solidInfo
Definition: propdata.h:221
float damping_angular
Definition: propdata.h:216
string doll
Definition: propdata.h:222
float explosive_damage
Definition: propdata.h:208
string base
Definition: propdata.h:202
int breakable_count
Definition: propdata.h:212
float inertia
Definition: propdata.h:217
string name
Definition: propdata.h:201