I have tried rasta's rain script and I have decided that I would change it to fit my needs and I belive that the modified version of mine will have a more realistic look just for the simple fact that if you look up you see rain coming down on you and not just a clear sky.
1. You should already have a file called mapname.gsc
in C:\Program Files\Activision\Call of Duty 2\main\maps\mp
2. If you open this file then you should see the function main()
3. For your map to even run correctly these lines of code will already be in main()
4. For this script to work correctly, as well as separating files to make the code as neat as possible, you will need to modify your main()
function as the following.
5. Now it is time to create our rain script.
6. Create a new file called mp_rain.gsc while making sure it is NOT labeled as mp_rain.gsc.txt
7. Inside of mp_rain.gsc, copy and paste this code into it.
//How high is your map?
level.mapheight = 1000;
//What effect am I going to use for the rain?
level._effect["rain"] = loadfx ("fx/misc/rain_heavy.efx");
//I don't want to leave lonely rain() alone :)
level thread rain();
//Rain tells us who she is :P
players = getentarray("player", "classname");
for(i=0; i<players.size; i++)
//I don't think dead people care about rain... :/
//I don't want to make the rain show around the whole map!
x = 550 - randomint(700);
y = 550 - randomint(700);
//Rain indoors is bad... :(
above = bulletTrace( players[i].origin + (x, y, 100), (players[i].origin + x, players[i].origin + y, level.mapheight), false, false);
if (above["fraction"] < .9) continue;
8. After inserting the code, save mp_rain.gsc
9. If all goes well and you have followed these instructions correctly. You should be able to startup your map without any problems, such as rain in buildings, or script errors.
Thanks to Rasta for his original rain script code.
edited on Feb. 13, 2007 08:16 pm by Batistablr