Call of Duty, wildly recognized as one of the greatest World War 2 games, gets a face lift with this sequel. The sequel to Call of Duty, the 2003 Game of the Year and winner of more than 80 awards, Call of Duty 2 offers more immense, more intense, more realistic battles than ever before, thanks to the stunning visuals of the new Call of Duty 2 engine.

Post tutorial Report RSS Adding Rain to your SP Map

This is a tutorial on how to add rain to your Call of Duty 2 level.

Posted by on - Intermediate Mapping/Technical

Tutorial written by [FR] Sparks. Mirrored here for archival purposes.


Adding Rain to your SP Map

Courtesy of [FR] Sparks

Simplified the rain code so all you have to do is just change the RainLevel value between integers 0-10 with 10 being hard rain.

MAPNAME.GSC

#include maps\_utility;
#include maps\_anim;

#using_animtree("generic_human");


main()
{
	maps\_load::main();
	mapsMAPNAME_fx::main();
}

MAPNAME_fx.GSC

#include maps\_utility;
main()
{
	// Rain
	level._effect["rain_heavy_cloudtype"]	= loadfx ("fx/misc/rain_heavy_cloudtype.efx");
	level._effect["rain_10"]	= loadfx ("fx/misc/rain_heavy.efx");
	level._effect["rain_9"]		= loadfx ("fx/misc/rain_9.efx");
	level._effect["rain_8"]		= loadfx ("fx/misc/rain_8.efx");
	level._effect["rain_7"]		= loadfx ("fx/misc/rain_7.efx");
	level._effect["rain_6"]		= loadfx ("fx/misc/rain_6.efx");
	level._effect["rain_5"]		= loadfx ("fx/misc/rain_5.efx");
	level._effect["rain_4"]		= loadfx ("fx/misc/rain_4.efx");
	level._effect["rain_3"]		= loadfx ("fx/misc/rain_3.efx");
	level._effect["rain_2"]		= loadfx ("fx/misc/rain_2.efx");
	level._effect["rain_1"]		= loadfx ("fx/misc/rain_1.efx");
	level._effect["rain_0"]		= loadfx ("fx/misc/rain_0.efx");
	
	thread rainControl(); // level specific rain settings.
	thread playerWeather(); // make the actual rain effect generate around the player
}

rainControl()
{
	level.rainLevel = 10; // rain level
	level._effect["rain_drops"] = level._effect["rain_" + level.rainLevel];
}

playerWeather()
{
	player = getent("player","classname");
	for (;;)
	{	
		playfx ( level._effect["rain_drops"], player.origin + (0,0,650), player.origin + (0,0,680) );
		if (level.rainLevel >= 8)
			playfx ( level._effect["rain_heavy_cloudtype"], player.origin + (0,0,650));
		wait (0.3);
	}
}

RainCoD2

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: