HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Creating/Using Weather Effects

01-29-2007, 09:35 PM#1
Ammorth
This might seem like a basic topic, but there are a few things about weather effects that are not as obvious. Hopefully this tutorial will help you to understand more about them.


1) What Are weather effects?
A weather effect is pretty much what it's name implies. They are built in effects that can be used to increase the environmental realism of WarCraft III.
2) How do you use them?
Weather effects can be created/used in 2 methods. Pre-placed regions, and through triggers.
A) Pre-placed regions.
The easiest method to create weather effects, but the least control over them.

Start by creating a region where you want your weather effect. Right-click the region in region palette (or double-click the region in the main window) to bring up the region properties. Here you can change the name, the coordinates, the color, add a weather effect and ambient sound. Check "Weather Effect" and select the effect you desire from the drop-down.

Zoom (requires log in)

To make the effect more realistic, we can add some ambient sound. To do this we must open up the Sound Editor (Modulo > Sound Editor [F5]). Here we can add sounds to the map. I created a Rain effect, so I want to add the sound of rain to my region. To do this, I'm going to navigate through the left panel of folders, and select "Sounds\Internal\Sound\Ambient\RainAmbiance.wav" (Most of the ambient sounds you will need will be in the Ambient folder). Right-click the sound file and select "Use as Sound". The sound will now appear on the right of the screen, with any other sounds you have specified. You can right-click the sound on the right (called a Sound Variable) and rename, change the volume, pitch, fade in/out rate, and the channel WarCraft III will play it through (the defaults are shown in the screen shot).

Zoom (requires log in)

Now, go back to the Region Palette, and check "Ambient Sound and select the Sound Variable you just specified.
B) Triggers
Triggers may not be the simplest method, but at least they provide some control.

Start off by making a new trigger. Name it something so you will remember what it's for. To create a weather effect, use the action "Environment - Create Weather Effect" Select your region and select the effect desired. Weather effects are initially turned off, so to turn the weather effect on use "Environment - Enable/Disable Weather Effect" Use "Last Created Weather Effect" and "On" as the arguments. Pretty simple.

Trigger:
Rain
Collapse Events
Map initialization
Conditions
Collapse Actions
Environment - Create at Rain <gen> the weather effect Ashenvale Rain (Heavy)
Environment - Turn (Last created weather effect) On

You can also remove weather effects in the same manor. Make a new trigger and use "Environment - Remove Weather Effect"

Note: I recommend using variables to store weather effects, instead of using Last Created Weather Effect. To do this, create a new "Weather Effect" variable and then add
Trigger:
Set WeatherEffect = (Last created weather effect)
to your trigger, right after you create it, using the "Set Variable" action.

Like before, we want to make it more realistic, so we are going to add sound. I already have my sound variable from before, so I can jump to the next step. Use the action "Sound - Add/Remove 3D Sound Across Region" to add the 3D sound to the region. To remove the sound, simply use the same action again, but select "Remove".
3) Thing you need to know that you may not already know
A lot of this tutorial is basics, but now comes that part that even some experienced maps may not know.


The 512 square
Each weather effect, no matter the size of your region, is created in groups of 512x512 squares (the large Yellow grid squares when you have the grid turned on). Because of the way Regions work, to cover only 1 square, the region must not touch the North and East side of the 512x512 square. If you do, the weather effect will extend to the North, East and Northeast squares.

Proper Use
Zoom (requires log in)


Improper Use
Zoom (requires log in)
The one effect rule
There are different types of weather effects: Rain, Shield, Dungeon Fog, Snow, Rays and Wind. Each type of effect can only have one instance of itself per 512 square. This includes disabled weather effects. This means you cannot create Lordaeron Rain and Ashenvale Rain on the same square. The first one created will be viewable, while the other will be non-existent.

I hope people find this tutorial informative and useful. Those 2 special rules have annoyed me. With this tutorial, I hope others do not suffer like I did .
Attached Images
File type: jpgScreen 1.jpg (84.3 KB)
File type: jpgScreen 2.jpg (82.9 KB)
File type: jpgScreen 3.jpg (59.3 KB)
File type: jpgScreen 4.jpg (59.9 KB)
01-30-2007, 01:00 AM#2
Anopob
Cool, never knew about the last ones.
02-04-2007, 12:08 AM#3
WILL THE ALMIGHTY
same here, I didn,t know of the one effect rule or the 512 squares.

Useful.
02-04-2007, 05:59 PM#4
Ammorth
I didn't either until the weather system for a map of mine wasn't working how I thought it would and I did some testing.

Changed a mistake in the tutorial [mutters]<-- Left - Right -->[/mutters]
02-16-2007, 02:32 PM#5
CommanderZ
The info about 512pt squares is very useful, thanks

+Rep
03-11-2007, 10:19 PM#6
PitzerMike
Good tutorial, approved.
03-16-2007, 05:59 PM#7
Deck-boy
Very useful. . .I learned some things.
02-17-2009, 01:31 PM#8
rrockr
That's funny...The last time I played this game called SotDRP and I was able to view 2 different weathers at once. Triggers maybe?
06-15-2009, 02:43 PM#9
Opossum
I think you should add this annoying weather effect "bug" to the tutorial:
Weather effects are the first handles in the handle table and because of this the very first weather effect created is assigned the handle id 0. Thus comparisons like WeatherEffect != null aren't reliable because the very first effect (or any effect that is assigned id 0) will return null. Also whenever you destroy a null weather effect the weather effect with id 0 will be destroyed.
You can read about this in more detail here: http://www.wc3c.net/showthread.php?t=105947