Jump to content

"Thunder Storm" Tutorial (UDMF)


Recommended Posts

I just recently figured out how to make random thunder flashes and crashes to take place in any map you wish and since it was easier than I thought, I decided to make this quick tutorial.

 

Some notes first: you're going to need advanced map formats that can support ZDoom features and scripts.

 

Tools needed: 

  • Slade3
  • Ultimate Doom Builder

 

  1. First things first: you need some sound effect! 
    You can get free thunders sound effects anywhere on the internet, the important thing is that it's better that they are short (less than 20 secs I'd say), don't have pause/silence moments (especially at the start) and they are well audible.
    Spoiler

    Ub3f0iU.png

    I got 2, 1 for a hard thunder crash and the other for a smaller one, but you can have even more! You could even go for 1 sound only, but you lose some actual randomness (you could add random pitch shift, but it's not the same thing).
    Quick note: I prefer using .ogg files, but you can aim for .wav and convert them to doom sound format in Slade to bring back that "vintage" sound, but you'll lose quality obviously (don't go for .mp3, it is never the best option). 
     

  2. Now that you got your sounds, it's time to set up the SNDINFO lump.
     

    Spoiler

    LQM6RE6.png

    You can find every info about these type of lumps here.

    Quick explanation: in the first line I set up the randomness, giving a name to the 2 sounds group.
    Then I actually specify the logicalname for both my sounds.
    The last lines are not really necessary, but I wanted to experiment with the attenuation (you'll have to change those values depending of the extension of your map, mapspots position, or just your preference).
     

  3. You can now close Slade and open up your map in UDB.
    You're going to need to add some mapspots* around the map: they serve as sound originators.
     

    Spoiler

    mB2fHXZ.png

    You can place them wherever you want, even inside buildings, and you have to give them a different tag each.
    *= you can use any thing you want, I opted for mapspots cause they're invisible, immaterial and well recognizable.
     

  4. Now the magic!
    This is the script I'm using and it works perfectly 
     

    Spoiler

    PsJ77MW.png

    What it does is simple: when a player enters the map, randomly every 1 to 10 seconds, it plays 1 of the 2 thunder sound I set in 1 of the 5 mapspots in the map at a random chance and it will raise the light levels of the sectors I want by 150 units and change the light to white with a high desaturation value for just an instant, then it restarts.
    Detailed explanation: First action is just for a random delay after each strike.
    PlaySound is used to call the sounds (duh), it requires a thing with a defined tag (from which the sound will originate) and (at least) the str name of the sound.
    Again, I'm using random() to have a random chance for 1 of the 5 spots to be chosen and the str name for the sound it has to be the "sound group" name that we set up in the SNDINFO (if you only have 1 sound, you have to write its logicalname).
    This next Delay is there only because my files don't start straight away with the sound, but have a couple of seconds of pause (that's why I was saying before it's better not to have pauses at the start).
    Here I'm using Light_RaiseByValue, instead of Light_ChangeToValue or others, because I have several sectors with different light levels and I want to keep those light levels.
    I'm raising it by 150 cause the lowest light level I have is 104, and I want to have full brightness everywhere.
    Tip: if you only have 1 sector, or more sectors but with the same light level, I suggest you to go for Light_Fade, cause the effect has a better look.
    Sector_SetColor is "optional": at first I used it cause my sectors had a dark light color specified and fog, resulting in a weak flash when I just changed the light level, then I found out about the desaturation and how much of a difference it makes! (the higher the value, the more black-n-white the map's going to look during the flsh).
    Again, you can use this only if you have the same light color in all the sector affected, or you're going to need more tags.
    The Delay in here determines for how many tics you want your flash to stay.
    Next 2 lines bring back the initial light levels and color.
    Restart is to keep the script running.
     

This is the final result:


That's it, I hope that this will be helpful to someone one day :D

Share this post


Link to post

Note that you can also use the "native" Hexen method:

  1. In the MAPINFO map definition, set the Lightning keyword.
  2. You need two different sky textures, one for the normal sky and another for the sky lit up by thunder. Set them as sky1 and sky2 respectively in MAPINFO.
  3. In SNDINFO, set up a sound named "world/thunder". It can be a random sound, of course.
  4. Your map can have LIGHTNING scripts. They're normal ACS scripts that are automatically executed whenever the map decides to have a lightning strike;

Share this post


Link to post
1 hour ago, Gez said:

Note that you can also use the "native" Hexen method:

  1. In the MAPINFO map definition, set the Lightning keyword.
  2. You need two different sky textures, one for the normal sky and another for the sky lit up by thunder. Set them as sky1 and sky2 respectively in MAPINFO.
  3. In SNDINFO, set up a sound named "world/thunder". It can be a random sound, of course.
  4. Your map can have LIGHTNING scripts. They're normal ACS scripts that are automatically executed whenever the map decides to have a lightning strike;

I know all of that and I discarded it straight away cause the effect is far from being good.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...