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

Editing DP QC ENTITYDATA

From Quake Wiki

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 19: Line 19:
 
DP_QC_ENTITYDATA provides versatile functions intended for storing and retrieving field data without hard coding all the field names, in a versatile way. It was originally intended for automatically dumping entities to make them persist between levels, but was designed to be as versatile as possible. The data can be filtered by type or other criteria, and saved to file or sent to a database in combination with other functions.
 
DP_QC_ENTITYDATA provides versatile functions intended for storing and retrieving field data without hard coding all the field names, in a versatile way. It was originally intended for automatically dumping entities to make them persist between levels, but was designed to be as versatile as possible. The data can be filtered by type or other criteria, and saved to file or sent to a database in combination with other functions.
  
'''WARNING:''' .entity fields cannot be saved and restored between map loads as they will leave dangling pointers. Entity fields might still be useful, for example if you wish to dump entities straight to a web server for inspection there, in the event of an error.
+
'WARNING' .entity fields cannot be saved and restored between map loads as they will leave dangling pointers. Entity fields might still be useful, for example if you wish to dump entities straight to a web server for inspection there, in the event of an error.
  
*''numentityfields'' returns the number of entity fields. NOT offsets. Vectors comprise 4 fields: v, v_x, v_y and v_z.
+
''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.
+
''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.
+
''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.
+
''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.
+
''putentityfieldstring'' puts the data returned by getentityfieldstring back into the entity.
[[Category:DarkPlaces]]
 

Please note that all contributions to Quake Wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see Quake Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)