Nuclide
Software Development Kit for id Tech
propdata.h
Go to the documentation of this file.
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
168var string g_curPropData;
169
171{
172 PDFL_BLOCKLOS, /* Does this block an AIs light of sight? */
173 PDFL_AIWALKABLE, /* can AI walk on this? */
174 PDFL_ALLOWSTATIC /* static simulation possible? */
175} propdataFlag_t;
176
178typedef struct
179{
180 string name;
181 string base;
182 float health; /* health until break */
183 propdataFlag_t flags;
184 float damage_bullets; /* dmg multipliers */
187 float explosive_damage; /* once the damage/radius keys are set, make explosion upon break */
189 string breakable_particle; /* name of BreakableModels entry in PropData.txt */
190 string breakable_model; /* name of BreakableModels entry in PropData.txt */
193 float mass;
196 float inertia;
197 float volume;
199} propdata_t;
200
201/* entity will have to have a .propdata field pointing to a propdata id */
204var hashtable g_hashpropdata;
205
206/* necessary API functions */
207void PropData_Init(void);
208void PropData_Shutdown(void);
209
210int PropData_Load(string); /* called when we read entity data, returns -1 when not found */
211int PropData_ForModel(string); /* called when we set a model, returns -1 when not found */
212//int PropData_Read(string); /* this just handles the contents of a prop_data model string */
213
214void PropData_SetStage(string);
215int PropData_Finish(void);
216
217/* querying API */
218typedef enum
219{
230 /* physics related variables. */
238__variant Prop_GetInfo(int, int);
239
241typedef struct
242{
243 string name;
244 string data;
245 float modelindex; /* only used for networking */
246 bool physics; /* differentiate between Source and GS */
248
249/* entity will have a .breakmodel field pointing to a breakmodel id */
253var hashtable g_hashbreakmodel;
254
255
256#ifdef CLIENT
257void BreakModel_SpawnID(vector smins, vector smaxs, vector dir, float speed, int count, int index);
258void BreakModel_Receive(void);
260#else
261void BreakModel_Spawn(vector pos, vector dir, vector spread, float speed, int count, string type);
262void BreakModel_Entity(NSSurfacePropEntity target, vector dir, float speed);
263void BreakModel_SendClientData(entity);
264#endif
265
266 // end of propdata
268
269/* necessary API functions */
270//void BreakModel_Init(void);
271//void BreakModel_Shutdown(void);
272
273//int BreakModel_Load(string); /* called when we precache a model, returns -1 when not found */
274//int BreakModel_Read(string); /* this just handles the contents of a prop_data model string */
This entity represents an NSRenderableEntity with interactive surface properties.
Definition: NSSurfacePropEntity.h:52
void PropData_SetStage(string)
Definition: propdata.qc:625
void BreakModel_SpawnID(vector smins, vector smaxs, vector dir, float speed, int count, int index)
Definition: propdata.qc:647
var hashtable g_hashbreakmodel
Definition: propdata.h:253
breakModel_t * g_breakmodel
Definition: propdata.h:250
propinfo_t
Definition: propdata.h:219
void BreakModel_Receive(void)
Definition: propdata.qc:775
int PropData_Finish(void)
Definition: propdata.qc:631
int PropData_Load(string)
Definition: propdata.qc:409
var string g_curPropData
Definition: propdata.h:168
var hashtable g_hashpropdata
Definition: propdata.h:204
void PropData_Init(void)
Definition: propdata.qc:538
void PropData_Shutdown(void)
Definition: propdata.qc:34
int g_propdata_count
Definition: propdata.h:203
propdata_t * g_propdata
Definition: propdata.h:202
__variant Prop_GetInfo(int, int)
Definition: propdata.qc:50
int PropData_ForModel(string)
Definition: propdata.qc:273
int g_breakmodel_count
Definition: propdata.h:251
void BreakModel_ReceiveClientData(void)
Definition: propdata.qc:810
int g_breakmodel_end
Definition: propdata.h:252
typedef enumflags
Definition: propdata.h:171
@ PROPINFO_DMG_BULLET
Definition: propdata.h:222
@ PROPINFO_DAMPING_LINEAR
Definition: propdata.h:232
@ PROPINFO_EXPLOSIVE_RADIUS
Definition: propdata.h:226
@ PROPINFO_VOLUME
Definition: propdata.h:235
@ PROPINFO_INERTIA
Definition: propdata.h:234
@ PROPINFO_BREAKMODEL
Definition: propdata.h:227
@ PROPINFO_DAMPING_ANGULAR
Definition: propdata.h:233
@ PROPINFO_EXPLOSIVE_DMG
Definition: propdata.h:225
@ PROPINFO_DMG_MELEE
Definition: propdata.h:223
@ PROPINFO_FLAGS
Definition: propdata.h:221
@ PROPINFO_SKIN
Definition: propdata.h:229
@ PROPINFO_SURFACEPROP
Definition: propdata.h:236
@ PROPINFO_HEALTH
Definition: propdata.h:220
@ PROPINFO_DMG_EXPLOSIVE
Definition: propdata.h:224
@ PROPINFO_BREAKCOUNT
Definition: propdata.h:228
@ PROPINFO_MASS
Definition: propdata.h:231
string target
Definition: defs.h:23
Data holding BreakModel entries.
Definition: propdata.h:242
string name
Definition: propdata.h:243
float modelindex
Definition: propdata.h:245
string data
Definition: propdata.h:244
bool physics
Definition: propdata.h:246
Data holding PropData entries.
Definition: propdata.h:179
float damping_linear
Definition: propdata.h:194
float volume
Definition: propdata.h:197
string surfaceprop
Definition: propdata.h:198
float mass
Definition: propdata.h:193
float damage_explosive
Definition: propdata.h:186
propdataFlag_t flags
Definition: propdata.h:183
string breakable_model
Definition: propdata.h:190
float health
Definition: propdata.h:182
float damage_bullets
Definition: propdata.h:184
float breakable_skin
Definition: propdata.h:192
string breakable_particle
Definition: propdata.h:189
float explosive_radius
Definition: propdata.h:188
float damage_melee
Definition: propdata.h:185
float damping_angular
Definition: propdata.h:195
float explosive_damage
Definition: propdata.h:187
string base
Definition: propdata.h:181
int breakable_count
Definition: propdata.h:191
float inertia
Definition: propdata.h:196
string name
Definition: propdata.h:180