edict_t

Engine part of edict_t

This part may not be changed because the engine assumes all fields to be of these types and in this order.

Name

Type

Notes

s

entity_state_t

has several subtypes (see below)

client

struct gclient_s*

points to the player controlling it, NULL if not player controlled

inuse

qboolean

the entity exists in the world

linkcount

int

changed by the gi.linkentity function ?

area

link_t

used by engine.

num_clusters

int

used by engine.

clusternums[]

int

used by engine.

headnode

int

used by engine.

areanum, areanum2

int

area where you currently are used when checking if monsters can hear sounds. Used by engine.

svflags

int

SVF_NOCLIENT - don't send to clients
SVF_DEADMONSTER - treat as dead monster for collision tests
SVF_MONSTER - same, a bit earlier

mins, maxs

vec3_t

position of min and max points of entity relative to its origin

absmin, absmax

vec3_t

position of min and max points of entity relative to the world's origin

size

vec3_t

size of entity (vector from mins to maxs)

solid

solid_t

solidity of entity :
SOLID_NOT -no interaction with other objects
SOLID_TOUCH-touch inside after moving (used for triggers)
SOLID_BBOX-touch on side (monsters, etc)
SOLID_BDP-bsp clip, touch on edge (for solid walls, blocks, etc)

clipmask

int

type of objects the entity will not pass through can be any of MASK_* or CONTENTS_* listed at bottom of this document

owner

edict_t *

usually the entity that spawned this entity (eg bullet is 'owned' by the monster that fired it)

Game DLL part of edict_t

Here you can add new attributes necessary for your modifications of the game DLL. The engine won't mind. It will know the edict size by a reference in the game_export_t API. That is all it needs for proper allocation of new edicts.

Name

Type

Notes

accel

float

acceleration of platforms

activator

edict_t *

entity which activated the current entity

air_finished

float

time when air will run out (when underwater) compare to level.time. Players can hold breath about 10 sec.

angle

float

entity yaw set by level editor (-1 = up; -2 = down)

attenuation

float

attenuation of above sound (set at level edit)

avelocity

vec3_t

angular velocity (see note for velocity)

chain

editc_t *

used when creating a list of entities

classname

char *

type of entity (eg 'player','monster_soldier')

combattarget

char *

name of entity to attack (used once)

count

int

general purpose 'amount' variable, often set in level editor

damage_debounce_time

float

time when lava/slime can do more damage to player

deadflag

int

state of deadness : DEAD_NO, DEAD_DYING, DEAD_DEAD, DEAD_RESPAWNABLE

deathtarget

char *

name of entity to use when current entity dies

decel

float

deceleration of platforms

delay

float

time between triggering switch and effect activating

dmg

int

damage done by entity

dmg_radius

float

area to do radius damage

enemy

edict_t *

entity to attack

flags

int

various attributes :

  • FL_FLY-flying

  • FL_SWIM-swimming, won't drown
  • FL_IMMUNE_LASER-not hurt by laser
  • FL_INWATER-set when entering water, cleared when leaving
  • FL_GODMODE- god mode on
  • FL_NOTARGET - will not be targeted by monsters
  • FL_IMMUNE_SLIME- not hurt by slime
  • FL_IMMUNE_LAVA - not hurt by lava
  • FL_PARTIAL_GROUND- ground pulled out from under monster
  • FL_WATERJUMP- player jumping from water
  • FL_TEAMSLAVE-not first member of a team
  • FL_NO_KNOCKBACK-entity not thrown back by damage
  • FL_POWER_ARMOR- active power armor
  • FL_RESPAWN-entity waiting before respawning

fly_sound_debounce_time

float

used with looping sound when pushing player (in_trigger.c)

freetime

float

time when entity was freed-up in memory

gib_health

int

health at which to gib :)

goalentity

edict_t *

entity currently moving towards

gravity

float

not used by any entites, but can be used to define reduced/ increased gravity for individual entities (normal=1.0)

groundentity

edict_t *

what the entity is standing on

groundentity_linkcount

int

used in conjunction with linkcount to see if the current entity is still standing on the groundentity

health

int

health of entity, increased and set in many places, but should only be reduced by t_damage()

ideal_yaw

float

yaw the entity wants to face

item

gitem_t *

info about item (see below)

killtarget

char *

name of entity to remove when current entity triggered

last_move_time

float

time to play earthquake sound again

light_level

int

player's light level, used by monsters when checking if player can be seen

map

char *

filename of the next map, part of entity target_changelevel

mass

int

used when pushing entites and calculating knock-back for weapons (eg rocket hits)

max_health

int

maximum health

message

char *

message when entity activated (set by level editor)

model

char *

filename of entitie's model

monsterinfo

monsterinfo_t

info about the monster (see below)

move_angles

vec3_t

the angle that the gun turret is facing

move_origin

vec3_t

the origin of the gun turret

movedir

vec3_t

direction currently moving in

moveinfo

moveinfo_t

used by the ships flying overhead

movetarget

edict_t *

entity to wark towards when not got anything better to do(such as killing the player)

movetype

int

how the entity moves :

  • MOVETYPE_NONE-never moves, just runs think

  • MOVETYPE_NOCLIP-ignores walls, etc
  • MOVETYPE_PUSH-ignores walls, pushes entities
  • MOVETYPE_STOP-ignores walls, stops on entities
  • MOVETYPE_WALK-players, affected by gravity
  • MOVETYPE_STEP-gravity, special edge handling used by monsters
  • MOVETYPE_FLY-no gravity used by flying monsters
  • MOVETYPE_TOSS-gravity, hits ground and stops
  • MOVETYPE_FLYMISSILE-weapons, extra clip size when hitting monsters
  • MOVETYPE_BOUNCE-bounces (eg grenade)

mynoise,mynoise2

edict_t *

spawned when player makes a noise, monsters can home in on them

nextthink

float

time at which entity should call function 'ent->think'

noise_index

int

index of sound to play when entity is triggered

noise_index2

int

not used anywhere

oldenemy

edict_t *

player they were attacking before distracted (by another monster hitting them)

pain_debounce_time

float

prevent pain sounds/anims playing to often

pathtarget

char *

name of entity to move towards

pos1

vec3_t

top position of lift

pos2

vec3_t

bottom position of lift

powerarmor_time

float

time to stop showing translucent shield effects

radius_dmg

int

amount of radius damage done by entity

random

float

used to add a bit of time variation to func_timers

show_hostile

qboolean

any monsters seeing this one will inherit its enemy

sounds

int

type of sounds to play - used by doors, lifts, etc

spawnflags

int

set by level editor, some values are:

  • SPAWNFLAG_NOT_EASY

  • SPAWNFLAG_NOT_MEDIUM
  • SPAWNFLAG_NOT_HARD
  • SPAWNFLAG_NOT_DEATHMATCH
  • SPAWNFLAG_NOT_COOP

There are other possible settings, which I have not yet looked at in detail.

speed

float

speed of misc entities, including moving buttons, the gun turret and the fly-by ships

style

int

type of entities (eg type of health box) also used as areaportal number (something to do with separating areas)

takedamgage

int

can the entity be damaged? :

  • DAMAGE_NO-will not take damage

  • DAMAGE_YES-will take damage
  • DAMAGE_AIM-will take damage + weapons 'auto-aim' at it

target

char *

name of entity to trigger or move towards

target_ent

editc_t *

entity that platform/lift is moving towards

targetname

char *

name pointed to by target

team

char *

name of team which entity is part of

teamchain

edict_t *

the next entity in the team

teammaster

edict_t *

the master entity in the team

teleport_time

float

time when monster teleported into level

timestamp

float

Used by various functions to mark the spawn time of an entity or the start of a change (eg a light ramp)

Used in trail to figure out how hold footprints are.

Used by Viper, earthquakes , hurt triggers, dead hovers for time to explode.

touch_debounce_time

float

prevent touch function from being called again too quickly

viewheight

int

height above origin where eyes are found

velocity

vec3_t

current velocity.

volume

float

volume when playing above sound (set at level edit)

wait

float

time to wait before platform moves to the next point on its path

waterlevel

int

height of liquid:
  0 - not in liquid
  1 - feet in liquid
  2 - on surface of liquid
  3 - surrounded by liquid

watertype

int

type of water the entity is in (see the CONTENTS_* list at bottom of document)

yaw_speed

float

speed to turn towards ideal yaw

blocked

void (*self, *other)

function to call when movement is blocked by something? (optional)

die

void (*self, *inflicotr, *attacker, *damage, vec3_t point)

function to call when health <= 0 (MUST be present if the entity can take damage)

prethink

void (*ent)

function to call before each frame (optional)

pain

void (*self, *other, float kick, int damage)

function to call when hurt (optional)

think

void (*ent)

sets the function that should be called at time nextthink

touch

void (*self, *other, cplane_t *plane, csurface_t *surf)

function to call when it touches another entity/the world (optional)

use

void (*self, *other, *activator)

function to call when used (optional)