How to add weather effects to your world
There are various special effects you can use to change the weather in your game, such as rain and snow. You can also change the brightness of your level, and the sky box to get a different weather effect.
Rain and Snow
In the visual effects tab is a rain effect (or a snow effect). You can place this in the world and it will rain in a radius of approximately 10 metres. Obviously in a large world this will not be suitable, so you can either stamp down a few more fx tiles (which can get resource heavy), or my favoured method, place the rain over your player so it looks like it is everywhere but isn’t. Here is the kode to do that.
Place an effect in your world. In the brain of the rain/snow effect
WHEN [position][=][IWP:your player][above]
WHEN [has power] DO [play sound][Weather Rain Heavy Loop][everywhere] //or whatever sound effect you like
If you need to turn it off (such as when the player is inside, or the rain stops) just add some kode in another brain to power off the fx (use IWP), and power on to turn it back on.
You can also do a similar effect with fog. In fog brain:
To get it at a different height (for example close to the ground)
WHEN DO [vectorvar:fog][y][=][world water level][=][0.25] // play about with the number to get the height of the fog
WHEN DO [position][y][=][fog][y]
WHEN DO [position][x] [=][IWP:player][x]
WHEN DO [position][z][=][IWP:player][z]
Thunder and Lightning
Create a lightbulb. Stable. Intensity:10 Range:100 Color:White. Power off. Put it in the sky. I made it quite big so it was easy to find again.
In lightbulb brain
WHEN [has power] DO
…WHEN [countdown timer][0.25] DO [power off]
In a logic cube (rename it Storm Engine)
WHEN [countdown timer][loop][trigger on start] DO // the length of time you want between flashes
…WHEN DO [toggle][IWP:Lightbulb][has power]
…WHEN DO [play sound][Weather Thunder Rumble][everywhere]
You can add a lightning bolt visual fx to this if you have one. It is quite effective if placed above a building or tree.