Books
in black and white
Main menu
Share a book About us Home
Books
Biology Business Chemistry Computers Culture Economics Fiction Games Guide History Management Mathematical Medicine Mental Fitnes Physics Psychology Scince Sport Technics
Ads

Quake 4 mods for dummies - Guilfoyle E.

Guilfoyle E. Quake 4 mods for dummies - Wiley publishing , 2006. - 411 p.
ISBN-13: 978-0-470-03746-1
Download (direct link): quake4modsfordumm2006.pdf
Previous << 1 .. 73 74 75 76 77 78 < 79 > 80 81 82 83 84 85 .. 129 >> Next

If you don’t have a three-button mouse, you will have to apply the same texture normally, and then adjust the sizing by eye. The previously-textured railing piece was textured by using the Fit button in the Surface Inspector. Using the same method on a brush of unequal size results in different sizing. Therefore, all you can do is adjust it manually using the Surface Inspector shift and scale values until it looks good to you.
For the other half of this split brush, you are going to clip it two more times to round the corners a little bit. This will look more like something that can spin around rather than just a square block that turns.
236 Part IV: Going Beyond the Basics
5. Change your grid size to one size smaller by pressing [ once.
6. Clip the two outer corners so that you have five outer brush faces rather than three.
When you’re done, it should look like Figure 14-18.
Now that you have the shape for your hinge, you need to turn it into a func_mover so that you can rotate it later along with the platform.
7. Select the two brushes at the top that will be rotating as one piece. Then select func_mover from the entity list.
8. Open the Entity tab while this new entity is still selected. Enter a name into the text box next to Key and enter platform_hinge into the text box next to Val. Then press enter.
Giving this mover entity a name allows you to control it. Later, when you write your script, you will be able to call to your entity by name. This is the name that will be used.
That takes care of the hinge, the platform, and the track. Save your map so you don’t lose any of the work up to this point. In the following section, you continue by turning this lift into something your script can control.
To control the lift within the game, you have to turn this lift into something that your script can call to. To call to your platform, you need to name it and in order to name it, you need to turn it into an entity. Because you want to move your entity around, not just any entity will do. You need to turn this group of brushes into a func_mover. As the name implies, a script can move this entity around.
Figure 14-18:
Using the Clipper tool, give it some
shape by cutting off two of the corners.
Controlling your lift
Chapter 14: Scripting Advanced Actions 237
1. Select the four brushes that make up your platform.
Don’t select the track because that is going to stay right where it is.
2. Right-click the 2D window and choose funcOfunc_mover.
This turns your selection into a single entity.
3. Press N to open the Entity tab.
4. Enter name in the Key field and platform in the Val field. Then press Enter.
This step gives your platform a name. Yes, it already had a name, func_ mover_1, but that isn’t an easy name to remember. Because you will need to remember this entity’s name when you write your script later, giving it a better name, platform, is a good idea.
5. Deselect your platform and select the long brush that makes up your track.
6. Turn your track into a func_static. Do this by right-clicking the selected group of brushes in the 2D window and selecting funcO func_static.
As I describe in Chapter 12, to avoid the extra geometry that could slow down the speed of your game play, turning detail brushes into entities will avoid splitting the brushes in your level.
7. Deselect the track when you’re done.
8. Select the two brushes at the top of the track and turn them into a func_mover entity by right-clicking them in the 2D window and selecting funcOfunc_mover.
This group is going to turn with the platform and will be controlled by the script. To control it, you need to name it.
9. Open the Entity tab and rename this entity by entering name in the Key field and platform_hinge in the Val field. Then press Enter.
Next up is creating a trigger for your platform. You need to instruct the game as to when the platform is supposed to move. Or, in this case, you instruct the script on when to run the function that moves the platform. In your the scripting exercise earlier in this chapter, you create a script that runs when the game was started. In the case of this lift, you don’t want the platform to start moving when the game is loaded. Instead, you want to control it by the player’s movement on top of it.
1. Load the Common texture set and select the texture common/ trigmulti.
238 Part IV: Going Beyond the Basics
2. Draw a brush that covers the top of the lift. This time, make the brush 8 units tall, as shown in Figure 14-19.
The idea here is that when your player walks onto it, the platform is triggered to lift the player to the top of the roof. When the platform reaches the top, it pauses for a few seconds before returning to the ground on its own, where the player can again activate the lift if he or she chooses to.
Figure 14-19:
Add a trigger brush on top of the platform so that the player is able to activate it.
3. With your trigger-textured brush still selected, turn it into a trigger_multiple entity.
Previous << 1 .. 73 74 75 76 77 78 < 79 > 80 81 82 83 84 85 .. 129 >> Next