Thunderstorms weather effects in Hammer Edition

Introduction, map for testing

All right, in this tutorial I'll do my best to explain how to make thunderstorm effects in Hammer editor.

Here's what we are going to make: - Lightnings - Thunders - Rain - Fog

So let's start. We are going to need some small map (DUH!), so let's make it. Let's create a large brush which will serve as a skybox. Then let's put some ground with walls around it. Inside we'll place some spawn points and a small building - one small room is enough. Map for Testing

Once you are done with that, let's set our skybox. In the map's properties, set skybox to skyday0109. Now apply the changes, and close the properties window. Select light_environment entity, and place it somewhere in your map. Now set the values accordingly:

Ideal Sun Angle 0 12 0 Ideal Sun Pitch -45 Ideal Brightness 175 230 239 65 Ideal Ambience 83 104 130 50

(as you, undoubtedly, know, optimal values for different skyboxes are listed on the Valve Developer wiki: http://developer.valvesoftware.com/wiki/Sky_List ) Light_environment settings

Now we're all set, let's move on and make some lightnings and thunders.

Logic controllers

If you take a closer look on the list of different entities, you'll notice that there's a lot of different logic_ entities. They all serve a certain purpose, but right now we are interested in the following entities:

  • logic_timer, 2 times
  • logic_case

Go ahead, and place them somewhere in your map. Place the following entities somewhere nearby:

  • ambient_generic, 4 entities
  • light

By double-clicking on those entities you can change their properties. Before we do anything else, set names of those entities: - name ambientgeneric entities t1, t2, t3, t4 - name the first logictimer as init, the second one as lightblinking - name logiccase as case - name light as light Entity CLASSES are marked with RED, Names with BLACK

Now that we have this stuff gathered in one place, let me explain how it works (in case you are new to this logic_ stuff).

logictimer is just a timer. In the intervals that we define, this entity can send certain output to other entities, thus triggering certain actions, such as enabling/disabling light entity, making ambientgeneric entity play sound and so on.

logiccase takes input from other entity (like for example logictimer), and based on the input, decides, to which entity it will address it's output (with a value, that we define).

Lightning

How do we make lightning? Well, it's pretty simple. The first timer (named init) is enabled all the time. And in the random intervals between 20 and 40 seconds it will activate another timer (named lightblinking), which is deactivated by default. lightblinking timer will make our light (which has to be pretty bright) blink - simply by activating and disabling our light entity in the random intervals between 0.05 and 0.2 seconds. I hope you get it.

So let's do it. First double-click the light entity. Set some blueish color and make it very very bright - 20,000 will do. Now open the Flags tab, and set Initially dark, so that the light is disabled by default. Setting the light entity

Now double click the light_blinking timer. We want it to activate/deactivate our light entity in the random, yet very small intervals (to make it blink - in case you didn't get it). So put "0.05" into the Minimum Random interval field and "0.2" into the Maximum Random Interval field. Set Use Random Time to "Yes", and Start Disabled to "Yes" (well, we don't want out lightning to flash all the time, right?).

Now switch to the Outputs field. Click Add button. Into the My output named field put "OnTimer" (which means that the action will be performed once the timer is triggered). The target is our light entity, so put "light" into the Targets entities named field. Into the Via this input field put "Toggle" - which will toggle the light. This is it, we are done with this entity. Settings for light_blinking timer

So what do we got? Once we activate light_blinking timer, the light starts blinking. Once we disable it, the light stops blinking. Let's make it happen in a certain intervals. For this you are gonna double-click the init timer. Make sure it is activated by default (Start disabled: No), uses random time (Use Random time: Yes). Set the minimum interval to 20 and the maximum to 40. init logic_timer intervals

Now switch to the Outputs tab. This time we want the target named lightblinking to be activated for 3 seconds. How do we achieve it? First of all, we activate it. Click Add button, put "OnTimer" to the My Output named field, name of our target entity (lightblinking) the the targets field. This time input is "Enable", so put "Enable" into the Via this inputi field. We don't need any delay, it's done.

So how do we turn off the light_blinking timer after 3 seconds? We do the same (so you just press Copy and then Paste), except we change the input to "Disable" and we put "3" into the After delay in seconds of field. init logic_timer outputs

Done? Well guess what, our circuit is buggy. Say second timer (light_blinking) is activated. So it toggles the light entity on/off very often. Now the first timer (init) disables the second timer. Light goes down? Maybe. The point is, the first timer could disable the second timer when the light was on. In this case, the light won't go down before the second timer is activated again.

So we want to make sure the light is turned off. We create the new output. OnTimer, target named light will receive the TurnOff input with the delay of 4 seconds (4, not 3, because we want to perform this check once light_blinking timer has been turned off).

Congratulations, if you've done everything right, the lightning is fully functional now.

Rolls of thunder

Okay, we're almost done here. Let's configure our ambient_generic's first.

Once our mighty init timer goes on, we see the flash of light. Also we want to hear the roll of thunder. And we don't want to hear the same sound each time. This is why we have 4 ambient_generic entities. Thunder & ambient_generic

So let's set them up. Double click the first one, named t1. We have to set the Sound name field. Click "Browse...", and select ambient/atmosphere/thunder1.wav. The volume should probably be 10. Now switch to the Flags tab. Mark "Start silent", "Play everywhere" and "Is NOT looped" flags (I'm getting nervous over wasting my whole day with this tutorial, so this time you won't get any screenshot!). Now do the same to the remaining ambient_generic's, except change thunder1.wav to thunder2.wav/thunder3.wav and thunder4.wav accordingly.

We wanna randomly pick which ambientgeneric will be played once init is triggered, that's why we double click case (logiccase entity, remember?). logic_case entity properties

There's nothing interesting in the Class Info tab, so let's switch to the Outputs tab. Now we are going to use 4 outputs: OnCase1,...,OnCase4. The will be picked randomly by init. All you have to do is to select OnCase1 output, put t1 into the target field, select Play Sound input, that's all. ambientgeneric will stop playing automatically, since it's not looped. Do this for all 4 ambientgenerics (changing numbers accordingly). Once you are done, you should see this: logic_case outputs

Now the last step is to make logiccase entity pick random value once init is triggered. So let's open Outputs flag in the properties of the init logictimer, and add the following output: output name: OnTimer target: case input: PickRandom

That's it. Click apply. As far as I remember, we've done everything to make it work.

Oh noes! You're not a Member!

Want access to cool stuff? As a member you can:

  • Post. Give the submitter your thoughts on this Tutorial.
  • Say Thanks. Show your appreciation by sending the submitter points.
  • Stamp Posts. Let other posters know what you think of their posts.
  • Rate. Give this Tutorial a rating out of 10.
  • Flag. Alert moderators and warn members of a problem with this Tutorial.
  • Vote. Vote the submitter for the Monthly Awards.
  • Subscribe. Get notified when this submitter submits again.

Interested? Register or Login

Comments

None found

Credits

Submitter
Loading...'s Levels
  • P1: Beggar
    Points: 852
  • C1: Member
  • A2: Tenderfoot
    Account Age: 6 months
Loading... (Redistributor)
Original Authors
TheDarkAvenger
Co-Creator

Rating

?/10
Not yet rated.

Additional Info

Genre
Mapping
Difficulty Level
Intermediate

Stats

Post Count
0
ViewCount
239
Date Added
23 days ago
Date Modified
-

Share

Embed Code
Code to use:

More embeddable images

SubFeed