MODSonline Subscriptions
View in iTunes
Please help us to raise in the ranks of podcasting and subscribe to our itunes feed using the link above.
The next MODSonair show will air LIVE on:
03/21/2010 12:03 EDT

Time remaining:
We Dontated to PixelEquity
"Modding refers to the act of modifying a piece of hardware or software or anything else for that matter, to perform a function not originally conceived or intended by the designer." 4
 
Site News   |   Aggregated News   |   Forums   |   Tutorials   |   Downloads   |   Projects   |   Weblinks
Latest Forum Threads 
CoDUO Mapping.. Posts: (5) Views: (64) by sternkaa
MODSon-air.. Posts: (1) Views: (13) by foyleman
CoD4 Scripting.. Posts: (7) Views: (200) by DemonSeed
General Gaming.. Posts: (4) Views: (93) by techno2sl
CoD2 MP Mapping.. Posts: (11) Views: (90) by DemonSeed
CoD4 General.. Posts: (92) Views: (116) by Samuel033
CoD4 MP Mapping.. Posts: (1) Views: (25) by Infern4ll
CoDWW MP Mapping.. Posts: (5) Views: (82) by [ZCT]CoDMapper
CoD4 MP Mapping.. Posts: (10) Views: (155) by [IBS]MattY
CoD4 Map + Mod R.. Posts: (32) Views: (229) by sam_fisher3000
Back to Home Page
MODSCON 2010 L4D2 Contest
Register/Login to Add a Tutorial
Tutorials
CoDUO Mapping
ratings:
Awful Rating
Poor Rating
Average Rating
Good Rating
Excellent Rating
Adding Rain Effects
Versions: You must be logged in to view history.
This is a very short and simple tutorial for adding rain effects to a CoDUOMP map. This tutorial require no modifying to the .map at all.
To prevent lagg and the game draw efx over the whole map, we are going to 'spawn' the rain in front of the actual player.

First you need to create a new .gsc file, and then your need the following script, so just copy and paste it into the new .gsc:

main()
{
     level thread teh_rain();
}

teh_rain()

{
    zufall = RandomInt(100);        
            
    while(1) {
        
    
        players = getentarray("player", "classname");        
        
        if(players.size > 0) {
        
            max_nodes         = 20;
            max_nodes_per_player     = max_nodes/players.size;
        
        
            for(ii=0;ii<max_nodes_per_player;ii++) { 
                for(i = 0; i < players.size; i++) {
                        
                    player = players[i];
                            
                    if(isAlive(player)) {
                    
                        x= 350-randomfloat(700);
                        y= 350-randomfloat(700);                    
                
                            pos = player.origin +(x,y,200) ;                        
                            trace = bulletTrace(pos,pos +(0,0,-250), true, undefined);
                            
                            if(trace["fraction"] != 1) playfx(level.the_rain,trace["position"]);                
                            wait 0.05;
                                               
                    }                        
                }
            }                    
        }
        
        wait 0.05;
    }    
}

Now lets save this as rain.gsc

2) Next step is to load the rain effects, so somewhere in 'yourmap.gsc' add the following line:

    level.the_rain        
= loadfx
("fx/atmosphere/chateau_rain.efx");

You will also need to add another line to 'yourmap.gsc'

      maps\mp\rain::main();
So yourmap.gsc should look something like this:

main()
{
	setCullFog (0, 16050, .54, .56, .50, 0);
	setExpFog (0.00015, .36, .39, .42, 0 );
	ambientPlay("some tunes");

game["layoutimage"] = "my piccy";

level thread maps\mp\_tankdrive_gmi::main();
	level thread maps\mp\_jeepdrive_gmi::main();
	level thread maps\mp\_flak_gmi::main();

level.the_rain = loadfx ("fx/atmosphere/chateau_rain.efx");

maps\mp\_load::main();
	maps\mp\rain::main(); //calls rain efx

game["allies"] = "russian";
	game["axis"] = "german";

game["russian_soldiertype"] = "veteran";
	game["russian_soldiervariation"] = "normal";
	game["german_soldiertype"] = "wehrmacht";
	game["german_soldiervariation"] = "normal";

game["attackers"] = "allies";
	game["defenders"] = "axis";

And you all done. So simple ah?
Rasta