Weather package

Top  Previous  Next

This snippet allows you to add snow and rain to your projects. You can set the area that needs to be covered, the particle density, the randomness, the falling speed, the particle size... Oh, and did I mention that you can also add mist, wind and lightning? Oh again, and did I mention that the particles have proper collision detection, so they don't pass through the ceiling?

 

shot_1

 

shot_2

 

All these features can be set or disabled through Wed's "Behavior" panel; take a look at the values that were used for my tests:

 

rain snow

 

More than that; you can customize the script using Wed's "Customize" option:

 

rainsnow_customize

 

This brings up the following window, which allows you to change various bitmaps and sounds for the project; click "?" and then click one of the tabs to find out more information about each item:

 

weather

 

Ok, let's examine what those skills and flags do:

 

- minimum_x sets the left level boundary on the x axis

- maximum_x sets the right level boundary on the x axis

- minimum_y sets the lower level boundary on the y axis

- maximum_y sets the upper level boundary on the y axis

 

I have taken all these values using Wed's top view:

 

wedtop

 

The height of the entity that has the action named "generator" attached to it will determine the height of the rain / snow particles.

 

rainstart

 

- particle_density sets the number of rain / snow particles. The minimum value is 1, the maximum value is limited by your PCs speed. Don't forget to set max_particles to a bigger value if you plan to have lots of particles on the screen at the same time;

- randomness sets a random particle speed on the x and y axis, as if the particles were moved by the wind. Play with values starting from 0 (no wind at all) and going up to 30 (or so).

- falling_speed is the vertical movement speed; bigger values will make the particles fall more quickly;

- particle_size sets the size of the particle bitmap;

- lightning_frequency tells the engine to create lightning effects more often (lightning_frequency = 0.9 or so) or more seldom (lightning_frequency = 0.99 or so). This value requires a bit of fine tuning;

- the "snow" flag allows you to have snow particles (the flag is checked) or rain particles (the flag is unchecked);

- the "mist" flag allows you to add a mist effect; this makes sense only for rain, in my opinion;

- the "wind" flag starts a looping wind effect sound;

- the "lightning" flag generates random lightning effects that use particles. Thunder sounds, as well as ambient increases, are generated automatically together with the lightning.

 

I have created a small test level for you; copy the \weather folder inside your 3DGS folder, and then open weather1.wmp, build it and run it using main.wdl. Read the following topic - "How do I use this?" - if you want to see how you can add this snippet to your own project.