Here is a code i made for you!

Code:

bmap the_rain = "rain.pcx";

function remove_me();
function fall();
function raindrops();



function main
{
level_load("YOURMAP.wmb"); // load your map
wait(3);
raindrops(); // start the weather effect
}

function raindrops()
{
while(1)
{
vec_set(temp, vector(random(1000)-500,random(1000)-500,300)); // Choose your size its in a random area between 1000 and -500 quants. it starts on a high of 300 quants
ent_create("rain.pcx", temp, fall); // create the raindrops
sleep(0.2); // Choose your own speed, you can also use wait
}

}

function fall()
{
my.enable_entity = on; // sensitive for entitys (player)
my.enable_block = on; // sensitive for blocks (level)
my.event = remove_me; // The event who starts when he hit a entity or a block
while(my != 0) // while i´m not removed
{
c_move(my, vector(0,0,-8*time_step), nullvector, 0); //c_move without "glide" you can change the numbers in vector if you want ti drop it more fast and maybe a bit angular
wait(1);
}
}

function remove_me() // the event
{
if(EVENT_TYPE == EVENT_block) // if raindrops hit a wall or a buildung or whatever
{
wait(3); // you can take a higher value if you want your raindrops life longer. better do that if you need snow
ent_remove(my); // remove raindrop
}
if(EVENT_TYPE == EVENT_entity)
{
wait(3);
ent_remove(my);
}
}



You can change your weathereffect if you use variables. For example you can create a variable with the name "rain_amount = 0.2" you can use that in the sleep(rain_amount) in the raindrops function. In another script you can simply change this value and enforce the rainfall or damp it.

Greetings and have fun!


"Die Kette die mich ewig hält möge man erst noch schmieden" Regina S.