|
This tutorial covers: |
(*Note: This tutorial assumes you have both Half-Life AND Worldcraft v2.0. This tutorial is designed for those of you who are new to Level editing and CSG (Constructive Solid Geometry) or Brush-type maps. | - Texture
selection and manipulation - Brush creation
- Stretching/resizing
brushes - The Hollow
function - The Subtraction
tool rial - Entity
creation - Compiling/running
a map
|
Welcome to Tutorial #3 - Back again (though a little late - darned RealLife™!) This tutorial will be covering a few topics, as listed in the title. You WILL notice a LOT more Blue text this time around - as I'm going to be doing less explaining, and more straight instruction. Blue statements are the functions I want you to perform.
NOTE: I AM going to assume that by now you've mastered how to perform the functions we did in tutorial 2. But you came here for the tutorial -so without further ado, why don't you load up Worldcraft now. All tutorials are going to assume you have the latest version, and use the default setup with a 2-button mouse - you should also have all of the proper directories and tools configured before using this tutorial. Refer to the documentation under the Start menu for details. I would advise everyone to print parts of it out at first for reference. I will also be covering the individual commands each time we execute a new command for the first time.
Once Worldcraft has been loaded, go up to the "File" menu item and click on "open". Choose the file from our last tutorial, and be sure the textures load up properly! In Half-Life, all textures are stored OUTSIDE of the map in .WAD files. These must be loaded by the map-editor so that you can apply them to various brushes. Without textures, your shapes and levels would be done in single colors; and who wants that?? Also, I personally like to have all of the menus and status bars turned on (you can select which ones are displayed from the "View | Screen Elements" menu). You may not want this if you have a small screen or are running at lower than 800x600 resolution; but at least note this: ALL Worldcraft menus and toolbars are DOCKABLE.
So I have mine arranged like this (Note: this screenshot was from v1.6; but I still suggest something similar to this setup) - it gives me a large main workspace for my maps, and an organized area for referring to textures, VISgroups, and some entity controls. Feel free to experiment around and find what's comfortable for you - as it is important that you have an arrangement that allows you to work freely and without frustration.
After the file loads, a new window will open up in your workspace with the standard Worldcraft 4-view layout. For consistency, we will use the same default texture as the last tutorial. A quick way to select this, is to select 3d Textured view mode, and then the Texturing tool , and click on a brush face in the 3-d view. Then, hit the Texturing tool button again to close the Face Properties dialog that popped up.
Now, on to the task at hand! The first thing we need to do is prepare our existing room for the hallway that will connect it to the second room. For this we need to create an opening in one of our walls. This is where another Worldcraft feature comes in handy: Subtraction (also called "Carving"). Subtraction is the act of taking one brush and using it like a "cookie cutter" to punch holes in the other brushes it intersects. NOTE: GREAT care and discretion must be used when subtracting brushes, as poor subtractions can fragment the original brushes into tons of small "pieces" that will slow down the renderer in the game, as well as the compiling tools. Also, remember that the selected brush will subtract from EVERY other brush it touches/passes through... so make sure that it ONLY touches the items you want subtracted.
That being said, we're just about ready to do some subtraction. I've decided that we'll make the hallway open off of the "west" wall of our room (from the XY view). Go ahead and select the brush creation tool. We're going to create a block to use as our "cookie cutter". Make sure you have the grid spacing set to 64, and find the coordinates (-256, 0) in the XY view. Drag out a brush to coordinates (-128, -64). In either the XZ or YZ views, re-size the brush to be 128 units (2 grid spaces) tall, and have it line up with the top and bottom of our existing room.
This is how your views should look so far.
When its all set, go ahead and press "Enter" to confirm the creation of the brush. Now, we don't want to carve away our floor or ceiling brushes, so we're going to need to resize this "cutter" brush by a small amount. Switch the grid spacing to 16 units (either from the "Map | Grid Settings" menu, or using the "[" and "]" keys). With the selection tool, grab our new brush; and in either the XZ or YZ views, shrink/resize the bottom of the brush up 16 units (one grid space), and the top of the brush 16 units down. Almost ready to carve!
We now need to stick our "cutter" brush part-way into the existing room by moving it 2 or 3 grid spaces to the east (to the right in the XY view). Use the camera controls to view and confirm that our "cutter" is in position.
This is how your views should look when everything's ready to carve.
When it all looks good, hit "Shift+Ctrl+C" or use the "Tools | Carve" menu item. not much should appear to happen; but after a few seconds you should notice a slight change. To confirm our carve has happened, we can also move the "cutter" brush 3 or 4 grid spaces to the west (left in the XY view). Notice the gaping hole in our wall now in the 3d view??
Make sure the "cutter" brush is a few grid spaces away, and drag a selection box around our entire existing room in the XY view. Once the box surrounds the entire room (but doesn't touch the "cutter" brush), press "enter" to select everything there. Now hit "Ctrl+C" or the "Edit | Copy" menu item. We're going to be lazy and use this for our second room once the hallway is done.
Go ahead and click on our "cutter" brush, so that it's selected and nothing else is. Move this brush back to the east so that its right edge falls on X axis coordinate -128. This should be the same coordinate as the outer edge of our "west" wall (that has a hole in it). We're going to use a trick with hollowing to turn our "cutter" brush into our hallway. Go ahead and hit "Ctrl+H" or the "Tools | Make Hollow" menu item. Normally we use numbers to designate the wall-thickness; but if we use NEGATIVE numbers, the brush "becomes" the hollow space and the number is used for the wall thickness AROUND the "outside" of the original brush. So in the dialog box type "-16" and press "Enter". Notice the change in the 2d views?? You also might notice that the hole appears to have disappeared in our wall!! Actually, what you are seeing is the "plug" or "cap" at the end of the hollow area we just created lining up with the west wall. Remember that a hollow puts walls on all sides of a brush.
At this point, your views should look like this. NOTE: I switched to the camera tool so that you could see where the camera was pointing.
Try selecting the "hallway" brushes and notice that (like with normal "hollow" operations) they're all grouped. Go ahead and choose "Tools | Ungroup" from the menu, or hit "Ctrl+U". Now, select the "cap" or "wall" brush of the hallway that is "in" our west wall - the easiest way to do this is to simply re-select the highlighted area of the wall in the 3d view.
You need to delete this brush so we can see "into" our hallway (use the "delete" key with the brush selected). We're getting there! Go ahead and select the brush at the other (west) end of the hallway and delete it as well.
Now with our hallway in place, we need to paste back in that copy of our room. Go ahead and deselect everything. Hit "Ctrl+V" or the "Edit | Paste" menu item to add the second room. Notice it comes in with everything selected... This is GOOD! Do NOT clear the selection! Having everything selected will make it easy to line it all up... In fact, hit the "Tools | Group" menu item or "Ctrl+G" to group this room into one object for now. Move this room in the XY view so that its eastern / right edge lies on the X coordinate -256... Its northern edge should be on Y coordinate 128 (so the rooms are aligned with each other north/south in the XY view). Then in the XZ or YZ view, move the room up or down so that its top and bottom line up with the first room. Now, if you're observant; you'll be complaining to me "But HB, the hole in the wall for this second room is on the WRONG SIDE!!"... and you'd be right.
Even though the room isn't finished, your views should look like this so far.
Enter yet another handy Worldcraft shortcut: the "Flip Objects" menu from the "Tools" menu. Make sure you click once on the room (keeping it selected) in the XY view and choose "Tools | Flip Objects | Horizontally" (you can also use "Ctrl+L" for future reference). Voila! Our room "flips", and now our walls are correct. One final thing we need to do is remove that pesky second player-start point. Remember that you only want _1_ per level normally!! So select our second room if it isn't selected anymore, and hit "Tools | Ungroup" or "Ctrl+U". Deselect everything; then select the player start entity and delete it. I'd suggest that right now you take a break from level editing. Save this file as "tutor3". Then compile (and test) the level like we did in Tutorial #2.
Here's our two rooms with a hallway in between.
Okay, did it work??? If not, you might want to go back to the tutorial2 file and try again - making sure you follow all these steps and that your screen looks like the shots I have provided. All set to continue??
Alright, its time to make us a door. Make sure that your grid spacing is still set at 16. Choose the brush creation tool and go to coordinates (-192, 0) in the XY view. Drag a new brush over and down to coordinates (-176, -64). This should be as wide (north to south) as the hallway, and 16 units thick (east to west). Check in the XZ or YZ views and re-size our brush so that the Z coordinates are (-144) at the top, and (-240) at the bottom... This should provide a snug "fit" inside our hallway. Go ahead and press enter to create the "door" brush.
Next, maneuver the camera view so that you're looking into the hall from the first (or eastern) room. Notice something strange?? We created our brush using that same old stone texture! Let's change that shall we?? I'm going to do this in the less-than-perfect way (from a design standpoint); but I want to illustrate the features of another Worldcraft tool. To do so, we're going to put some different textures on the different sides of this brush.
Go ahead and select the Texturing tool from the menubar . This will bring up the "Face Properties" dialog box. Drag around the window so it isn't covering the 3d view, and then let go of it. This is one of THE MOST complex tools in the Worldcraft arsenal; and I won't be touching on much of it this time around... I WILL, however, cover it more extensively in a tutorial soon. For now, go back to the 3d view and select the face of the "door" brush that is visible from our first (eastern) room. It should highlight in red.
Down in the "Current Texture" area of the dialog box, go ahead and select "browse". In the filter window (I pre-selected a texture that will work well, so we're going to jump right to it), type in "lab1_door7". Only one door-like texture should be visible in the texture window; so double-click on it to select it. Back in the texture area of the Face Properties box, click "Apply". Voila!
Notice something??? This texture doesn't line up quite right on our "door" brush!! Its time we did a little alignment. See the X and Y boxes titled "Shift", "Scale", and "Rotation"?? These we can use to change the placement or alignment of a texture on a brush face. Play around with the values for a while, and notice how the changes affect the texture (NOTE: You CAN use negative values in these boxes). When you're ready to move on, make sure you have the following:
Scale: X:1 Y:1
Shift: X:0 Y:48
Rotation: 0.00
Once again, these are values that I chose before-hand for a decent alignment (the game engine and compile tools don't care WHAT you do with the texture alignment - but be aware that changing the scale of a texture can sometimes causes a slight slowdown in-game). Click "Apply" to make sure these values are used. Often times, these values just must be "toyed with" to find what looks right; but with experience (and knowledge about coordinates and measurements of brush-faces and texture-sizes), you'll learn to guesstimate these things. Doing this stuff really makes the 2d art people shudder - because often-times we're using textures for something other than their intended purpose; but YOU have to make the decisions about what you want YOUR levels and objects to look like - and not all of us have art departments to cook up things that we want. ;-)
You should notice in the 3d view that the texture has changed. Its often tough to see subtle differences or the true colors of something through that red highlight, so Worldcraft has the ability to temporarily disable that highlight by selecting the "hide mask" button (try it). For now, select it again to resume normal highlighting. NOTE: Even though you won't SEE things highlighted, clicking around in the 3d view DOES change the selected brush-face; so be CAREFUL when this is on! Click on the "Texturing tool" button on the menubar to get rid of the dialog box.
Now, select the Camera tool and change the 3d view so we are seeing the opposite side of the "door" brush (the side that is visible from within the 2nd (western) room).
Once again, select the Texturing tool and select the "door" brush-face in the 3d view. Once its selected, go ahead and choose the "Hide Mask" button, so we can see the details of our changes. Now hit "Browse" again in the texture window. In the filter line type in "out_w8dr1" (once again, we're using a specific texture I decided upon before-hand). Double-click on the texture that's displayed, and then in the Face Properties box hit "Apply". This time I leave it up to you to align the texture. If you get frustrated; don't worry - texture alignment is for asthetics only, the game engine and compile tools don't give a damn whether they're aligned or not.
This example CLEARLY isn't a good one in terms of consistency or aesthetics; but it was a good intro. to what's possible with the Texture tool. Please get rid of the texture tool, by the way.
Go back to select mode. Select our "door" brush. The time has come to TRULY make it a door, instead of just a door-like wall. In the Object Menubar/toolbox, press the "To Entity" button. This should bring up the entity properties dialog box. In the "Class" box, make sure it is the entity type "func_door". If it isn't, click the drop-down arrow and select "func_door". I won't get into the intricacies of entities right now; but the "Attributes" section lists all of the commonly modifiable properties for this entity type. In our case the defaults SHOULD work fine... but I'll let you tinker with a few values.
Scroll in the Attributes box (NOTE: attributes are actually defined by something called "key/value pairs", and more attributes can be controlled from the "flags" tab - But we don't need to change them in this example; so I will have much more on these later) until you see one called "Speed". This is how fast the door will open and close. 100 is the default; but if you'd like to speed it up or slow it down some, feel free to enter a different number. Next, look for a "Delay before close" attribute. This is the number of seconds the door will wait after a player activates it before closing (I know, pretty obvious). But notice that there is a drop-down arrow in case you don't want to type in a specific number. This arrow shows us that there is a SPECIAL case for doors - we can set them so that they never close back up. For now, make sure "3" is in this attribute's value. Let's also make things look a little nicer. The "Lip" key is best explained through example. Change the "lip" value to "8". Now, when the door opens it will stop with 8 units left sticking out. The lip basically shortens the total movement distance of the entity by the number specified. For kicks, let's give our door some sounds. Change the "Move sound" to "Servo (sliding)", and the "Stop sound" to "Chunk". As you can see, there are MANY MANY more attributes; and you can reference them at the Half-Life entity list.
There IS, however, one last (and CRUCIAL) property we need to edit. This is the "Angle" of the door ("Angle" can be found in the upper-right part of the Object Properties dialog box). We've set up our textures so that the door looks best when it opens sliding to the "north" in the XY view. So for our Angle, we need to set the value for north. The Angle attribute uses a compass-like heading system; the only difference is that 0 is due EAST (Also note the drop-down box for selecting if we want the door to open "up" or "down"). Go ahead and type in "90" in the angle box. Note that the little compass-display points to the north to illustrate the angle we've selected (we can use the mouse button in the compass-display to adjust the angle, but typing in the number is much more precise). This should set all the critical values we need to get our door working, so hit the "X" button in the upper-right-corner of the Object Properties dialog box to clear it out.
Save the map again, and compile and run it! Notice that the door opens whenever you get near it. This is because we didn't set it up to be triggered by anything. This is the default setup for all doors. Well, that about wraps it up for this time! Next tutorial we'll be delving into more door-fun, rotating doors, and lifts/platforms that raise and lower. Happy editing!!
Tutorial 3: Adding Rooms, Hallways, and Doors |