Path Corners and Func TrainsThanks to David Hyde for straightening me out on func_timers. No doubt, you've seen a few tutorials on how to make floating crates. Lots of words and no pictures. If you were lucky, the writer threw in a map file so you could figure out the missing information. Here, we're going to make a footbridge that sways in the wind, using the func_train entity. Because I'm sure there's some law that says, "All tutorial web sites must include the floating crate tutorial," we'll also cover that. Floating CratesBefore we get started, grab the map file here. Below is a screenshot showing how I've laid out a crate and four path_corners. The crate is a func_train, with the speed flag set for '5'. Here is a side view of the same setup: As seen in the shot above, the crate is 2/3's submerged in the water. In the game however, it will be submerged only a few inches. Also, we're going to work with the p_c's in a straight line. Later on, we'll place them in a more realistic pattern. Don't forget to connect/target the last p_c back to the first p_c. The second step is to add p_c's between each of the four already in the map. The only difference is that we will modify the height values for each one so the crate appears to be bobbing up and down in the water as it floats. Here's a side view of the additional p_c's: I set my grid to a setting of 2, since I want the crate to bob gently on the surface of the water. Since Q2 doesn't have choppy water, it would be unrealistic to make the crate bob at a grid setting of more than 2. The third step is to round up all those path_corners into a tight, somewhat circular formation. Go to the Top View. Beginning with the first p_c, start dragging them together until they resemble the screenshot below. Go ahead and drag your crate off to the side until you're done arranging the p_c's. The trick is to form the p_c's in such a way, so the crate cycles smoothly from one corner to the next. I formed mine into a rough circle, which will give me smooth loop point. Go ahead and compile your map. If you did everything right, you should have a nicely floating crate, bobbing gently on the water. Making A FootbridgeBefore we get started, grab the map file here. Taking what we learned from the crate lesson, another nice effect can be used with func_trains and path_corners. Here is a top view of a simple foot bridge that will appear to sway in the wind: Top view of footbridge. Notice how the two p_c's on each of the boards are offset by a grid strength of 2. The boards that make the bridge are func_trains, set with a speed of 2. The Start_On flag is set and a direction angle of 270 is specified. Each board is targeted to a path_corner. The two p_c's for each board are targeted to each other. Here's a side view of the footbridge. If you want, you could have a few boards move up and down as they slide back and forth, using a grid movement of '+/- 1'. Remember: move the p_c's, NOT the func_trains. For added effect, find a creaky sound to enhance the bridge's realism. Copyright 1999, by Terry DeLaney. Permission is granted to distribute this file as long as the author receives credit. |