|
|
Line 1: |
Line 1: |
| {{L4D2 level intro menu}}
| |
| = 暴风骤雨战役雷暴实例创建教程 =
| |
|
| |
|
| The thunderstorm effect in the Hard Rain campaign is a very cool effect, and it is actually simpler to get it working than you might think. The information in this article is based on a tutorial, that can be found [http://www.fpsbanana.com/tuts/9901 here]. However, I had to make some changes to get it working. Instead of editting the storm entities instance files yourself as in the tutorial linked above, here is a .zip file containing the already updated files for your convenience.
| |
| <br>
| |
| [https://sites.google.com/site/megafontswebsite/StormEnts.zip StormEnts.zip]
| |
| <br>
| |
| {{note|The updated '''c4m4_storm_ents.vmf''' file in this .zip file has been replaced with storm entities I copied out of a decompiled version of one of the Hard Rain maps. If you use the '''c4m4_storm_ents.vmf''' file that comes with the Authoring Tools, then the skybox gets very glitchy during storms. Using this updated version of '''c4m4_storm_ents.vmf''' fixes that problem and will also give you the movement in the clouds that you see in the Hard Rain campaign. And if you would like the decompiled versions of the L4D2 campaign maps, they can be downloaded from [http://nuclearvelocity.com/barracuda/downloads/left4dead2/mapsrc/l4d2mapsrc_v7.7z here]}}
| |
|
| |
| After downloading the storm_ents.zip file, go into your Left 4 Dead 2 <code>\mapsrc\</code> folder. Create a new folder called <code>\myinstances\</code> or something similar, and unzip the storm_ents.zip file into it. This is to ensure that these files won't get overwritten the next time the L4D2 Authoring Tools get updated.
| |
|
| |
| == 准备工作 ==
| |
|
| |
| First, you need to have a map with a [[3D Skybox]]. Once you have a 3D skybox setup in your map, go into your '''Map Properties''' and set the '''SkyBox Texture Name''' to <code>sky_l4d_c4m4_hdr</code>. This is the skybox texture that Valve used in the Hard Rain campaign.
| |
|
| |
| == 创建雷 ==
| |
|
| |
| We are going to use the func_instance entity to setup the storm, by instancing the storm instance files that you downloaded (in '''StormEnts.Zip''' above). First, go to the center of the playable area of your map. Create a '''func_instance''' entity.
| |
|
| |
| {{note|You may want to place these first two '''func_instance''' entities high above the ground so they're out of the way, as it doesn't really matter where you put them.}}
| |
|
| |
|
| |
| Now set up the following properties on the '''func_instance''' entity:
| |
|
| |
| * Set the '''Fix Up Name''' field to "<code>c4m4_storm_logic</code>"
| |
| * Set the '''VMF Filename''' field to "<code>myinstances/c4m4_storm_logic.vmf</code>" {{note|Change "myinstances" to the folder you unzipped '''StormEnts.zip''' into}}
| |
| * Set the '''Entity Name Fix Up''' field to "None"
| |
|
| |
|
| |
| Next, create a second '''func_instance''' entity somewhere nearby, and setup its properties like this:
| |
|
| |
| * Set the '''Fix Up Name''' field to "<code>c4m4_environment_ents</code>"
| |
| * Set the '''VMF Filename''' field to "<code>myinstances/c4m4_environment_ents.vmf</code>" {{note|Change "myinstances" to the folder you unzipped '''StormEnts.zip''' into}}
| |
| * Set the '''Entity Name Fix Up''' field to "None"
| |
|
| |
|
| |
| For the third and final '''func_instance''' entity, go to the '''sky_camera''' entity in your 3D skybox. Place a '''func_instance''' at about the same place as the '''sky_Camera''' entity and set up its properties like this:
| |
|
| |
| * Set the '''Fix Up Name''' field to "<code>c4m4_storm_ents</code>"
| |
| * Set the '''VMF Filename''' field to "<code>myinstances/c4m4_storm_ents.vmf</code>" {{note|Change "myinstances" to the folder you unzipped '''StormEnts.zip''' into}}
| |
| * Set the '''Entity Name Fix Up''' field to "None"
| |
|
| |
| == 创建暴雨 ==
| |
|
| |
| Now we just need to add the rain into the map. To do this, create a brush that covers your entire playable area, cover it with the '''tools/trigger''' texture, and make this brush a '''func_precipitation''' entity. Set its '''Precipitation Type''' property to "Particle Rain Storm", and set its '''Name''' property to "<code>rain</code>".
| |
|
| |
| {{note|If your rain doesn't show up in-game, you may need to make your '''func_precipitation''' brush taller. A height of 1024 units was suggested in the steam sdk forums, but I don't know how tall the '''func_precipitation''' actually has to be to work.}}
| |
|
| |
| {{note|The '''func_precipiation''' entity automatically detects the presence of buildings, so that it won't rain inside your building. But if you need to block rain in other areas (like under large props), you can use '''func_precipitation_blocker''' entities to do so. To make one, you just make a brush covered with the '''tools/trigger''' texture and make it a '''func_precipitation_blocker''' entity, then move and resize it as needed.}}
| |
|
| |
| Next, we want to keep the rain fog out of our buildings. To do this, create a brush and cover it with the '''tools/fogvolume''' texture. Make this brush a '''fog_volume''' entity. Then move and resize the brush so it covers all of the interior area of your building. Use multiple fog brushes if you have multiple indoor rooms and corridors. Set up your fog_volume entity (or entities) like this:
| |
|
| |
| * Set the '''Fog Name''' field to "<code>foginteriorcontroller</code>"
| |
| * Set the '''Postprocess Name''' field to "<code>fx_settings_interior</code>"
| |
| {{note|When you type these in, they will appear red, but don't worry they will work fine. It's just doing that since we used instances instead of copying and pasting the storm entities into our map.}}
| |
|
| |
|
| |
| Lastly, we just need to add the sound effects for the rain. For this, go to where you placed the first two '''func_instance''' entities. Somewhere nearby, create an '''env_soundscape_triggerable''' entity and set up its properties like this:
| |
|
| |
| * Set the '''Name''' field to "<code>rain_interior</code>"
| |
| * Set the '''Radius''' field to "<code>0</code>"
| |
| * Set the '''Soundscape''' field to "<code>rain.interior.med</code>"
| |
|
| |
| {{note|If you would like some different soundscapes, a list of them can be found here: [[List_of_L4D_2_Soundscapes#soundscapes_campaign4|List of L4D2 Soundscapes]]}}
| |
|
| |
|
| |
| Now create a second '''env_soundscape_triggerable''' entity here and setup its properties like this:
| |
|
| |
| * Set the '''Name''' field to "<code>rain_exterior</code>"
| |
| * Set the '''Radius''' field to "<code>0</code>"
| |
| * Set the '''Soundscape''' field to "<code>rain.water.med</code>"
| |
|
| |
| {{note|If you would like some different soundscapes, a list of them can be found here: [[List_of_L4D_2_Soundscapes#soundscapes_campaign4|List of L4D2 Soundscapes]]}}
| |
|
| |
|
| |
| All that's left to do now, is trigger these rain sounds. For this, go to the entrance of your building.
| |
| {{note|You will need to do this at each entrance to an interior area in your map.}}
| |
| Place a trigger brush covering the entrance on the outside of the doorway. This brush should be covered with the '''tools\trigger''' texture, and make it a '''trigger_soundscape''' entity. Set its '''Soundscape''' field to "<code>rain_exterior</code>".
| |
| <br><br>
| |
| Now place a second trigger brush covering the entrance on the inside of the doorway. This brush should be covered with the '''tools\trigger''' texture, and make it a '''trigger_soundscape''' entity. Set its '''Soundscape''' field to "<code>rain_interior</code>".
| |
| <br><br>
| |
| These two triggers will switch the soundscape when the player enters or exits the doorway. This makes the rain sound different when you are outside, than it does when you are in an interior area. Now, make a copy of the trigger that you placed on the inside of the doorway. Move and resize this copy so that it covers most of the starting room. This way the survivors will spawn inside this trigger, and it will then activate the interior rain soundscape. Otherwise, when the map starts, the player will not hear the rain until they go outside.
| |
|
| |
| == 测试你的雷暴天气 ==
| |
|
| |
| That's it! You should now have a working storm in your map. To test it, you can setup a button and have it target the entity "<code>relay_storm_start</code>" via the input "<code>Trigger</code>".
| |
| {{note|If you do this, the output on your button will appear red in the editor, but don't worry it will work. It's just doing that since we used instances instead of copying and pasting the storm entities into our map.}}
| |
| {{note|If you just sit and wait in your map, it will storm periodically by itself.}}
| |
| <br>
| |
| A second way to test your storm is by opening the console (make sure '''sv_cheats''' is set to "<code>1</code>") and type in the following command:
| |
| <code>
| |
| ent_fire relay_storm_start trigger
| |
| </code>
| |
| <br><br>
| |
| Here is a sample map with the storm working. The button just outside the saferoom door will trigger a storm. The other button further away simply triggers a panic event.
| |
| There is also a ladder near the safe room door, allowing you to get onto the safe room roof.
| |
| <br>
| |
| [https://sites.google.com/site/megafontswebsite/L4D2_StormSampleMap.zip L4D2_StormSampleMap.zip]
| |
| <br><br>
| |
| If you want to tweak this setup, there is a lot you can do. You'll probably want to make copies of the storm instance files to experiment with so you still have the originals from the '''StormEnts.zip''' file (the download link is at the top of this page).
| |
|
| |
| = 参考 =
| |
| * [[func_instance]]
| |
| * [[Sky_camera]]
| |
| * [[env_soundscape_triggerable]]
| |
| * [[trigger_soundscape]]
| |
|
| |
| {{NavBar|L4D2 Level Design/Foot Lockers|L4D2 Level Design|L4D2 Level Design/Scavenge Finale}}
| |
|
| |
| [[Category:Left 4 Dead 2]]
| |
| [[Category:Level Design]]
| |
| [[Category:Skybox]]
| |