Wc3C.net (http://www.wc3c.net/forums.php)
-   General Mapping Tutorials (http://www.wc3c.net/forumdisplay.php?f=427)
-   -   How to create your own custom weather (http://www.wc3c.net/showthread.php?t=67949)

CryoniC 11-06-2004 10:41 PM

How to create your own custom weather
3 Attachment(s)
How to create your own custom weather
What you will need
- TFT World Editor
- Microsoft Excel or any other slk editor
- WinMPQ
- Paint Shop Pro or similiar program
- Warcraft 3 Viewer

Step 1
Start by extracting the Weather.slk from the War3x.mpq file located in your Warcraft install folder with WinMPQ. The Weather.slk file can be found under the TerrainArt\ folder.

Step 2
Open the Weather.slk file with Microsoft Excel or your SLK editor of choice. You should see a table that looks like this at the top.Zoom (requires log in)

Description of the table headings. These headings should not be changed in any way

- effectID - This is the id code used by WE and can only be 4 characters long. This id must be unique.
- name -This is your own description of the effect and can be of any length.
- texDir - This is the directory path where your texture used by the effect is located.
- texFile - The name of the texture file without the extension.
- alphaMode - This is the blending mode used by the effect and will be discussed in detail later on.
- useFog - Determines whether your effect will be visible through fog. 1 = Visible 0 = Non-Visible
- height - This is how high above the ground the effect will be created.
- angx - The direction and force with which the effect moves on the X axis. Explained in detail further on.
- angy - The direction and force with which the effect moves on the Y axis. Explained in detail further on.
- emrate - The amount of particles created per second.
- lifespan - The time in seconds before a particle disappears.
- particles - The maximum amount of particles created in the effect time length.
- veloc - The velocity or speed with which the particles move.
- accel - The tempo with which the particles gain speed or velocity.
- var - The variation in the particles that make the effect look more natural.
- texr - The amount of rows in the texture. Explained in detail later on.
- texc - The amount of columns in the texture. Explained in detail later on
- head - Determines whether a particle is just a head.
- tail - Determines whether a particle has something moving behind it. A particle cannot have both a head and a tail.
- tailen - Determines the length of the tail.
- lati - A high value causes the particles to be emmited in random directions
- long - ?
- midTime - Marks the middle of the particles lifespan. Explained further on.
- Start, Mid, End RGB- Determines the particle's color at the beginning, middle and end of its lifespan.
- Start, Mid, End Alpha- Determines the alpha value or transparency at the beginning, middle and end of its lifespan.
- Start, Mid, End Scale- Determines the particle's size at the beginning, middle and end of its lifespan.
- Start, Mid, End hUV & tUV- This has something to do with the rows and columns of the texture. What exactly I don't know.
- ambientsound - The sound the effect makes when you get near it.
- version - The version of Warcraft the effect needs. 0 = ROC. 1= TFT

Every weather effect in Warcraft is made up out of particles that have number of properties that can be changed to change the look of the particle. The alphaMode
or blending mode can be a value of 0 to 3 that changes how the particle is rendered.
1. A value of 0 will give you a near invisible particle.
2. A value of 1 will give you a more visible particle.
3. A value of 2 subtracts the color of the particle from the color behind the particle.
4. A value of 3 adds the color of the particle to the color behind the particle.

The angx and angy values changes the direction of the particle's movement. The higher the value the more the particle will move in that direction. The angx value
controls the left and right movement and the angy value controls the up and down movement. By tweaking these values you can make the particles move diagonally.
1. angx = Negative. Particles move more left.
2. angx = Positive. Particles move more right.
3. angy = Negative. Particles move more downwards.
4. angy = Positive. Particles move more upwards.

The texr and texc values causes the particle's texture to animate between different parts of the texture. The picture below is the texture used by the Outland Wind effect.
Zoom (requires log in)
Notice how there is 8 rows and 8 columns in the texture. The texr and texc values of the Outland Weather Effect are both set to 8, telling the particle there are 8 rows and
8 columns in the texture and that it should animate between each one instead of rendering all of the texture at once.

The midTime value is the factor with which the middle of a particle's lifespan is determined. A value of 0.5 is the precise middle while a lower value causes the middle to be nearer
to the beginning and a higher value causes it to be nearer to the end. The midTime is multiplied with the lifepan to you the time in seconds before the middle is reached. The particle
uses this value to determine where it must change color.

The Start RGB value determines the color of the particle when it is created, the Mid RGB the color of the particle when it is in the middle of its lifespan and the End RGB the ending
color. The alpha values work the same only they control the transparency of the particle. The particle will fade between the color value from start to end. Here is an example
of the Outland Wind with a red start, green middle and a blue end.
Zoom (requires log in)

Step 3
Ok, hopefully you now you know everything you need to know about the effect parameters. Continue and create a texture for your effect or choose one of Warcraft's existing ones.
Note down its directory path and filename if your using one of the Warcraft textures. Use the Warcraft 3 Viewer to convert the texture to a BLP file. Go to the Weather.slk file and
at the bottom start adding your effect. Give it a unique ID and remember it since you'll need it later on. In the texDir only type in the directory path where your texture can be located.
Under texfile enter the texture filename without the file extension. Proceed to edit the rest of the values to your heart's content using the previous step as a guideline.

Step 4
When you are finished editing the SLK file open up your map you want to use the weather effect in and proceed to import the SLK file and any other files needed.
Change the imported file's path to those in the SLK file. Also change the Weather.slk to TerrainArt\Weather.slk.

Step 5
Unfortunately the only way to get the weather effect to work is by way of JASS or custom text. You'll have to create a Rect or Region where you want the effect to appear.
In the trigger editor create a Custom Script and copy the following into the Script Code part.

Collapse JASS:
call EnableWeatherEffect( AddWeatherEffectSaveLast( gg_rct_Rect0, 'CCaa' ), true )
The gg_rct_Rect0 is your region or rect name and CCaa is the effectID.

Step 6
Save and test to see if everything worked out fine. If the game crashes completely the double check the spelling of your effectid in the SLK file and in the custom script.

If you have a problem or comment don't hesitate to post it here. i will gladly try to help.

11-09-2004 03:02 AM

VERY nice tutorial cyonic. You may want to reupload the pictures however, as you use them in explaining what you are doing. It was still possible to understand though, just harder.

-Mods: I think this deserves to be put as a permanent tutorial (until bliz adds this to the we at least)

11-10-2004 04:08 PM

Nice tut indeed , deserves to be a permanent one :emote_thumbup:

Oh , and the two question marks ...
• lati - this , I think , stands for "latitude"
• long - this one , IMO , stands for "longitude"

latitude and longitude are , if my english is still quite well (hey , belgian dude here , so bare with me) measures to get coordinates , like with the Global Positioning System you might have in your car , it should always tell you where on the globe you are , and it uses 2 numbers for this , the latitude and the longitude.

So these two things might be the place the effect happens , or the height and width of where it happens .... I dunno o_O

CryoniC 11-10-2004 07:12 PM

Allright, I've re-uploaded the pictures and changed the lati value description. It really seems to affect the lattitude or height of the particles. The long value I am still unsure as to what it does. Changes to it doesn't seem to have any noticeable effect. Let me know if somebody figures it out.

flamesforzuljin 11-29-2004 01:26 AM

ok, ill move this to general mapping.

good stuff, buddy.


Histenchist 03-24-2007 09:50 PM

It would'nt hurt if you did a map with this...
I cant get the JASS right :(

Pyritie 05-23-2007 09:19 PM




All times are GMT. The time now is 01:02 PM.

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services