Edict t

From Valve Developer Community
Revision as of 10:31, 16 September 2008 by Dave Gomboc (talk | contribs)
Jump to navigation Jump to search

Template:Wrongtitle

Stub

This article or section is a stub. You can help by expanding it.

Purpose: The engine's internal representation of an entity, including some basic collision and position info and a pointer to the class wrapped on top of the structure.

Basic discussion

An edict, an abbreviation of "entity dictionary" attributed to John Carmack, is a way to store basic properties about an entity (e.g., location, rotation).

Do not attempt to change the class definition of edict_t when modding. As a member of the HL Coders list put it, "messing with them will cause the magic smoke to evaporate from your compiler." The Source engine is compiled with a specific edict structure. Mod code cannot add or remove properties because it would cause size and behaviour mismatches between parts of the engine you compile when modding and parts of the engine that were pre-compiled by Valve.

http://www.mail-archive.com/hlcoders@list.valvesoftware.com/msg01215.html suggests that it's not a good idea to rely upon a destructor being called for this class either. The naming of this class ("edict_t", as opposed to "edict") suggests this also.

How do I obtain an edict_t?

edict_t * const entity_dictionary = engine->PEntityOfEntIndex(player_index /* 1-32 */);

Related content

CBaseEdict