[Mod Tools] Rain

Topic created · 1 Posts · 201 Views
  • Youtube Video

    DOWNLOAD

    1.-Open your map in the radiant and add trigger_multiple where you want the sound to be inside.

    Add these kvps:

    targetname	inside_rain
    

    2.-Open your zombie_mapname.gsc and below

    //#include maps\zombie_theater_teleporter;
    

    add this:

    #include maps\_weather;
    

    under of:

    main ()
    {
    

    add this:

    level._effect["lightning_strike"] = LoadFX( "maps/zombie/fx_zombie_lightning_flash" );
    	level._effect["rain_10"]   = LoadFX( "env/weather/fx_rain_sys_heavy" );
    	level._effect["rain_9"]  = LoadFX( "env/weather/fx_rain_sys_heavy" );
    	level._effect["rain_8"]  = LoadFX( "env/weather/fx_rain_sys_heavy" );
    	level._effect["rain_7"]  = LoadFX( "env/weather/fx_rain_sys_heavy" );
    	level._effect["rain_6"]  = LoadFX( "env/weather/fx_rain_sys_med" );
    	level._effect["rain_5"]  = LoadFX( "env/weather/fx_rain_sys_med" );
    	level._effect["rain_4"]  = LoadFX( "env/weather/fx_rain_sys_med" );
    	level._effect["rain_3"]  = LoadFX( "env/weather/fx_rain_sys_med" );
    	level._effect["rain_2"]  = LoadFX( "env/weather/fx_rain_sys_lght" );
    	level._effect["rain_1"]  = LoadFX( "env/weather/fx_rain_sys_lght" );
    	level._effect["rain_0"]  = LoadFX( "env/weather/fx_rain_sys_lght" );
    

    you have to look for this line:

    maps\_zombiemode::main();
    

    under it add this:

    thread weather_control();
    

    at the end of the .gsc add this:

    weather_control()
    {
    	flag_wait("all_players_connected");
    
    	rainInit( "hard" ); // get rain going
       	level thread rainEffectChange( 9, 0.1 );  // tweak initial rain strength ... default is hard
       	thread playerWeather(); // make the actual rain effect generate around the players
    
    	level.thunder_sound_active = true; //disable or enable thunder sounds
    
    	players = get_players();
    	for(i = 0; i < players.size; i++)
    	{
    		players[i] thread watchRainSFX();
    	}
    
       	level.nextLightning = GetTime() + 1;
       	thread lightning( ::lightning_normal, ::lightning_flash );
    }
    
    watchRainSFX()
    {
    	self endon("death");
    	self endon("disconnect");
    	
    	self.isInside = false;
    	self.isInsideLoop = false;
    	self.isOutsideLoop = false;
    
    	zones = GetEntArray("inside_rain", "targetname");
    
    	while(1)
    	{
    		for(i = 0; i < zones.size; i++)
    		{
    			if(self IsTouching(zones[i]))
    			{
    				self.isInside = true;
    				break;
    			}
    			else
    			{
    				self.isInside = false;
    			}
    		}
    		
    		if(self.isInside)
    		{
    			if(!self.isInsideLoop)
    			{
    				iprintln("Jugador isInSide");
    				self.isInsideLoop = true;
    				self.isOutsideLoop = false;
    				self StopLoopSound();
    				self PlayLoopSound("rain_inside");
    			}
    		}
    		else
    		{
    			if(!self.isOutsideLoop)
    			{
    				iprintln("Jugador isOutSide");
    				self.isOutsideLoop = true;
    				self.isInsideLoop = false;
    				self StopLoopSound();
    				self PlayLoopSound("rain_outside");
    			}
    		}
    		wait(0.1);
    	}
    }
    
    lightning_normal()
    {
    	wait( 0.05 );
    	ResetSunLight();
    }
    
    lightning_flash()
    {
    	SetSunLight( 4, 4, 4.5 );
    	SetSunLight( 1, 1, 1.5 );
    	
    	wait( 0.0014 );  
    
       	SetSunLight( 3, 3, 3.5 );
       	SetSunLight( 2, 2, 2.5 );
      	SetSunLight( 1.5, 1.5, 2 );
       	
       	wait( 0.0010 );
      
       	SetSunLight( 1, 1, 1.5 );
       	SetSunLight( 5, 5, 5.5 );
       	
       	wait( 0.0011 );
      
       	SetSunLight( 4, 4, 4.5 );
       	SetSunLight( 1, 1, 1.5 );
       	
       	wait( 0.0015 );
      
       	SetSunLight( 2.5, 2.5, 3 ); 
    }
    

    3.-Put this in your sounds

    rain_outside,raw\sound\amb\weather\rain\outdoor\stereo\stereo_00.wav,evt_2d,,,ambience,97,97,100,0,0,0,default,default,allon,rdefault,5,priority,5,reject,0,0,0,100,100,0,1,2d,loaded,looping,,1,0,97,,quad,0,0,0,0,0,0.5,no,no,none,1000,no,,both,no,no,,,75,no,no,0,0,wma,yes,no,world,event,no,raw\sound\amb\weather\rain\outdoor\stereo\stereo_00_l.xm4,0,raw\sound\amb\weather\rain\outdoor\stereo\stereo_00_l.mp3,0,raw\sound\amb\weather\rain\outdoor\stereo\stereo_00_l.wav,0,mpl_kowloon,all
    rain_inside,raw\sound\amb\weather\rain\indoor\stereo\stereo_l.wav,evt_2d,,,ambience,97,97,100,0,0,0,default,default,allon,rdefault,5,priority,5,reject,0,0,0,100,100,0,1,2d,loaded,looping,,1,0,97,,quad,0,0,0,0,0,0.5,no,no,none,1000,no,,both,no,no,,,75,no,no,0,0,wma,yes,no,world,event,no,raw\sound\amb\weather\rain\indoor\stereo\stereo_l.xm4,0,raw\sound\amb\weather\rain\indoor\stereo\stereo_l.mp3,0,raw\sound\amb\weather\rain\indoor\stereo\stereo_l.wav,0,mpl_kowloon,all
    
    thunder_00,raw\sound\amb\weather\thunder\thunder_00.wav,amb_500,,,ambience,95,95,100,100,500,500,log2,log1,allon,rdefault,4,priority,5,reject,-100,100,0,10,50,0,1,3d,loaded,nonlooping,,1,0,95,,default,0,20,120,93,0.5,0.5,no,yes,none,1000,no,,both,no,no,,,65,no,no,0,0,wma,yes,no,world,ambience,no,raw\sound\amb\weather\thunder\thunder_00.xm4,0,raw\sound\amb\weather\thunder\thunder_00.mp3,0,raw\sound\amb\weather\thunder\thunder_00.wav,0,zmb_theater,all
    thunder_01,raw\sound\amb\weather\thunder\thunder_01.wav,amb_500,,,ambience,95,95,100,100,500,500,log2,log1,allon,rdefault,4,priority,5,reject,-100,100,0,10,50,0,1,3d,loaded,nonlooping,,1,0,95,,default,0,20,120,93,0.5,0.5,no,yes,none,1000,no,,both,no,no,,,65,no,no,0,0,wma,yes,no,world,ambience,no,raw\sound\amb\weather\thunder\thunder_01.xm4,0,raw\sound\amb\weather\thunder\thunder_01.mp3,0,raw\sound\amb\weather\thunder\thunder_01.wav,0,zmb_theater,all
    thunder_02,raw\sound\amb\weather\thunder\thunder_02.wav,amb_500,,,ambience,95,95,100,100,500,500,log2,log1,allon,rdefault,4,priority,5,reject,-100,100,0,10,50,0,1,3d,loaded,nonlooping,,1,0,95,,default,0,20,120,93,0.5,0.5,no,yes,none,1000,no,,both,no,no,,,65,no,no,0,0,wma,yes,no,world,ambience,no,raw\sound\amb\weather\thunder\thunder_02.xm4,0,raw\sound\amb\weather\thunder\thunder_02.mp3,0,raw\sound\amb\weather\thunder\thunder_02.wav,0,zmb_theater,all
    thunder_03,raw\sound\amb\weather\thunder\thunder_03.wav,amb_500,,,ambience,95,95,100,100,500,500,log2,log1,allon,rdefault,4,priority,5,reject,-100,100,0,10,50,0,1,3d,loaded,nonlooping,,1,0,95,,default,0,20,120,93,0.5,0.5,no,yes,none,1000,no,,both,no,no,,,65,no,no,0,0,wma,yes,no,world,ambience,no,raw\sound\amb\weather\thunder\thunder_03.xm4,0,raw\sound\amb\weather\thunder\thunder_03.mp3,0,raw\sound\amb\weather\thunder\thunder_03.wav,0,zmb_theater,all
    
    

    4.-Finally in your zone_source (mod.csv) add this:

    include,rain
    
Log in to reply