Return to Castle Wolfenstein Mapping

The following are a list of tutorials, posts, and related notes I have gathered over the years. Where appropriate I have cited credits to original authors, otherwise assume the rest is written by myself.

As with all tutorials, USE AT YOUR OWN RISK. I assume no responsibility for any loss or damages that may occur as a result of using the following tutorials. Exercise common sense and always use Best Practices to ensure your work is properly backed up before you make any modifications.

The following Tutorials apply to RTCW and its MODS, like the WildWest.

Accums
Areaportals
Bumpmapping
Compiling, How To
Console, Useful Commands
Corona's, Using
EasyGen Tutorial 1
EasyGen Tutorial 2
Elevators, Multi-Floor
Fog Maps, Max Vis, No Hom
Hints, Removing Icons from Entities
Lightning Bolts
Models, Useful Info
Pitch, Yaw and Angle
Player Dimensions
Portals and Blocksizes
ROQ Videos
Scripting Moving Entities
Sparklies, bad
Staff Car Model Fix
Tags on Models
Waterfalls
Waterfogvars, Fogvar, Skyfogvars
Accums

 

Tutorial and Example Map by: shLep

From the scripting definitions doc:

Accum is used for 'what if' statements. Accums store integers which are used to trigger scripts.

There are two things you can do with Accums. One is to give them a numerical value, the other is to use their current value to decide if a script should run.

If you don’t understand scripting at all, you will need to read up on some basic scripting tutorials. However, I can tell you that accums are commonly used for script_movers and/or objectives that need updating (i.e. to prevent them from firing repeatedly). Generally speaking, set your accum to 1 0 at the beginning of your script – which is stating that it is off. Then, in the objective, or script_mover part of your script, you set accum 1 1 – meaning, it is now on. Accums are also needed to end an objective map – to update the game globally. Something like this:

trigger checkgame
{
accum 1 abort_if_not_equal 1
wm_setwinner 1
wait 1000
wm_endround
}

If accum is not set to 1 1, then do not end the match!

There IS more to be aware of when working with accums, especially when you get into complex elevator scripts or other scripted movers. But generally speaking, the accums you'll see in the mp_beach, and mp_base scripts will cover most of what you need. I also would add a word of caution: accums are not always needed, so before you go building your script, riddled with hasty accum calls to the engine, be sure they are needed first! (i.e. try running your map without one)

Example Accum Tutorial Map (WildWest)

Areaportals

 

Original Tutorial by: Tunnelram
Example Map by: shLep

Areaportals are used in a few rare scenarios to increase map performance (i.e. higher framerates). They do this by essentially preventing any part of the map outside the areaportal from being drawn (from the players point of view). Cool right?! Sadly however, it does have it's limitations. And that is what I will primarily focus on here, as most people fail to get them to work period.

  1. Must go inside func_door and func_door_rotating entities to work.
  2. Must not touch the void.
  3. Must be used in a contained room.

This means if you have four solid walls; with one door, and that door has an areaportal, then you shouldn't have a problem. However if you add a window to the room then it wouldn't be contained any longer, and the areaportal won't be sealing the room and won't work in the process.

I'm sure you're wondering whether or not they can be used in entities other than func_door and func_door_rotating. As far as I know they can't. It seems that other entities such as func_explosive and script_movers aren't able to turn the areaportal OFF.

In the end, areaportals can only be used in a few scenarios. I haven’t used them often for the same reasons Tunnleram has cited… Multiplayer is typically better without func_doors to begin with. And the few real doors that you might have in a map, probably aren’t contained anyways…

Example Areaportal Tutorial Map (WildWest)

Bumpmapping

 

Originally Posted By: Ydnar, Omnix, demospawn, chavo one & shadowspawn

All you have to do is take an image (TGA works best) that is a "standard" RGB encoded normalmap, and add the following to your shader:

q3map_normalimage path/to/image.tga

It will be spread across the surface with the same mapping as the surface's texture. For high-resolution lightmaps, I'd recommend using a fine-detail normalmap, and for lightmapped terrain, use a large, blurry normalmap.

This grayscale heightmap: Generates
Grayscale heightmap Bumpmap image

An example shader:

textures/rad/conc_1
{
q3map_normalimage textures/rad/normal1.tga

{
map $lightmap
}
{
map textures/rad/conc_1.tga
blendFunc GL_DST_COLOR GL_ZERO
}
}

Note: This requires a Photoshop plug-in called normalmapfilter. Your shader is going to be a q3map_normalimage used to display the texture properly. You can get the plug in here / here.

Note: If you are using Photoshop 7, you will need this Photoshop 7 Targa fix – Download here. As well, the Photoshop 7.0.1 update contains all functionality included in this revised Targa plug-in, so check what version of PS you are running first. This is important because having the correct Targa plug-in will allow you to create alpha channels, which are needed to create Bumpmapped textures.

  1. Make your texture and name it brick_wall_base.tga
    Save it. No alpha channel is need for this pass and this image can be a .jpg, but I wouldn't.
  2. Take brick_wall_base and use the filter "photocopy" to make it a stark grayscale image…
    Photocopy gives very few shades of gray so you get a well defined grayscale image.
    Select the black portions of the image and make that your alpha channel.
  3. Select all 4 channels (RGB and Alpha) – make sure they are all selected – and open the NVIDIA bumpmap filter.
    You should receive no errors… if your alpha isn't there it will give an error stating so.
    In the NVIDIA filter play with the different settings but these are best:

     

    • Height generation of 5X5 with a scale of 15 (the higher the scale the deeper the bump).
    • Height source of either depending on how the image/alpha was created but both works.
    • Alpha field of height
  4. Save the image as brick_wall_bump.tga with 32 bit.
    Image size is important so make sure it is large enough to get a well defined image.
  5. Your textures shader has to be told to use the Bumpmap image. It should look like this:

textures/mymap/brick_wall
{
qer_editorimage textures/mymap/brick_wall.tga
q3map_lightmapsamplesize 1x1
q3map_normalimage textures/mymap/brick_wall_bump.tga
{
map $lightmap
}

Example Bumpmap Tutorial Map

Compiling, How To

 

By: shLep

BSP Stage – The BSP stage is Required. You can think of this stage as the wrapper in which your compile will be held and ultimately outputted to a .bsp file. Typically, the only switches used in this stage are -meta, and -patchmeta – which will greatly optimize and speed up your overall compile. In fact, using these switches, you will not need to use any other VIS stage switches.

VIS Stage – The VIS stage is often only used for final compiles, and it's switches have largely become outdated. This stage of a compile creates a BSP Leaf Node tree, which is essentially an index of every leaf (or portal) in your map. Portals are created from numerous sources, the most common are: _blocksize, arrangement of structural vs. detail brushes, and any usage of Hint Brushes. Based on all of these factors, your leaf Node Tree is created and it calculates what is drawn from any given point in a map, but more importantly, it calculates what is NOT drawn from any given point in a map. When we are speaking in these terms, we are really dancing around the topic of Map Optimization.

Optimizing a map for an efficient VIS stage should be the goal of any mapper. If done properly it always translates to lower R_speeds (High Framerate), and a typically smaller .bsp file. Map Optimizing is a large subject and one I will have to expand on later. For now, I'll add that the only useful VIS switch is -saveprt. Saveprt allows you to import the compiled leaf nodes into GTKRadiant's Portal Viewer, thus allowing you to optimize or otherwise troubleshoot any low Framerate issues your map may have.

Light Stage – Without this optional stage, your map will be fullbright with zero shadows and contrast. As the light stage can take awhile, this is ideal for testing purposes, however a final compile should ALWAYS have a Light stage. This final stage has a couple dozen switches available (many of which are now legacy), but generally speaking I typically use a half dozen or so. Because there are so many switches in the Light Stage, I will only explain the ones I use:

  • -dark – Dark Lightmap/Brush Seams – Unreal-ish.
  • -dirt – Dirtmapping and ambient occlusion.
  • -fast – This enables light envelopes for area lights and enables light culling. With some maps using it could speed up light calculations by 50 times or more. This is not a hack for light or in any way related to fast VIS, it was simply named fast because its easier to type. This switch automatically enables -fastbounce -fastgrid and -fast.
  • -patchshadows – This enables the casting of shadows by patches.
  • -bounce – Integer. This enables radiosity calculation. It will re-diffuse the light emitted onto a surface x times. In addition it will write out the bsp file after every pass so it can be canceled without loss.
  • -compensate – Float. For descaling lightmap/vertex/grid.
  • -gamma – Float. Sets lightmap/vertex gamma value for more realistic lighting instead of using a high _ambient/_minlight. Default is 1.0 (linear ramp). Good values are between 1.5 and 2.2.
  • -samples – Integer. This sets the sample size, different and more efficient than -super.

Note: These definitions come directly from Q3Map2Build by DLB.

Whether you are compiling your map within GTKRadiant, or an external application/process such as Q3Map2Build, you SHOULD be using q3map2.exe by ydnar, a heavily modified version of the original q3map.exe. Q3map2 offers a wide array of switches to utilize. You will want to investigate these further as you move your map closer to a final release. In the meantime, here are the 2 most common set of compile switches that I use.

Testing Compile:

bsp -meta -patchmeta -vis -saveprt -light -fast -patchshadows

Final Compile:

-bsp -meta -patchmeta -vis -light -dark -dirty -fast -patchshadows -bounce 4 -compensate 4 -gamma 1.8 -samples 3

Further Reading 1

Further Reading 2

Console, Useful Commands

 

The following commands are essential for troubleshooting a map. These console commands are a part of the necessary set of tools mappers use to produce quality maps. Learn them, use them, live them.

  • r_lightmap 0/1 – strips shader layers and only draws lightmap – can be useful for seeing where you have lighting errors or just not enough light being cast.
  • r_showtris 0/1 – draws a wireframe version of all visible brushes – very useful for finding T Junctions and other brush errors.
  • r_speeds 0/1 – repeatedly echoes a few performance related stats to the console until you turn it off – the most important one being the Tris value at the end.
  • r_lockpvs 0/1 – locks your visibility at your current location, enabling you to /noclip around the map to get a better idea of what you can actually see from that position.
  • r_drawworld 0/1 – can be useful if you have entity problems – turns off the world, leaving the game entities (doors, func_explosive, etc).
  • r_drawentities 0/1 – opposite of above – may help finding vis problems.
  • r_novis 0/1 – turns off vising, letting you see the entire map.
  • r_clear 0/1 – setting this to 1 clears the frame buffer each frame, leaving a pink background which can be useful for finding brush errors or cracks in surfaces.
  • g_synchronousClients 1 – required for recording non-choppy demos.
  • cl_avidemo 15 (or 30) – number of frames outputted per second.
  • demo demoname (including the .dm_60 extension)
  • cl_wavefilerecord 1- enables recording audio during a demo.

Further Reading 1

Corona's, Using

 

Original Post by: shLep & demonspawn

First of all, coronas like most entities can be triggered on and off via script. This needless to say is neat for any effects you may want to trigger.

An example: A factory that when destroyed activates a few coronas placed near a few light textures (the textures themselves have no light property). This way the texture produces a nice glowing effect, dynamically based on event in the game. Furthermore, using func_static, you can swap out “off” textures with “on” textures, to further enhance this effect.

Script Example

trigger objective2
{
// -factory mainframe blown up
wm_set_objective_status 2 1
wm_announce "The Factory Mainframe Has Been Destroyed!!!"

// turn on the emergency light coronas. Red
alertentity obj2_corona_lights
trigger game_manager checkgame
}

Coronas can move like any other script_mover, so treat them exactly like one. Assign the targetname to the corona, and make some path_corner's, script it, and your good to go! Lights for moving vehicles! Yay!

Example Coronas Tutorial Map

EasyGen Tutorial 1 – Quick and Simple EasyGen

 

Tutorial by: demonspawn

Select the “base” option and you will now have the ability to adjust the “base noise”, “base smooth” and “base scale” with a value between “0” and “2”

Crank the base scale up to 2 and see what you have. A good judge to see the actual height of your terrain is if you have the “draw axis” check box checked then there will be a red and green line across the terrain. At the center of the map will be a red box. This box is the height of a character in RTCW. You now have a pretty good idea how your terrain will look in you map.

If you find that you just don’t have the exact shape in any particular area of your terrain you can adjust individual vertices by doing the following:

To move your camera view use the following key commands.

If you wish to move several vertices at once, change the “modifier” to “LEVEL” (either circle diamond or square)

  1. Create an 8 bit texture that is 33 X 33 pixels in size. Give it a slight blur to give the terrain a nice slope. Save the texture into your (RTCW/main) folder [as a .bmp].
  2. Open up EasyGen and go to File/import. In the pop-up screen go to browse and get your .bmp from the RTCW/main folder. Leave the terrain height at 256 as this gives you a great starting. You can increase or decrease this value but its easier to adjust it after you have the height map imported.
  3. You will now have a grayscale terrain that has a dimension of 32 X 32 as shown to you by the values in the “GRID” tab. Other information available will be the total widths, division widths and max height of the terrain. All these values can be adjusted, but I wouldn’t play with them until you have a better understanding because they can greatly increase the size of your terrain – which will in turn increase the amount of poly’s in your map, which will increase your compile times!
  4. The first thing to do is select the “frame triangles” check box located across the top of EasyGen. (frame none, frame quads, frame triangles) this way you can see every polygon that makes up your terrain. Select the “MODIFIER” tab. In here you can adjust every vertices in your newly created terrain. The first part is an entry field with the word “none” in it and a arrow select scroll button at the end of it. Click the arrow and you’ll see two main options “SMOOTH” and “BASE” with sub-options like “CONE” “COSTOM” “HILL” etc…

    • Base noise will add a noise filter to the entire terrain. Noise is basically bumps on your terrains surface.
    • Base smooth will smoothen out the entire terrain.
    • Base scale will allow you to adjust the highs and lows of your terrain surface.
    • Change the “modifier” setting back to “none” and use the following key commands to adjust the height of any individual vertices.
    • Shift + Ctrl and left click on the verticy to raise or lower it. It is best to be viewing at your terrain from the side or a slight angle.
    • Left click to change the pitch and rotation of your camera.
    • Right click to change the depth or distance of your camera from the terrain.
    • Left + Right click to change the height of your camera.
    • Shift + Right button changes the size of the effected area.
    • Ctrl + Right changes the height of the effected area.
    • Ctrl + Left changes the location of the effected area.

These key commands also work for the other modifiers that are available. Try them out to see what they do… but in general the ones I have explained will allow you to achieve any shape terrain that you want.

Applying Textures

Select the “ALPHAMAP” tab, you will notice that your nice grayscale terrain has now changed to black, not a problem, we’ll fix that in this step.
First you need to tell EasyGen where to get your textures from. To do this you need to select the “textures” command and then select the “add folder…” option. A pop-up screen will appear, you should already have a folder made up in your RTCW directory structure. If you’ve un-packed the PK3 files then there are several folders already created for you (terrain, rock etc..). Its easiest, for now, to select only one directory but several can be chosen.

You will now notice at the bottom of the “alphamap” command tab, bitmap images of the texture directory you’ve chosen. Make sure all your textures are the same size (256 X 256 is a good size) as when they are tiled across your terrain. Their tiling can all be increased or decreased and it will make for even tiling.

There will be a series of black squares (16 X 16) across the top of the “alphamap” command tab. These will be your material choices. Although the materials won’t show-up when you export your terrain they will give you a good indication as to whet the texture you have associated with them will be. (Ex green material for a “grass” texture) I recommend that you choose only 3 textures for your map, when you get to understand EasyGen better there are ways to get more (I have 5 on my Operation Evil Eye terrain)

Sub-step #1

  • Select the “rendering: texture” check box across the top of EasyGen (rendering: flat, rendering: alphamap, rendering: texture). This will show you the textures as they are applied to you terrain.
  • Select the upper left black box (box number 1), a pop-up menu will appear, select a color that you want the material to be (green). Then select the texture that you want associated with that material (grass). You will then see the entire terrain covered in grass.
  • The textures tiling can be adjusted by hitting the “+” and “-“ keys to increase or decrease the tiled effect. When you get a grass that your happy with then add the cliffs you want.

Sub-step #2

  • Select the second black box on the top left. Give it a “brown” material and select a cliff texture.
  • Shift + Ctrl and a left click will apply the cliff textures. Spray them on where you want. You would probably want them on the steep canyon sides, but their your cliffs so do what you want.
  • A neat little tool in EasyGen is the “draw steep triangles” button across the top of the tool bar. This will color the areas of your map yellow that are too steep for your character to walk up when the terrain is brought into the game (This could act as a guide for spraying your cliff on).

Sub-step #3

IMPORTANT

  • Select the third box from the top left. Give it a gray material and select the rock texture.
  • Shift + Ctrl and a left click will apply the rock texture to the bottom of your pond (or what ever).
  • You may notice that certain poly’s go a dark shaded color. This means that you have applied 3 textures to the same poly. This is bad, your terrain WILL NOT export properly. There is a limit of 2 textures per poly, but there is a solution to this, which is something that you shouldn’t try unless your comfortable with EasyGen and have a excellent understanding of what you want your terrain to accomplish for you. I will explain this in “draw: excluded triangles” step below.

So now you have the basics of a terrain for your map. The next step will explain how to import prefabs and how to create holes in your terrain to accommodate buildings and tunnels for your map.

Importing Prefabs

If you have a specific build layout that needs to work in unison with your terrain. (i.e. a road that leads into a underground garage, or a overhead walkway that leads to a cave entrance) Then you can easily import these objects into EasyGen and make sure that your ground is ready for them when you export your terrain. Simply select the objects in your map and make them into a prefab.

This will make a prefab of the group of brushes for you to select and import into your map or in this case into EasyGen. The cool thing about this is it will come into EasyGen the same distance away from the center origin of your map as it was saved from allowing you to bring in a template of your map. You may be saying, “I don’t have any of the buildings yet? How is this going to help me?”. I will explain the benefits in a moment.

These “pink” poly’s WILL NOT be exported with the terrain leaving holes in your terrain when you see it in Radiant. This will also remove the “shaded 3 texture problem” described above. This won’t seem to useful until you know where you want your holes in your terrain. If you apply your textures with this ability in mind you can maximize your terrain texturing ability. (Think about it, you’ll be surprised when you know what your doing with it, remember I have 5 textures in my map Operation Evil Eye)

  1. Select all the objects in Radiant and make them a func_group.

    • Then go to “edit” and select “save selection as prefab” and save it into your prefab directory.
    • When you have these buildings in EasyGen you can adjust the terrain (using the commands I have explained above) to line-up the terrain with the buildings. When everything is adjusted to your liking do the following.
  2. Change to the “modifier” command tab and select the “draw: excluded triangles” check box across the top of EasyGen (it’s a pink box)

    • Shift + Left click to highlight the terrain poly’s that you want to remove.
    • Ctrl + Left click will change the ploy’s split direction (try it and you’ll see what I mean) to get an accurate poly removal selection.
    • Save your EGN file into your RTCW/main directory.

EasyGen Tutorial image

Easy Export

The only things you need to change:

  • – Check “Thin Mesh” makes the terrain 8 units thick.
  • – Uncheck “include models” you don’t want to export your prefabs.
  • – Check “insert into an existing map” but make sure you’ve already made the skybox and saved the map with the same name as the terrain your creating.
  • – You will be prompted to select the map. It will then export.
  • – Done.

Your don’t need to change the metashader’s name or the alphashaders name if you’ve saved your EGN file in the RTCW/main and have selected textures from the RTCW/main/textures directory, they should have the same name as your map.

Written by Beau (demonspawn) Sutton.
Look for this terrain tutorial in action when I release my first map Operation Evil Eye.
E-mail me if you have any questions at demonspawn@shaw.ca

EasyGen Tutorial 2 – A Beach Terrain Example

 

Tutorial By: TanyaCheex

  • Open Photoshop and select new from the file menu or CTRL+N
  • Set the width and height to 1025 pixels, RGB color and white background

easygen tutorial image

  • Next set the foreground color to 30% grey by picking it in the navigator window swatches

easygen tutorial image

  • Switch foreground and background colors in the tools window and set the new foreground to 70% grey then switch the foreground and background colors again.

easygen tutorial image

  • Now in the filter menu select render/clouds.

easygen tutorial image

  • Set the feather to 20 px.

easygen tutorial image

  • Pick the lasso tool and draw out something (I am going to make the borders)

easygen tutorial image

  • In the menu image/adjust/brightness, contrast set brightness to around 84 and contrast to around 14. This will make some nice hills too steep to pass.

easygen tutorial image

  • Lasso an area for the sea bed and darken it, this time set the contrast to around 75 and it will smooth out the area nice.
  • Select an area around the top of the picture to raise/brighten the same way as you did the sea bed area but do not brighten more than 25 so you keep it lower than the border hills.

easygen tutorial image

NOTE: You can lower the contrast to make it smoother. Make sure you save the picture as it is so you can edit it later if need be.

  • Select the menu filter/blur/gaussian blur, make the radius around 4-5 and apply it.
  • Select the menu image/mode/greyscale and click ok to discard color information when asked.
  • Select the menu image/image size and set to 64×64 pixels.
  • Select the menu file/save as and save it as mybeach.bmp file format windows, color depth 8 bit.

EasyGen

On starting you are asked to set the preferences:

  • The work mod is your main folder
  • Bitmaps I set to c:\program files\wolf\main\textures\terrain
  • Import folders bitmaps I set to c:\program files\wolf\main\textures\terrain
  • Import a bitmap, when asked set the grid height to 2048 then open the height map you just made.
  • In the menu view select texture and + no frame.
  • Click the alphamap button and select the top left palette square, pick a color.
  • Then select the menu Textures/add folder.
  • Pick the terrain folder and click ok.
  • Pick a texture out of the window, click in the 3d window then hit the number pad + key 4 times to scale the texture to avoid the tile effect.
  • Now pick the next palette square along to the right, a new color, and the next texture you want to use say for the hills.
  • Hold shift and ctrl and left click and drag to paint on the texture onto the terrain.

NOTE: Each face can only have 2 textures on it, when you add a third it will turn black to show that there is three textures applied to it, you must paint over the black ones. It gets real annoying sometimes 🙂

When you have finished painting on the textures:

  • Click the exp map button.
  • Save the alphamap where you want (I use the default paths and use the same name as the map and heightmap so I don't get confused).
  • The metashader is saved to the scripts folder (I called it mybeach.shader).
  • The metashader name is mybeach / terrain (mybeach is the only part I change).

easygen tutorial image

Any terrain adjustment I do by the heightmap, not in Easygen or Radiant.
All done.

Elevators, Multi-Floor

 

Posted By: Paposo

To create a multi floor elevator, you can set a single variable such as accum 1. You use bitset with accum 1. Each bit is a floor. So bit 1 of accum 1 is equal to floor 1. Bit 2 is floor 2 etc. That way you can determine which floor the elevator is on.

So if the elevator is on floor 3 say "accum 1 bitset 3". This sets the bit at position 3 to "true" for the variable accum 1. When the elevator leaves floor 3 you say "accum 1 bitreset 3" This now clears the bit at position 3 so it is now "false". Using this 1 variable you are now able to determine which floor an elevator is on.

Now to determine what floor the door should open on, for instance, you would write a series of functions: trigger floor1 open, trigger floor2 open, etc. At each trigger the first line is now "accum 1 abort_if_not_bitset x" where x is equal to the floor the function is set for. So, if your function is for the doors opening on the 9th floor you would write as the first line "accum 1 abort_if_not_bitset 9".

This allows you to create a single variable which controls all the elevator functions without writing a bunch of scripts for each button. It also avoids scripting conflicts where people are pushing the same buttons simultaneously or such.

Example Elevator Tutorial Map

Further Reading 1

Fog Maps, Max Vis, No Hom

 

Posted By: ydnar

Added "_foghull" worldspawn key. Use in conjunction with "_farplanedist" to set up fogged maps with max visibility distance and no HOM (Hall of Mirrors). Note this will generate larger visdata on certain maps. This is because the BSP is split on BLOCKSIZE in Z as well as X and Y. This is to make the far plane culling more effective.

An Example Fog Shader:

textures/shaderlab_foghull/fog_black
{
qer_trans 0.75

surfaceparm nolightmap
surfaceparm nonsolid
surfaceparm noimpact
surfaceparm trans
surfaceparm fog // !!FOG!!

fogparms ( 0.0 0.0
}

Example Fog Tutorial Map

Further Reading 1

Hints, Removing Icons from Entities

 

Posted By: Tunnelram

In most entities you can set this:

  • key: cursorhint
  • value: hint_none

You can also set the cursorhint to whatever you want. You can find the listing of them all in the func_invisible_user entity. I like to use the hint_none on things like windows and boards that I want to be breakable, but I don't want the player to realize it. It makes things a lot more realistic.

Example Removing Hint Icons Tutorial Map

Further Reading 1

Lightning Bolts

 

Posted By: DeMoNeYe

The original link to this tutorial is now dead. If a duplicate of the original can't be located I will create another in its place.

Example Lightning Bolt Tutorial Map

Further Reading 1

Models, Useful Info

 

Posted By: demonspawn and ydnar

Clip Models

To Fully Clip your Models, Highlight the model and set the following:

  • key: spawnflags
  • value: 2

This makes the model fully clipped, so you don’t have to spend all that time with clip brushes, clipping off models. However, I wouldn’t use this on overly complicated models as intense geometry will bog down the engine and adversely affect your map.

Entities do not cast shadows (including models)

Entities with "model2" models will never receive shadows because they are only referenced in-game, hence "rgbGen lightingDiffuse." This means they use the lightgrid to determine their coarse ambient + directed illumination. You should also remove the lightmap stage from the first shader. Lightmaps do not apply to MD3 models, especially dynamic (model2) models. Also, add "surfaceparm pointlight" or "nolightmap" to all of your shaders.

Further Reading 1

Pitch, Yaw and Angle

 

Posted By: shLep

In scripting you sometimes need to know the faceangles of a script_mover so the object can turn or rotate around any axis. In RtCW, the Yaw, Pitch, and Roll are known as faceangles:

  • Yaw = Z axis
  • Pitch = X axis
  • Roll = Y axis

Example Faceangles Tutorial Map

Further Reading 1

Player Dimensions

 

Posted By: shLep

  • Player height = 73 map units.
  • Player width = 37 map units.
  • Min crawl height = 49 map units.
  • Max jump height = 62 units
  • Max step height = 17 units

Also, the doors in mp_beach are 112h x 64w x 4d – so it might be a good idea to stick to that to get the correct sense of scale.

Example Player Dimensions Tutorial Map

Further Reading 1

Portals and Blocksizes

 

Tutorial By: B0ltyB0y

The original tutorial link to this is dead. If I cannot locate a duplicate version I will create a new tutorial in its place. In the meantime, try checking out the Further Reading below.

Further Reading 1 (
archive)

ROQ Video and In Game Videos

 

Tutorial By: Hewster

The original link to this ROQ Creation Tutorial is now dead. Until I find a duplicate version, you can attempt to use the original .roq utility released by id software here.

Additionally, you can use the following to play a .roq movie inside a map via a custom texture/shader set:

textures/mytextures/my_roq
{
qer_editorimage textures/mytextures/mytexture.tga
{
videomap video/my_roq.roq

  • First you make a texture; I used black (64×64).
  • Stick it in textures/my_textures.
  • Then make a shader for it, stick it in scripts…
  • Get or make a .roq. Put it in the videos folder.
  • Apply your texture to a brush face.
  • Compile, and test it out!

Note: Be sure to include the texture folder for the final .pk3

And while we're talking about in game videos or movies, philby added "I would have used a flickering texture for the effect. Like this animation:"

textures/redoak/philby/tv1
{
qer_editorimage textures/philby/tv1.tga
{
animMap 4 textures/philby/tv1.tga textures/philby/tv2.tga textures/philby/tv3.tga
blendFunc Gl_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
rgbgen identify
}
}

As a final note, you can only have 1 .roq per map. You CAN play 1 .roq video both in the objective overview screen, and “in-game” at the same time, but indeed through my own tests, only 1 given .roq to a map regardless of their subsequent name /folder convention.

Example ROQ Videos Tutorial Map

Further Reading 1

Scripting Moving Entities

 

Posted By: Tram Design Members

I was in search of a clean approach to scripting out a series of detailed events in my map, namely Aeroplanes that fly, attack, and explode in to buildings – causing further flamed, smoky structural carnage. And yes, all of this with a sound effects track that lined up. I believe it was ultimately Demoneye who came up with the following script, but I could be wrong:

///Moving scripted stuff goes here...............................
flying //script_mover **flying plane
{
spawn
{
wait 800
trigger flying fly
}

trigger fly
{
gotomarker patha 300 wait // flying
faceangles 0 200 0 gototime
gotomarker pathb 300 wait // impact area -final
faceangles 0 200 0 gototime
trigger crashed debris
}
}
crashed // spawns script_mover crashed plane
{
spawn
{
}
trigger debris
{
alertentity crashed // triggers smoke
alertentity kill_flying // remove original script_mover plane, via target_kill
faceangles 110 150 120 1000 //final position/angle of crashed script_mover
}
}

Crashed is highlighted because it is worth note. The crashed plane script_mover is labeled crashed within GTK. In addition, so are the effects entities, such as the smoke and debris. This is one of the main things Demoneye impressed on me… Entities can have the same targetname or scriptname if they are indeed to be fired simultaneously. It helps cut down on some confusion… Play around with it, you’ll see what I mean.

script_movers can trigger more script_movers within its own script. And since it is then put on a timeline, events and other things can be arranged through uses of func_static’s, target_smoke and target_effects, etc… They can be triggered from a func_explosive in game, or from another part of the script, or simply on a timer as the one above is. For more details, please see the example map below.

Example Scripting script_movers Tutorial Map

Further Reading 1

Sparklies, Bad

 

Posted By: shLep

The original notes I had on this subject are missing the pictures, and without them the words fail to fill in the gaps. Until I can find the original tutorial or one similar, please see the further reading below.

Further Reading 1

Staff Car Model Fix

 

Posted By: DeMoNeYe

All you've got to do is copy mercedes_1.tga to mercedes_1v.tga and use staff_car_v.md3, and put a nice repeating glass texture into glass2.tga to get a working windscreen. All in models/mapobjects/vehicles…

Example Staff Car Tutorial Map

Tags on Models

 

Posted By: nib and DeMoNeYe

The models have "tags" built into them and you attach the secondary models to these "tags". For example, in a truck you might have 4 tags, one for each wheel (left_front, right_front, left_rear, right_rear). Then, with your tire model, you would use the targetname of "left front" and when the game ran, it would "attach" the tire model's origin to the truck model where the "left_front" tag was.

Basically, you have to just know what the tags are and, moreover, unless you make your own model, you have no control over where the tags are located. A good example I've got is putting some small lantern models (models/mapobjects/light/lantern.md3) that I want to sit on a rotating railway turntable script_mover.

I have a "target" of "turntable" on the misc_model entity, and a "targetname" of "turntable" on the script_mover. The models are now attached to the script_mover. They will stay on the script_mover in the same position as you place them relative to the origin of the script_mover.

Example Model Tags Tutorial Map

Further Reading 1

Waterfalls

 

Posted By: demonspawn and shLep

The downwards water flow is created by adjusting the "tcmod scroll" and the foam is adjusted by a combination of the lake shaders chop and the foam shaders chop or "deformVertexes." The texture for the foam has a wave displacement built into it.

This is a rather big subject as it touches on many facets of mapping. Will the waterfall be accessible by a player? If so, shouldn't it move the player accordingly? Further, to create a nicely shaped waterfall, shouldn't the mesh be made from a model? Or will a patchmesh suffice? What about realistic looking spray/mist at the base of the waterfall? Can you use a waterfall in a map that already has fog? Due to all of these questions and more, I will be creating a waterfall tutorial map from scratch. In the meantime, try the further reading below.

Example Waterfall Tutorial Map

Further Reading 1

Waterfogvars, Fogvar, Skyfogvar

 

Posted By: demonspawn, omnix and rummie

  • Waterfog is more conducive to how a fog could add to the underwater fogging effect. More of an area fog.
  • Skyfogvar would allow for patches of fog to move through the scene.

Fogvar represents a fog that you would walk through; it just covers the ground and can/will disperse when walked through. Remember that fogs are calculated by a single direction, or the direction which it is entered. Some of this may be fact… then again maybe my guess is a bit off.

The skyfogvars seem to be RTCW related and seems to not work like the waterfogvars…. I am guessing this is because the q3map does not support it. You can change it. Here is a sample fog I did that will fog the whole level.

textures/omnix_fogsky/awsome_fog
{
qer_editorimage textures/skies/sky_m01dmcmp
surfaceparm noimpact
surfaceparm nolightmap
surfaceparm sky
q3map_globaltexture
q3map_lightsubdivide 1024
q3map_sun 0.274632 0.274632 0.358662 25 325 35
q3map_surfacelight 90
skyparms full 200 -
fogvars ( .30 .31 .39 ) 1500
{
map textures/skies/sky_m01dmcmp.tga
blendfunc GL_ONE GL_ONE
tcMod scale 12.0 12.0
}
}

In the following example, the numbers in brackets are the RGB values of the fog or the color. I believe that the different types of fog represent the different styles of fog.

fogvars ( .16 .15 .15 ) .0005
skyfogvars ( .23 .23 .24 ) .2

RGB values – Red Green Blue. Any color can be defined by these channels. Normally in every application but the Quake 3 engines, these are represented by a number from 0 to 255. In Quake 3 games they are 0 to 1, with 1 being equivalent to 255. The lowest number 0,0,0 is black. The highest number 255,255,255 is white. So let’s say you make a nice color in Photoshop that you want your fog to be tinted. Simply get the RGB color numbers and divide each one by 255 to get your Quake 3 equivalent color.

So if I wanted some freaky green fog based on RGB (112, 239, 118) I would do this:

112/255 = .4392
239/255 = .9372
118/255 = .4627

So the value for my fog is:

fogvars (0.4392, 0.9372, 0.4627) 2500

And that will get you some nasty looking soupy green fog.

Example Waterfogvars, Fogvar and Skyfogvars Tutorial Map

Further Reading 1