Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

DP QC ENTITYDATA

From Quake Wiki

Revision as of 12:00, 7 July 2008 by 79.69.20.187 (talk) (New page: Builtin definitions: <pre> float() numentityfields = #496; string(float fieldnum) entityfieldname = #497; float(float fieldnum) entityfieldtype = #498; string(float fieldnum, entity ent) g...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Builtin definitions:

float() numentityfields = #496;
string(float fieldnum) entityfieldname = #497;
float(float fieldnum) entityfieldtype = #498;
string(float fieldnum, entity ent) getentityfieldstring = #499;
float(float fieldnum, entity ent, string s) putentityfieldstring = #500;

Constants (Returned by entityfieldtype):

float FIELD_STRING   = 1;
float FIELD_FLOAT    = 2;
float FIELD_VECTOR   = 3;
float FIELD_ENTITY   = 4;
float FIELD_FUNCTION = 6;

DP_QC_ENTITYDATA provides versatile functions intended for storing data from specific entities between level changes, but can be customized for some kind of partial savegame.

WARNING: .entity fields cannot be saved and restored between map loads as they will leave dangling pointers.

numentityfields returns the number of entity fields. NOT offsets. Vectors comprise 4 fields: v, v_x, v_y and v_z.

entityfieldname returns the name as a string, eg. "origin" or "classname" or whatever.

entityfieldtype returns a value that the constants represent, but the field may be of another type in more exotic progs.dat formats or compilers.

getentityfieldstring returns data as would be written to a savegame, eg... "0.05" (float), "0 0 1" (vector), or "Hello World!" (string). Function names can also be returned.

putentityfieldstring puts the data returned by getentityfieldstring back into the entity.