Continued from Page 1...

     When you're done testing, get back into WorldCraft. Let's make a new game, shall we? I call this the "Airstrike mini-Mod"; and I just thought it up out of thin air, and made a few arbitrary decisions about how it should work. Here are the rules I decided on: each bunker should have a button or a switch. When an enemy infiltrates your bunker and hits the button, an airstrike is called in. ONLY the enemy's bunker will close up and provide protection from the airstrike. Everyone outside will die; while the people that survive the strike are rewarded with 5 points. Of course, with a map this tiny; and without weapons - this is going to be too boring and unbalanced for it to be a "real" game. However, it is a good showing of the basic abilities of the game-type entities. So on with the show!

     First things first, we need a button for the enemies to hit! Move your XY view over to the right-hand bunker. Switch your grid spacing to 32. Go to Brush creation mode. Select a button texture like "+0button2". Now, create a brush in the XY view from coordinates (1008, -128) to (1024, -160). In the XZ or YZ views, resize the brush so that it spans Z coordinates (32) to (64). Confirm the brush with the ENTER key. To be a button, we must tie it to the "func_button" entity. So do that, bring up the entity properties box, and set the following:

KEY
VALUE
Angle
0
Sounds
Anything you want.
Lip
4
Delay before reset
30
Master
teammaster0

     The last one is perhaps the most important. This prevents people on the wrong team from setting off the airstrike (how would you like to respawn into your bunker and have to explain to your teammates that you bumped the button on accident?). In any case, switch to Selection mode, and copy this new button entity. Move the XY view back to the left-hand bunker, and paste the button in. Make sure to align it so that in the XY view, it spans coordinates (-512, -96) to (-496, -128). In the Z axis, it should span coordinates (32) to (64). Bring up the entity properties box, and set the following:

KEY
VALUE
Angle
180
Sounds
Anything you want.
Lip
4
Delay before reset
30
Master
teammaster1

     So that's got the buttons that should set off the airstrikes; now its time to start working on the "airstrikes" themselves. Time to stop makin' stuff and PLAN it out first, though. What makes a good, complete airstrike? Well I pondered this for a while; and came up with a list of events that should do the trick:

     This means that we need about 10 things to happen as the result of one event - the button press. Whenever you want one even to trigger many others, you should IMMEDIATELY think "multi_manager". It is the BEST entity for this type of situation. Using the multi_manager is a bit tricky; but we'll get to that in a minute. Also, let's get all the nifty stuff working first, BEFORE we worry about killing the players or awarding points to survivors. So, we'll take the rest of these suckers in order; then link them all together with a multi_manager.

     Leading off the mayhem are the sirens. This should be simple; we just need an "ambient_generic" entity to play a sound, right? In fact, its a bit more complicated than that. We need to turn ON the looping sound of the sirens, and then later on turn the sirens back OFF. We'll worry about turning them on and off when we make the multi_manager; so for now just switch to entity mode and place an entity somewhere in the map. I would suggest that you place it close to the "game_team_master" entities earlier. Might as well keep all of the entities close together, as opposed to scattering them all over the map. Make SURE that this entity doesn't touch or overlap anything else, and confirm its placement. Switch back to selection mode and bring up the entity properties window. Switch the entity class to "ambient_generic" if it wasn't already, and set the following:

KEY
VALUE
Name
siren
Sound
ambience/siren.wav
Flags:
Play everywhere, Start Silent.

     After that comes the doors. Eh, these get complex for reasons I'll show in a little while; so let's skip 'em. Moving on, we come to the Jet sound. This will be another "ambient_generic", so save yourself some work. Select, copy, and paste the "siren" sound entity; and then after aligning it so that it doesn't overlap anything, set the following:

KEY
VALUE
Name
flyby
Sound
ambience/jetflyby1.wav
Flags:
Play everywhere, Start Silent, Is NOT looped.

     What's next? Ah, yes - the screen flash/fade. Switch back to entity mode, and create a new entity. Make sure it doesn't overlap anything; and then bring up the entity properties box. For this, we want an "env_fade" entity. For the keys, set the following:

KEY
VALUE
Name
whitescreen
Duration
3
Hold Fade
0.25
Fade Color
255 255 255
Flags:
Fade From.

     Before moving on, this one may be new to some of you; so let me explain it. Typically it is used for fading out to a solid color; but with the "Fade from" flag selected, we can reverse that. So when the entity is triggered, the player's screen is set to the color in the "Fade color" key (which works just like setting the color of a light), and held there for the number of seconds specified in "Hold fade". Then, for as many seconds as the "duration" sets, the screen will fade back to normal (so the shorter the duration, the faster the fade). NOTE: There's no magical formula I used to come up with those values - I just experimented with the hold and duration keys a bit to get the right "feel".

     Now on to the nitty-gritty; the explosion! I've decided here to make things even more tense, by using the Mortar sound effects... you know, the ones with that screaming "incoming bomb" sound. So we'll actually need TWO entities here, one for the "incoming" sound; and one for the explosion itself. In selection mode, grab the "flyby" entity. Copy and paste it. Align the new entity and bring up the entity properties box. Set the following:

KEY
VALUE
Name
incoming
Sound
weapons/mortar.wav
Flags:
Play everywhere, Start Silent, Is NOT looped.

     Switch back to selection mode and Paste again. Align and set the following in the entity properties box:

KEY
VALUE
Name
explosion
Sound
weapons/mortarhit.wav
Flags:
Play everywhere, Start Silent, Is NOT looped.

     Since we're skipping the effects of the explosion for now, the next item to deal with is the "shake". Luckily, the "env_shake" entity already exists to help us out. It's JOB is to simulate an earthquake-like event; so it's perfect! Switch to entity mode. Place a new entity. Align it, keeping in mind the normal stuff about not overlapping. Then, in the entity properties box make it into an "env_shake" (if it wasn't already before) and set the following:

KEY
VALUE
Name
rumble
Amplitude
6
Duration
3
Jerk/Rumble
50
Flags:
Global shake.

Click here to continue...