S  W  A  T   3   M  O  D    H  Q    
MISSION TOPIC - CLOSE WINDOW WHEN FINISHED

Advanced Techniques - The Sample Level

Introduction

We've included an sample level with Worldcraft. You'll find it in the SWAT3\Tools\Worldcraft\sample folder. The name of the file is "sample1.rmf". Open Worldcraft and check your options by selecting "Options" in the Tools menu. If Worldcraft is not configured for SWAT3, follow this link for instructions as to proper configuration. Once that's done, open up the sample map in Worldcraft and have a look.

 

VisGroups

Once the map is open, you'll notice it's a bit cluttered. 

Figure 3.1 - A Slightly Cluttered Map

If you're working on a map such as this one, you may find it necessary to "hide" some of the objects and geometry that you're not working on in order to concentrate on the objects and geometry that you are working on. This technique is possible in Worldcraft with the use of VisGroups.

Simply put, VisGroups are groups of geometry or entities that can be moved, rotated, sized, sheared, and hidden or shown as a unit. 

VisGroup Visibility

Figure 3.2 shows the VisGroup control window, something you'll want to get familiar with if you wish to use VisGroups. This figure refers to the window as it should appear upon opening the map. You'll notice that all entries have a small icon to the left of them, except for the "misc func_objects" category. This means all VisGroups except the "misc func_objects" group are visible. Click to the left of the "misc func_objects" entry, where the icon would appear. You should see the icon appear to the left of the entry, like the others. But there is no change anywhere on the map! Why is this? Because changes to the VisGroups must be "applied". Before you click the Apply button, change your view to 3d Textured Polygons.


Figure 3.2 - VisGroup Control Window

Click the Apply button on the VisGroup Control Window.

Figure 3.3 - Before and After

The 3d View should show something similar to the right-hand picture of Figure 3.3. You have made the group marked "misc func_objects" visible.

Something more useful, you say? Well, return to the VisGroup control window and click on the small icons to the left of each entry except for "geometry". Hit Apply.

Figure 3.4 - Geometry Only

Now we're talking. All of the solid geometry that makes up this map is now visible without the distraction of entities, decals, portals, etc. Notice that the items that have been hidden from this window are also hidden from the 2d windows as well.

Manipulating VisGroups

So you can see how important hiding/showing VisGroups is. But, VisGroups have another use, in that they are groups and can be moved, sized, rotated, and sheared as such.

Go to the VisGroup Control Window and make the group "sprites & decals" appear. Then, select the "sprites & decals" field by clicking on it, then click the "Mark" button in the VisGroup Control Window.

Figure 3.5 - Selected VisGroup

You should see the objects that make up the VisGroup light up in red, and a bounding box will be drawn in the 2d view to mark the area taken up by the objects. Also, visible around the bounding box are sizing handles...just like a piece of geometry. Clicking on the group will also yield rotation and shearing handles. In this way, VisGroups can be manipulated like a geometric object.

Adding To VisGroups

VisGroups can be very useful. Managing them is simple; creating and adding to them can be done quickly and easily.

First, we'll add an entity to our "sprites & decals" VisGroup. See that chair? It's sitting right behind the glass desk with the computer. Our job is to add that chair to the "sprites & decals" VisGroup.

To add the chair, click on it in the 3d view. It should light up red. You can see it in red in your 2d views also. Move your cursor over the chair in any one of the 2d views, and right-click. This should drop down a menu, and allow you to select "Properties". Do so.

You should see the standard properties window...hey, it's a func_solidref. I didn't know that, either. Regardless, you should also see a VisGroups tab. Click on it. Here's what we want. Notice that the currently highlighted entry is "geometry". We want to move it to "sprites & decals". Just click on "sprites & decals", close the box, and it's a done deal.


Figure 3.6 - Switching an object's VisGroup

 

 We reach the final VisGroup topic: Creating New VisGroups. This is a breeze. Using the selection tools at your disposal (dragging a box and pressing ENTER, or CTRL-clicking), select multiple objects that you wish to add. I'm going to select the chair and the entity box above the planter behind the chair (that entity is a plant, by the way). You can select whatever you want...it's like a buffet! Or not. Now that you have something selected, you'll want to press the "Hide Selected Objects" button. The button is small, it's at the top toolbar, and it looks like this: Woah. Click on it, and behold. The items you selected disappear, and a new entry is added to your VisGroup Control Window. The entry should be at the top. This is your new VisGroup. To change the name of it, you can select the entry and click the "Edit" button.


Figure 3.7 - A New VisGroup is Added 

 

Doors

No topic is worthy of more discussion in level editing than doors. They seem a bit enigmatic at first, but after we walk you through them, you'll be cranking out sliding doors, swinging doors, there'll be no stopping you!

Where IS a door?

If you check your 3d view, and haven't moved around too much, you might be able to spy one down the hallway on the left hand side of the view. This is a standard door, and perfect for our purposes. Move over there using your camera tool. Now click on the door using the selection tool. The door lights up red, like we expect...but there are some anomalies. Two small cubes are on the bottom corners of the door.

What are these? These are ORIGIN brushes, and are absolutely ESSENTIAL to the functioning of a door. The origin brushes are just regular geometric objects, but they are textured with either the "origin" or "origin2" texture. This makes them invisible in the game, and also gives them special attributes. They mean different things to different objects, but to regular doors like this one, origin is the door's pivot point (where the hinges would be), and origin2 is the pull point (where the door would be pulled from).  The origin brushes are grouped together with the actual door and then transformed into an entity as a group. More on that later.


Figure 3.8 - Door with Origin Brushes Circled

As an entity, doors have a variety of properties which can be set. With the door selected, right-click on it in the 2d view to drop down a menu. Select "Properties". You can have a look at the properties; most of it is fairly standard fare for doors. Refer to the geometric entities section if you have questions on what it is that each field is responsible for.

 

Your Own Door

If you've gone through creating our example level, then you'll know how to create standard geometric objects (called brushes, typically), and you'll know how to apply textures. You'll need both skills to be able to create a door.

Here's how a standard door is created.

1 - Create Origin Brushes

You'll need two. They can be identical objects, but one MUST be completely covered in origin texture, the other MUST be covered in origin2 texture. The way to do this is to select the brush and use the "Apply current texture" button, with the "origin" or "origin2" texture selected in the Texture Selection Window. To select the origin brush, move your cursor over to the Texture Selection Window (Figure 3.9) and click the Browse button. You will be given a list of textures available to you. You should see them near the bottom. You can also type the name of the texture (origin, origin2) into the box at the bottom of the browse window to quickly get access to it.


Figure 3.9 - The Origin Texture Selected


Figure 3.10 - Apply Current Texture Button

2 - Create Door Geometry

This part of door creation requires you to actually create the door section that will move. If you're going to put it into a wall, you must use the Carve tool to carve a chunk out of the wall equal to the size of the door section. You can also apply your door textures and pretty it up a bit.

3 - Position Origin Brushes

Now, you must place the origin brushes at the correct points in relation to the door geometry. Remember that "origin" is the hinge point, and "origin2" is the pull point. This is the part that will take a bit of experimentation in-game to get the door swing correct. 

4 - Group Origin Brushes and Door Geometry Together

This does not mean VisGroup. This means actually group them by selecting them all and using the "Group" command in the Tools menu. Once they are grouped, they will be treated as a unit. Select them as a group for the last phase.

5 - Tie The Door Group To An Entity

This is the final step, and is done by selecting the group that you created above, and clicking the "ToEntity" button. This will open a dialog box, which will allow you to select the type of entity you're creating. The acceptable choices for doors are: Door, SlidingDoor, SwingDoor. After you've chosen the type, you can set the properties to your liking. This door is finished.

 

Transparencies

Transparencies are a nice effect to add to certain parts of a level. SWAT3's transparencies are texture-based. This means that you cannot directly control the amount of transparency inside Worldcraft. 

In order to create a transparency, you'll need to use an image editor to create a Targa File (.tga) that contains an alpha channel. This alpha channel can be modified to change the level of transparency on the texture. Add this .tga file to the .wad file for the mission (the compressed texture archive for the mission), and you can paint this texture onto geometry to give it a transparency. Make sure you also add the .tga to the main textures folder for your mission (It is required for size data).

 

Mirrors

Mirrors are another texture-based system that can provide reflection effects. This is not restricted to a "mirror", per se, but can be used for things like reflective tile floors, water, etc. To make a mirror, create a base texture (in the case of a tile floor, make it look like an actual tiled floor, for a "mirror", make it a glass-like texture). The catch is, you have to name the file in a certain way: the file must include the word "mirror" followed by a number from 0 to 255, which specifies the level of reflection. 0 is completely reflective, 1 is completely non-reflective, and from that point on, 2 to 255, it ranges from very reflective to almost completely non-reflective.

Note: Do NOT create a mirror which is in the visible range of another mirror. This creates an effect which can look through walls, and is unpredictable. It will NOT yield the desired results.