Saturday 5 October 2013

Making Thunder and Lightning

Level Design Mapping Tutorial: Making Thunder and Lighting

This tutorial for HL2 Deathmatch will cover how to make lightning that strikes at random intervals and partially random locations (at least it will appear random when in game).

Note: For best effects, refer to the 'list of skies' in the resources forum to choose a night theme.  Enter sky_day01_09in the 'Map properties' section under 'Maps'.



First start of with a basic open area:



You will need the following entities placed in your map:env_laser name this 'lightning01'logic_timerinfo_target name this 'info_lightning01'light name this 'lightning _flash01'light_environmentambient_generic name this 'thunder01'Now all needed entities are present and named, we will start by associating the env_laser and the info_target.  Select the env_laser and enter info_lighning01 into the target field, and enter 'amound of noise' a value of '20' as shown below:



You will notice if done correctly, a line will be drawn between the two entities, as show in figure 1.  To simulate lightning i would recommend moving the env_laser entity to the top of the map, in the middle, and moving the info_target entity to the bottom, in the middle.Now we will make the thunder.  Select ambient_generic and use the 'browse' function in the 'sound name' field to find an appropriate sound for thunder:



sound file used: ambient/levels/labs/teleport_postblast_thunder1.wavFor the lightning flash, make sure the entitylight is set to 'initially dark' in the 'flags section'.  Set the brightness to 1000.



Now for the good part.  Select the logic_timer entity and go to its properties.  Set 'use random time' to 'Yes' and choose and mininum and maximum trigger period (in seconds).



Go to the Outputs section and add some outputs in the following manner:



Now each time the logic_timer fires it will create a lightning effect, play a thunder sound, and make a flash of light for a split second.PART 2 : Making the lightning flash at random locations.Move the info_target entity into one corner of the map.  Go into the object properties and enter the 'parent' as 'rotator01'.  Create a brush and turn it into afunc_rotating.  Name it 'rotator01'.  Now texture the func_rotating with the tools\nodraw texture, to make it invisible.  Set the 'max rotation speed' to 5 as below.  This will make the lightning appear to strike at different locations, but infact the info_target is just rotating around an area, and the speed is so slow u wont notice it is turning.



Now return to the logic_timer entity as before and edit the properties to make a new output:



Now when the timer fires the rotating object will begin rotating, so when the first lightning bolt strikes it will create random locations.  Of course this means it will always start at the same position, but this serves a purpose if u want the lightning to begin striking at a specified location.  Alternatively, remove the output, and select func_rotator and set to 'start on' in the flags section of object properties.  Now you are done, go test your Half Life 2 map!

Download Map File

No comments:

Post a Comment