Description
Add Thunder and Lightning to Your Game!
Simply drop these lightning entities into your scene and you will immediately have a fully functional thunder storms on your map. Complete with sounds.
Contents:
4 Distant Thunder Sounds
3 Close Lightning Strike Sounds
3 Lightning Chain and Bolt Entities
3 Color Variations (Purple, Blue and Yellow)
What does this system do?
You can place as many lightning entities in your map as you like. Doesn't matter the location as they will randomly spawn around the player at various distances and heights. When a lightning strike happens to occur close to the player a much louder sound effect of a lightning strike will emit. Not just a volume increase, but a distinctly different sound library will be randomly played.
Thunder and lightning sounds will seamlessly blend on top of one another. Creating depth and immersion. No two sounds will cancel out each-other.
Instructions:
Just place the lightning entities on your map and your good to go! As simple as that! No need to apply scripts to anything. The lightning bolts will do their magic on their own.
Advanced Usage:
Spawn Frequency:
In the script Teabone\Weather\Lightning\lightning.lua you can change the frequency at which a bolt will spawn by changing the variable bolt_frequency to any value higher than 400. The default value is 800.
Keep in mind, the more lightning bolt entities you place in your map, the more frequent you see and hear thunder and lightning. If you plan to have many variations in one map, you should consider decreasing the frequency by making the value higher, like 2000 for example.
Warning Prompt
By default a warning prompt of text will appear if you are using thick fog in your level combined with close flog settings. This warning will appear to indicate that the lightning bolts are not visible due to being hidden by the fog layer. You can disable this warning prompt by going into the script and changing the variable warning = 1 to zero.
Editors Lights
By default ambient and surface light flashes are turned off.
In Game Guru if you are using any script that modifies surface and ambient lights, these settings will sometimes alter the maps lighting settings. This is due to an issue which if you exit your map, whatever current state of lighting the map is in , will override the settings of your map. Included in this script is a variable called editorlights which you can disable to prevent this script from modifying the light of the environment when lightning bolts spawn. If you would like the effect in your game for the scene to light up when lightning strikes, but dont want to risk ruining the lightning of your map, you should disable this variable and only enable when you are ready to generate a standalone build of your game. By default editorlights is set to 0. Change the value to 1 to enable light flashes to the environment.
As an extra level of support for allowing you to modify your map's lightning while testing this script, once you press TAB twice to go to change your surface and ambient settings, this script will stop generating lightning and only start up again once you have closed the TAB menus.
If you are having any kinds of distortion at all with your maps lighting as a result of this script, just keep editorlights = 0
For video demonstration purpose, a (free) rain box from the Game Guru forums and a (free) rainy skybox from the store have been used.
Adds great atmosphere to rainy maps.
Your scripting skills are amazing!