Concepts

Concepts

There are some basic entity-related concepts that it might be useful to have explained in one place. If you're familiar with Quake or Quake2 editing you surely know all this already, but if it's Hexen 2 that's gotten you into it, read on. These concepts are linked to occasionally in the entity-descriptions, but not everywhere.

Entities and Fields

Everything in a Hexen 2 (or Quake(2)) map is either a brush or an entity. An entity is constituted by a collection of fields, each with a name (often called a `key' or `attribute'), and a value. The only absolutely essential field for an entity is the one called "classname"; its value is the name of whatever kind of entity the entity is supposed to be, such as "func_door" (for an ordinary door) or "light" (a light-source). These fields/keys/attributes and their values are often called the entity's `specifics'. Here are the specifics for a simple light:

classnamelight
origin0 10 50

Here the origin is saying where the entity is.

The fields get their meaning from the HexenC code that implements whatever it is that the entity does. Each kind of entity (classname-value) has its own defining code, so the meaning of a particular field name won't necessarily be the same for all the different kinds of entities that use it.

Most of the fields that an entity can have don't have to be specified, because some `default' value will be supplied automatically if none is given. For lights, for example, there is a field light that specifies how bright the light is, whose default value is 300 (range from 0 to 800). So the above light-specifics will give us a brightness of 300. Fields that an entity type doesn't recognize are silently ignored, while ones that no entity uses produce a warning when H2 starts up.

Brush ownership

Every brush in a map is owned by some (single) entity. Ordinary inert brushes are owned by an entity called `worldspawn' that your map editor will take care of for you, but brushes can also be owned by entities such as doors, buttons and many others. Your editor will provide some means to assign an entity as owner of a brush ('to entity' command in Worldcraft, iirc, grouping in QuArK, etc.)

The brushes owned by an entity will constitute its visible shape, if any, and touching it fires it if it's a trigger for a target. All of the brushes owned by an entity will behave alike, for example if it's a func_rotating entity, all of the brushes owned will rotate in the same way around the origin of the entity. So you can make a complicated rotating object such as a windmill.

An entity can own any number of brushes, but many entities, such as lights, have no use for brush-ownership (entities that don't own brushes tend to have an origin field to tell them where there are). Different entities can't own the same brush.


Targetting

Very often, the function of one entity is to cause another entity to do something. For example push a button, and a door opens; or walk through an invisible brush, and activate some kind of trap. The triggering entity is called a `trigger', and has a field target, whose value is a name. This name then appears as the value of a targetname field in the entity or entities whose actions the trigger is controlling.

For example to make a button-operated door we'd want an func_button as the trigger, and perhaps a func_door (sliding door) as the target:
button:
classnamefunc_button
targetdoor1
door:
classnamefunc_door
targetnamedoor1
Now if you bump into the button, it will slide west (since that's the default angle), and the targetted door will then also slide west, each moving by its east-west width minus a bit. We can then make the example more useful by adding fields such as angle, lip, and many others, as discussed in the description of the particular entities.

The target of one trigger can be the trigger for the next (for example as with breakable brushes, where the destruction of one brush in a tower can cause the destruction of all those above it), but no cycles.

An useful variant of ordinary targetting is killtargetting, whereby certain kinds of entities whose targetname-value is the killtarget value of (certain kinds of) triggers are deleted when the trigger fires.


Return to the Eye.