Mapping 104: Entities

## Entities

Most of the interactive aspects to mapping involve Entities. Here is a basic rundown on the Entity Inspector (N) and some Netradiant-custom enhancements. You will want to look at Rich Diesel's tutorial for more entity knowledge, but this is a good first step/starting point.

### What is an entity?

An entity is an object in a map that interacts with the player or helps to connect aspects together. Here are a few examples:

* A trigger, which may be activated by player to trigger other entities
* A spawnpoint (info\_player\_siegeteam1) or NPC.
* Lights
* Doors (func\_door)

There are a lot of entities to go through, but keep in mind there are differences between JKA and MBII entities as their are hardcoded differences. It will depend on what game is set within Netradiant, so if you are not seeing MBII-specific entities like trigger\_capture, be sure to check in preferences that you are using mbii.

You've already used three entities in your map... an info\_player\_start, which tells the SP engine where to start the player when he enters the map (or determines where spectator camera spawns in MP), info\_player\_siegeteam1 or 2 for blue/red spawns and a light. Time to take it a step further, yeah?

First of all, general information about entities. You can pull up the Entity window by highlight any single entity and pressing the N Key. Do this for your info\_player\_start. You might have noticed that when you loaded up your map, you were facing the wrong angle? Well we'll fix that now! First, put on the XY Top View so that you can see the top of your info\_player\_start. Now, in the entity window (load it with the N Key) and modify the angle. You can also go into the 3d view and point that camera at the angle you want the info\_player\_start to point and click in your Entity window the 'cam' button. This will add what's called a key and value to your entity that will appear in its properties list (green box in the image below).

Any entity can be given an angle key, although the type of entity it is will change the function of angle. In the case of info\_player\_start or siegeteam1/2, angle determines which direction the player will face when he enters the level. If you want to modify the key manually (or add a different key), simply type in the values you want in key and value and press Enter while the cursor is in the Value textbox. Now, let's place some weapons to pick up on top of the walkway.

#### Placing entities

Entity types in idtech3 engine are either point entities or group entities.

* Point entities do not contain primitives (patches or brushes)
* Group entities must contain primitives
	+ You'll get a c b model null errorwhen you have no primitives in your group of entities.

* Right-click in a 2d viewport or double right click in the camera view to access the entity placement context menu. Your entity will be placed where you right clicked. Some entities show up as small boxes, which helps visualize that there is something to be placed here, be it a trigger, model, NPC, spawner, weapon or otherwise. You CAN turn brushes into triggers as well, for example: func\_door is used very commonly in maps and is an entity you place on your door brushes. You can also turn selected brushes into entities, Try it out! make a big brush, right click (or double right click in 3d) on it and turn it into a trigger\_multiple. You'll notice this will also turn this brush's shader into a trigger shader, which will mean it will be invisible in-game and also easily hidden in the editor along with other entities via the top bar or via one of the alt+# hotkeys. Useful for organization.

#### Linking entities

* A target relationship can be established between two entities by selecting them, then pressing Ctrl + K. The first entity you select is the one which will target the next. Selection order dermines connection direction.
* You can also do this manually by giving them matching targetname and target keys. For example: target doorhack -> targetname doorhack
* Here is an example of what two triggers look liked when linked together, you will see a line with an arrow connecting them. This means they are connected, in this case once the first trigger is activated, the second one will activate.

#### Targetname and target

* If you want to modify the key manually (or add a different key), simply type in the values you want in key and value and press **Enter** while the cursor is in the Value textbox.
* If you click on one entity key it will be put into the key/value boxes, you can then click a new entity and it will keep the currently selected key and value. This is useful for copying and pasting keys and values.
* Netradiant has has a nice shortcut tool for finding which entity you are targeting and toggling through a chain of connected entities:

#### Viewing all Entities

Press L, this will pull up your entity list. This is a nice way to select a lot of entities at once or simply to try to find a certain entity which may have escaped your grasp. Scroll down to the bottom and select worldspawn.

#### Duplicating

You can duplicate entities with the Space Bar, just like you can duplicate brushes. Keep in mind this is different from simply copying and pasting via ctrl c / ctrl v which creates a copy instead.

* For a loose entities (not connected to anything) there is no difference between copy/paste and duplicating
* For connected entities, the duplicated entities will be connected as clones of the past entity
* For connected entities, copy/pasted entities, their values will be changed to avoid sharing the same targetname/etc, essentially creating a new entity or connected group of entities with names changed.

If you want more than one trigger doing the same exact function, you can duplicate an entity by pressing spacebar. These two entities will now act entirely the same and fire at the same time. If you edit one, it will change the other. Useful for things like door panels and what-not. This way they will share the same wait delay so you can't have one door panel causing the door to close while it is opening.

#### What is worldspawn?

Worldspawn is the standard group entity where map primitives (brushes and patches) are stored by default. Any map must have a wordlspawn entity. It's also a place to store keys controlling some defining characteristics of gameplay. Take a look at the entity definitions and add some music to your map by customizing your wordlspawn for starters! There are also a lot of very useful global lighting aspects you can tweak in your wordlspawn, but that is listed in the compile guide. It's easy to find your worldspawn, simply select any loose primitives (brushes or patches) and press N.

### Homework:

* Create a func\_door which is activated by a player walking into a trigger brush (hint: this site has a few good guides)
* Create a trigger\_once which turns off or on a func\_wall or func\_usable
* Create a trigger\_multiple which, after a hack timer, targets an info\_siege\_objective (causing the round to end)[1]
* Create a 'hole in the wall' concept, where a certain part of your map has a func\_breakable allowing the player to break that part and get into a new room
* Create a 'final obj' trigger which is connected to the .siege file of your map, causing the round to end.
* Decompile a map which has an interesting entity or facet you want to learn more about. (Menu->File->Import also works in latest version of NRC!)
* Study Rich Diesel's Entity 202 tutorial series

Take your time to learn entities, the more you learn, the cooler your maps will become. Most of the entities have detailed descriptions, but to help you along this journey, here are a few of the more important types of entities broken down:

1. System Brushes (not entities per-say, but these will help you with further adding interactive elements to your map.
2. Worldspawn Entity
3. Function Entities - learn how to make a door!
4. Target Entities
5. Trigger Entities
6. Objectives

Once you have made some things like doors, triggers, etc move on to Mapping 105: Lighting