2.2.1 Entity Overview:

Entities are the second major component of Quake MAP files. An entity is basically a bit like a thing, but they also function as triggers and as pathmarkers. Adding entities will affect your build time, because solid entities (monsters, weapons, armor, ammo, health) have to be lit, so that's one more item for LIGHT to deal with. I once saw a map with 40 lights shoot to 200 entities once I populated it.

A entity statement looks like this:

{
"classname" "light"
"origin" "0 128 64"
"light" "255"
}

This is what is called a general entity statement. It is called a general statement because it does not attach to a brush. An attached entity statement looks like this:

{ "classname" "func_door" "angle" "0" "speed" "16" "targetname" "t1" "sounds" "1" "wait" "16" { ( 128 0 0 ) ( 128 1 0 ) ( 128 0 1 ) GROUND1_6 0 0 0 1.0 1.0 ( 256 0 0 ) ( 256 0 1 ) ( 256 1 0 ) GROUND1_6 0 0 0 1.0 1.0 ( 0 128 0 ) ( 0 128 1 ) ( 1 128 0 ) GROUND1_6 0 0 0 1.0 1.0 ( 0 384 0 ) ( 1 384 0 ) ( 0 384 1 ) GROUND1_6 0 0 0 1.0 1.0 ( 0 0 64 ) ( 1 0 64 ) ( 0 1 64 ) GROUND1_6 0 0 0 1.0 1.0 ( 0 0 128 ) ( 0 1 128 ) ( 1 0 128 ) GROUND1_6 0 0 0 1.0 1.0 } }

In Worldcraft, you don't need to worry about that. You edit with a drag and drop/draw paradigm that hides the complexity of MAP formats from you. You add entities with the Entity tool:

Select the entity you want from the pull down menu on the right and place it on the map. Be careful not to let the entity get stuck in a brush. If it's stuck in the brush, chances are the item will fall out of the map or you'll get an error in QBSP.

Attached entity brushes can have an "origin" tag. It can be used to offset where they appear in the level.

For the rest of the document, when I give you frameworks for a structure, the individual entries can be in any order, and lots are optional. I try to mark if an entry is optional, although this has not yet been rigorously tested.

In a "" block, your choices for that block are delimited by commas.

2.2.2 "spawnflags" tag:

I believe that anything with an origin tag can have an optional 'spawnflags' tag. This is not confirmed, however. Tags can be combined by addition or bitwise or (really the same thing).

Spawnflags are changed in the entity by editing the properties. In Worldcraft, select an entity, then right click on it and drag the mouse down to the "Properties" menu item. You'll get this menu:


On the right you see what looks like a radar screen. That controls the direction an entity faces. For a item_player_start, you open facing the 'right'. With Worldcraft, the overhead view is used to determine the direction the entity faces. Worldcraft uses 360 degrees of rotation to determine which way the entity faces. The degrees are viewed from above, in the X/Y view. The four you need to know are:

0 - Right 90 - North (line points up) 180 - Left 270 - South (line points down)

This affects almost anything, except rotating items like armor, weapons, and keys. Using this, you can affect the following:

* Which direction the player faces on startup. * Which direction the play faces after teleporting. * Which direction monsters face. * The direction doors open. * The direction spike/laser traps shoot.

Platforms are not affected by this, because you use the target and targetname to dictate the direction of a path_corner entity. (more on that later)

The grayed out box that says "SmartEdit" is, obviously, the SmartEdit option. When grayed out, that means it's off. Turning it on means clicking in it once, and the box turns white (clear) and the option box will change. From there, you can click on the Add and Delete options, which are all that really count. I'll be referring to it as this map goes on, and you will see references to SmartEdit in things like the Worldcraft docs and Loki's tutorial (on the Worldcraft Homepage.)

2.2.3 General Entity syntax:

(Thanks to John Wakelin who wrote much of this section)

The entities define the monsters, things, but also the positions in space where something must happen. So they are the Quake equivalent of both the THINGS and the LINEDEF types from DOOM.

The entity definitions are made up of a series of specific details that define what each is, where it starts, when it appears etc. Each specific is followed by a modifier that arguments it. All definitions have the classname specific that identifies that entity. The classname specifics relate intimately with the code lump and are the names of functions written in Quake C.

I have chosen the terms ``specific'' and ``arg'' for the two different parts of each detail of the definition. These terms may or may not suit but, they will have to do until we learn what id calls them.

2.2.4 Setting Spawnflags

Most entities are stand-alone. That is, things like direction or spawnflags, are all you need. For some entities, like a door or gate, you need a "target" and "targetname" to tie the two together. For example, you tie a func_button (a button) or any one of several trigger_ entities (triggers) to a func_door (door, gate) to open a door or gate. This will be discussed in later chapters.

NOTE!

"target," "targetname," and other spawnflags are case-sensitive. Make sure to watch your cases!

These spawnflags are what you will find if you open the MAP file. Again, we don't edit this way, so these settings have to be declared in Worldcraft through the properties menu. When you right click on an entity and select "Properties," you have three menu items, "Class Info," "Flags," and "VisGroups." Select "Flags" to edit spawnflags.

I can't emphasize this enough: USE THE FLAGS OPTION RELIGIOUSLY. Every entity has flags and you will set them thru this option.

The spawnflags will vary from one entity to another. For the sake of consistency with the items in the original MAP spec file, I'll use item_health.


For health items, the direction is not important. In Worldcraft, the default for health items is normal, ie. 25 HP. Checking Rotten makes it 15 HP, "Megahealth" makes it 100 HP. And the Not In... options are pretty straight foreword. If you want to make your map tougher on Hard level, for example, you simply select "Not in Hard."

Another trick: Add two health items. For the 25 HP one, select "Not in Hard." For the second health item, select "Rotten" and "Not in Easy" and "Not in Normal." This way, Easy and Normal gives the player a 25 HP health. Hard gives them only 15 HP.

2.2.5 Optional Parameters for Entities

Specifics    Args      Description
--------------------------------------------------------------------------------
"classname"  "name"    // Type of entity to be defined (mandatory)
"origin"     "X Y Z"   // Coordinates of where it starts in space.
"angle"      "#"       // Direction it faces or moves (sometimes in degrees)
"light"      "#"       // Used with the light classname.
"target"     "t#"      // Matches a targetname.
"targetname" "t#"      // Like a linedef tag.
"killtarget" "#"       // Removes target when triggered?
"spawnflags" "#"       // Used to flag/describe an entity that is not default.
"style"      "#"       // Used to flag/describe an entity that is not default.
"message"    "string"  // Message displayed when triggered (\n for linebreaks)
"mangle"     "X Y Z"   // Point where the intermission camera looks at

{BRUSH INFO}           // In entities that describe triggers/doors/platforms, etc,
                       // the brush info is inserted into the entity brackets,
                       // delimited by another set of brackets.

specifics/args present only in models:

"speed"      "#"       // How fast the model is moved.
"wait"       "#"       // How long a pause between completion of movement or
                       // return to original position (in seconds or 10ths)
"lip"        "#"       // Seems to be a means of adjusting the starting position.
"dmg"        "#"       // How much damage the model causes when it shuts on you?
"health"     "#"       // How much damage the model takes before it triggers
"delay"      "#"       // Time before event is triggered
"sounds"     "#"       // How much damage the model causes when it shuts on you?
"wad"        "wadfile" // The wad2 graphics file used by the world for textures.
"height"     "#"       // How high a platform will raise


---------------------------------------------------------------------------------
{
    "specific1" "arg1" // The first descriptors (usually classname)
    "specific2" "arg2" // The second
    ...                // Etc...

    {
        <INSERT BRUSH INFO HERE> // for entities like doors/triggers/platforms/etc
    }
}

Note: The term model refers to a combination of a brush and an entity. One or more brushes are bound to an entity, which controls the behavior of the brushes. All brushes are contained within models.

The model numbers in the compiled BSP (*x) comes from the order in which the models are stored in the models structure. These numbers are originally derived from the order of the models in the source MAP file.

The worldspawn model is a bounding box that defines the extents of the whole world.

The models are defined by a bounding box of the max and min(x,y,z). Therefore they are always parallel to the horizontal planes. This bounding box is simply used for speeding up collision detection and will not affect the movement of the models themselves.

2.2.6 All known entities (current for Shareware Quake 1.01):

air_bubbles : Rising bubbles ambient_drip : Dripping sound ambient_drone : Engine/machinery sound ambient_comp_hum : Computer background sounds ambient_flouro_buzz : Fluorescent buzzing sound ambient_light_buzz : Buzzing sound from light ambient_suck_wind : Wind sound ambient_swamp1 : Frogs croaking ambient_swamp2 : Slightly different sounding frogs croaking ambient_thunder : Thunder sound event_lightning : Lightning (Used to kill Cthon, shareware boss) func_door : Door func_door_secret : A door that is triggered to open func_wall : A moving wall? func_button : A button func_train : A platform (moves along a "train") func_plat : A lift/elevator func_dm_only : A teleporter that only appears in deathmatch func_illusionary : Creates brush that appears solid, but isn't. info_null : Used as a placeholder (removes itself) info_notnull : Used as a placeholder (does not remove itself) info_intermission : Cameras positioning for intermission (?) info_player_start : Main player starting point (only one allowed) info_player_deathmatch : A deathmatch start (more than one allowed) info_player_coop : A coop player start (more than one allowed) info_player_start2 : Return point from episode info_teleport_destination : Gives coords for a teleport destination using a targetname All item_ tags may have a target tag. It triggers the event when the item is picked up. item_cells : Ammo for the Thunderbolt item_rockets : Ammo for Rocket/Grenade Launcher item_shells : Ammo for both Shotgun and Super Shotgun item_spikes : Ammo for Perforator and Super Perforator item_weapon : Generic weapon class item_health : Medkit item_artifact_envirosuit : Environmental Protection Suit item_artifact_super_damage : Quad Damage item_artifact_invulnerability : Pentagram of Protection item_artifact_invisibility : Ring of Shadows (Invisibility) item_armorInv : Red armor item_armor2 : Yellow armor item_armor1 : Green armor item_key1 : Silver Key item_key2 : Gold Key item_sigil : Sigil (a rune) light : A projected light. No visible lightsource. light_torch_small_walltorch : Small wall torch (gives off light) light_flame_large_yellow : Large yellow fire (gives off light) light_flame_small_yellow : Small yellow fire (gives off light) light_flame_small_white : Small white fire (gives off light) light_fluoro : Fluorescent light? (Gives off light, humming sound?) light_fluorospark : Fluorescent light? (Gives off light, makes sparking sound) light_globe : Light that appears as a globe sprite monster_army : Grunt monster_dog : Attack dog monster_ogre : Ogre monster_ogre_marksman : Ogre (no different from monster_ogre) monster_knight : Knight monster_zombie : Zombie monster_wizard : Scragg (Wizard) monster_demon1 : Fiend (Demon) monster_shambler : Shambler monster_boss : Cthon (Boss of Shareware Quake) monster_enforcer : Enforcer monster_hell_knight : Hell Knight monster_shalrath : Shalrath monster_tarbaby : Slime monster_fish : Fish monster_oldone : Shubb-Niggurath (requires a misc_teleportrain and a info_intermission) misc_fireball : Small fireball (gives off light, harms player) misc_explobox : Large Nuclear Container misc_explobox2 : Small Nuclear Container misc_teleporttrain : Spiked ball needed to telefrag monster_oldone path_corner : Used to define path of func_train platforms trap_spikeshooter : Shoots spikes (nails) trap_shooter : Fires nails without needing to be triggered. trigger_teleport : Teleport (all trigger_ tags are triggered by walkover) trigger_changelevel : Changes to another level trigger_setskill : Changes skill level trigger_counter : Triggers action after it has been triggered count times. trigger_once : Triggers action only once trigger_multiple : Triggers action (can be retriggered) trigger_onlyregistered : Triggers only if game is registered (registered == 1) trigger_secret : Triggers action and awards secret credit. trigger_monsterjump : Causes triggering monster to jump in a direction trigger_relay : Allows delayed/multiple actions from one trigger trigger_push : Pushes a player in a direction (like a wind tunnel) trigger_hurt : Hurts whatever touches the trigger weapon_supershotgun : Super Shotgun weapon_nailgun : Nailgun weapon_supernailgun : Super Nailgun weapon_grenadelauncher : Grenade Launcher weapon_rocketlauncher : Rocket Launcher weapon_lightning : Lightning Gun

The use of these entities will be discussed in other chapters.


Portions Copyright (c)1996-97 Niklata and Thomas Winzig.