Entity

From The DarkMod Wiki
Revision as of 13:54, 3 July 2008 by Greebo (talk | contribs)
Jump to navigationJump to search

An entity is a functional unit of all games basing on id software technology.

Examples for entities are:

  • lights
  • AI (guards, spiders)
  • the player
  • path nodes
  • moveables
  • readables
  • models (or "static meshes" to be more precise)
  • the world itself ("worldspawn")

An entity's functional behaviour is entirely defined through its spawnargs, a collection of key/value pairs. The spawnargs define the type of an entity, and the parameters which are passed to the code. There is virtually no limit on the number of spawnargs - some entities like the player have over 200 key/values.

Each entity needs to have at least two spawnargs to be valid: a "name" and a "classname". The "name" of an entity must be unique in a map - no two entities are allowed to have the same name. (The next most important thing is the "origin" spawnarg which defines the absolute world location the entity is spawned at.)

  • For information about entity classes see the entityDef article.