MODSonline
  Welcome Guest to MODSonline Home | Forums | Register | Login
Main-Menu
Home
Login
Register
Add Download
Add News
Add Tutorial *
Forums

Advertise
Affiliate Store US *
Affiliate Store UK *
Affiliate Store CA *
Angry Letter Generator
Avatar Upload
Calendar of Games
Contact
Downloads
FAQs
Forums
Member List
Member Projects
News
News Grabber *
Policy
Polls
Private Messages
Reviews
Screenshot Gallery
Search
Servers - Game
Store - Shirts *
Subscribe
Topics
Tutorials
Weblinks
Wiki *
Tutorials
CoD Mapping
CoDUO Mapping
CoD2 Mapping
CoD4 Mapping
CoDWW Mapping
CoD FAQs
HL2 Mapping
HL2 FAQs
SOF1 Mapping
Crysis Mapping
Q4 Mapping
Doom 3 Mapping
Doom 3 FAQs
UT2K3 Mapping
SOF2 Mapping
SOF2 FAQs

Lightray Modeling
General Modeling
General Modding
Adobe Photoshop
Common Mapping Errors

Readme.txt Generator
Members-Online
MetalMilit... [Forum]
ROTCGuy [Forum]
Welshy [Forum]
4sakin [Forum]
rik4000 [Forum]
Sgt.Rampage [Forum]
mrsilvers [Forum]
*UWS*KILL_... [Forum]
deadelvis [Forum]
SparkyMcSp... [Today]
[-X-]Fried... [Today]
starkk [Today]
jace [Forum]
Bull [Downl]

14 Members and 14 Guests
Chat MODSonline
0 People Now Chatting
MODSOnline TeamSpeak

download TeamSpeak

In-The-News
Monday, Dec. 1st
A message from foyleman
Sunday, Nov. 30th
MODSonair 156 Live
Friday, Nov. 28th
MODSonair Episode 155
Wednesday, Nov. 26th
MODSonair Forum Buttons
Monday, Nov. 24th
Holiday Gift Guide 2008 - PC
Latest Poll
Single or Multiplayer maps for World at War?
Single-Player 29.21%
Multiplayer 62.92%
WHAT!? The tools are out? 7.87%
Read More...
10 comments

Newsletter
Name:
Email:
Newsletter Archives
Your Membership
User Name:
Password:
Register.
In The Forums
Mirror's Edge PC Release Date Announced
News Around the .. Posts: (3) Views: (7) by Welshy
Minimap Weirdness...
CoD 4 Level Desi.. Posts: (3) Views: (29) by JerryAtricks
ERROR: CodeCallback_StartGameType[]
CoD 4 Level Desi.. Posts: (10) Views: (59) by JerryAtricks
EFFECTS ERROR
CoD 4 Level Desi.. Posts: (4) Views: (57) by JerryAtricks
Art of War Central Quake 4 Mods for Dummies
CoDWW Download
Forums
MODSonline.com Forums

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD 4 Level Design
CoD 4 mapping and level design.
Moderators: foyleman, rEdrUmMDK, Foxhound, Rasta, StrYdeR, The_Caretaker, batistablr, playername, Welshy
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access
Page
Next Page
subscribe
Author Topic: Rain or Snow
pa1n
General Member
Since: Feb 5, 2008
Posts: 23
Last: Sep 18, 2008
[view latest posts]
Level 1
Category: CoD 4 Level Design
Posted: Tuesday, Feb. 5, 2008 02:06 pm
Hi All

am new to forum and i need some help with weather effects

I have read throught the ones i can find in the forum but i cant grasp the code.

All i was wanting was heavy rain in my map with the rain sound. I guess lightning would be cool but i think thats for another day.

I dont understand about the gsc files or the fx files. Is it possible for some-one to make me a script to do what i need ?

[drink]

edited on Feb. 5, 2008 02:07 pm by pa1n
The_Caretaker
Preferred Member
Since: Jun 8, 2004
Posts: 11559
Last: Oct 4, 2008
[view latest posts]
Level 10
Forum Moderator
Category: CoD 4 Level Design
Posted: Tuesday, Feb. 5, 2008 03:36 pm
Did you try the tutorial for rain?

If so, what do you not understand about the script? It should work as it is.. though you might need another fx file because the tutorial is for CoD2.

Those effects can be found in the CoD4/raw/fx/weather folder.
pa1n
General Member
Since: Feb 5, 2008
Posts: 23
Last: Sep 18, 2008
[view latest posts]
Level 1
Category: CoD 4 Level Design
Posted: Wednesday, Feb. 6, 2008 03:29 pm
Hi there

Yes thats the one i looked at. I worked out that the link for the fx was wrong but im unsure how to use it.

Can i make the gsc file and the _fx file from txt files renamed extensions to a gsc or fx file.

If so i made them and i had a error to do with a } i dont understand script like this so its hard to work out where the script fails. Its been while since i have made any maps. The last was for Quake 2 .

I guess i need help with the error and a bit of guidance.

I appriciate the help
Sevenz
General Member
Since: Apr 24, 2006
Posts: 1134
Last: Dec 3, 2008
[view latest posts]
Level 8
Category: CoD 4 Level Design
Posted: Wednesday, Feb. 6, 2008 03:47 pm
cod4 has a small weather engine, try to figure out how to let it rain. you shoudn't use the old cod2-script unless the cod4 stock rain doesn't work or isn't what you want
Rasta
Preferred Member
Since: Apr 10, 2004
Posts: 4342
Last: Dec 4, 2008
[view latest posts]
Level 9
Forum Moderator
Im a fan of MODSonair
Im a HOST of MODSonair
Category: CoD 4 Level Design
Posted: Wednesday, Feb. 6, 2008 03:58 pm
I tried the rain script with cod4 and it appear to work fine.. Make sure you use small effect though, there are weather efx called some like rain_mp_cargoship and rain_mp_farm (something similar to that) but those efx are extremely large and due to the script repeating it every x amount of second the game will lagg to a stop very quickly.
Go ahead... You Play I Mod : MODSonline.com
Support Modsonline by becoming a PREFERRED MEMBER today
Have you heard the MODSonair Podcast?: www.modsonair.com
We are game enthusiasts from the MODSonline.com community bringing you news, updates and opinions of the week's current events. Tune in every Friday for a new episode.
pa1n
General Member
Since: Feb 5, 2008
Posts: 23
Last: Sep 18, 2008
[view latest posts]
Level 1
Category: CoD 4 Level Design
Posted: Wednesday, Feb. 6, 2008 04:54 pm
Could i see some working script for rain.

I get a compile error of } when i try using the cod2 script.

And is it correct to make a gsc from a txt file re-badged as map name with gsc on the end?

Also on the MP map downpour on the edge of certain buldings it looks like larger amounts of water falling from the building is that a decal?


edited on Feb. 6, 2008 04:56 pm by pa1n
Sevenz
General Member
Since: Apr 24, 2006
Posts: 1134
Last: Dec 3, 2008
[view latest posts]
Level 8
Category: CoD 4 Level Design
Posted: Wednesday, Feb. 6, 2008 05:07 pm
gsc-files are plaintext files. simply rename file extention from .txt to .gsc

make sure your Windows shows the file extension!

Quote:
How do I make file extensions appear in Windows?

Sometimes files may appear without showing their file extensions e.g. the Word file letter.doc may appear simply as letter. It is good practice to work with file extensions showing to avoid mistaking one file for another (e.g. index.html.txt appears the same as index.html if editing in Notepad) - note that files with double extensions often pose a high virus risk.

To make file extensions always appear in Vista:

1. Open Computer (or any folder window)
2. Choose Organize from the menu
3. Choose Folder and Search Options
4. Click on the View tab
5. Under Advanced settings untick the box beside Hide file extensions for known file types
6. Click on OK

To make file extensions always appear in Windows 2000/XP:

1. Open My Computer (or any folder window)
2. Choose Folder Options from the Tools menu
3. Click on the View tab
4. In Advanced settings untick the box beside Hide file extensions for known file types
5. Click on Apply to all folders or Like current folder and OK to the message that appears
6. Click on OK to close the Folder Options window
pa1n
General Member
Since: Feb 5, 2008
Posts: 23
Last: Sep 18, 2008
[view latest posts]
Level 1
Category: CoD 4 Level Design
Posted: Wednesday, Feb. 6, 2008 05:27 pm
Thanks sevenz i thought that was the case.

Just not sure how to get rid of the errors i get.
[banghead]

It must be easy to get level wide rain. How do i work the cod4 weather engine???
Sevenz
General Member
Since: Apr 24, 2006
Posts: 1134
Last: Dec 3, 2008
[view latest posts]
Level 8
Category: CoD 4 Level Design
Posted: Wednesday, Feb. 6, 2008 06:21 pm
multiplayer script: maps\mp\mp_farm_fx.gsc

Code:
main()
{
	level._effect[ "wood" ]					 = loadfx( "explosions/grenadeExp_wood" );
	level._effect[ "dust" ]					 = loadfx( "explosions/grenadeExp_dirt_1" );
	level._effect[ "brick" ]				 = loadfx( "explosions/grenadeExp_concrete_1" );
	level._effect[ "coolaidmanbrick" ]		 = loadfx( "explosions/grenadeExp_concrete_1" );
	level._effect[ "rain_heavy_mist" ]		 = loadfx( "weather/rain_mp_farm" );
	level._effect[ "lightning" ]			 = loadfx( "weather/lightning_mp_farm" );
	level._effect[ "cgoshp_drips_a" ]		 = loadfx( "misc/cgoshp_drips_a" );

	//ambient runners
	level._effect[ "rain_splash_mp_farm" ]	 = loadfx( "ambient_runners/mp_farm_rain_splash01" );
	level._effect[ "water_noise_ud" ]		 = loadfx( "ambient_runners/mp_farm_water_noise_ud01" );
	level._effect[ "water_noise" ]			 = loadfx( "ambient_runners/mp_farm_water_noise01" );

	
/#
	if ( getdvar( "clientSideEffects" ) != "1" )
		maps\createfx\mp_farm_fx::main();
#/		
}

don't know if this is all what you have to do - adding loadfx() commands to your map fx gsc. probably not, i think you have to do something within radiant...


singleplayer(?) script: maps\_weather.gsc

Code:
// Utility rain functions:
#include maps\_utility;

rainHard(transition)
{
	println ("Rain becomes Hard over " + transition + " seconds");
	level notify ("rain_change", "hard", transition);
	level thread rainEffectChange(10, transition);
	wait (transition*0.5);
	level.ambient_modifier["rain"] = "";
	//	This is commented out until ambient weather sounds are added to the tree
	//maps\_ambient::activateAmbient( level.ambient );
	wait (transition*0.5);
}

rainLight(transition)
{
	println ("Rain becomes Light over " + transition + " seconds");
	level notify ("rain_change", "light", transition);
	level thread rainEffectChange(5, transition);
	wait (transition*0.5);
	level.ambient_modifier["rain"] = "light";
	//	This is commented out until ambient weather sounds are added to the tree
	//maps\_ambient::activateAmbient( level.ambient );
	wait (transition*0.5);
}

rainNone(transition)
{
	println ("Rain fades out over " + transition + " seconds");
	level notify ("rain_change", "none", transition);
	level thread rainEffectChange(0, transition);
	wait (transition*0.5);
	level.ambient_modifier["rain"] = "norain";
	//	This is commented out until ambient weather sounds are added to the tree
	//maps\_ambient::activateAmbient( level.ambient );
	wait (transition*0.5);
}

rainInit(lvl)
{
	if (lvl == "none")
	{
		level.rainLevel = 0; // starting rain level
		level._effect["rain_drops"] = level._effect["rain_" + level.rainLevel];
		rainNone(0.1);
	}
	else
	if (lvl == "light")
	{
		level.rainLevel = 5; // starting rain level
		level._effect["rain_drops"] = level._effect["rain_" + level.rainLevel];
		rainLight(0.1);
	}
	else
	{
		level.rainLevel = 10; // starting rain level
		level._effect["rain_drops"] = level._effect["rain_" + level.rainLevel];
		rainHard(0.1);
	}
}


lightning(normal, flash)
{
	[[normal]]();
	waittillframeend; // so exploders get setup
	for (;;)
		lightningThink(normal, flash);
}

////// 
/*
	BELOW THIS LINE IS INTERNAL RAIN FUNCTIONS
*/
////// 

rainEffectChange(change, transition)
{
	level notify ("rain_level_change");
	level endon ("rain_level_change");
	if (level.rainLevel > change)
	{
		dif = level.rainLevel - change;
		transition /= dif;
		for (i=0;i= 8)
			playfx ( level._effect["rain_heavy_cloudtype"], player.origin + (0,0,650));
		wait (0.3);
	}
}




rainlevelRandomwait()
{
	if (level.rainLevel == 0)
		return (randomfloat (30));
	else
	if (level.rainLevel == 1)
		return (randomfloat (24));
	else
	if (level.rainLevel == 2)
		return (randomfloat (20));
	else
	if (level.rainLevel == 3)
		return (randomfloat (15));
	else
	if (level.rainLevel == 4)
		return (randomfloat (12));
	else
	if (level.rainLevel == 5)
		return (randomfloat (9));
	else
	if (level.rainLevel == 6)
		return (randomfloat (8));
	else
	if (level.rainLevel == 7)
		return (randomfloat (8));
	else
	if (level.rainLevel == 8)
		return (randomfloat (7));
	else
	if (level.rainLevel == 9)
		return (randomfloat (6));
	else
	if (level.rainLevel == 10)
		return (randomfloat (5));
}

rainlevelwait()
{
	if (level.rainLevel == 0)
		return (20);
	else
	if (level.rainLevel == 1)
		return (18);
	else
	if (level.rainLevel == 2)
		return (16);
	else
	if (level.rainLevel == 3)
		return (14);
	else
	if (level.rainLevel == 4)
		return (12);
	else
	if (level.rainLevel == 5)
		return (10);
	else
	if (level.rainLevel == 6)
		return (9);
	else
	if (level.rainLevel == 7)
		return (8);
	else
	if (level.rainLevel == 8)
		return (7);
	else
	if (level.rainLevel == 9)
		return (6);
	else
	if (level.rainLevel == 10)
		return (5);
}

lightningThink(normal, flash)
{
	level endon ("rain_change");

	// in case we get broken out, we may have lightning sooner than planned if we're getting rainier
	nextStrike = gettime() + ((rainlevelwait() + rainlevelRandomwait())*1000);
	if (nextStrike < level.nextLightning)
		level.nextLightning = nextStrike;

	for (;;)
	{
		timer = (level.nextLightning - gettime()) * 0.001;
		if (timer > 0)
			wait (timer);
			
		lightningFlash(normal, flash);
		level.nextLightning = gettime() + ((rainlevelwait() + rainlevelRandomwait())*1000);
	}
}

fogflash(flashfunc)
{
//	level.lightningExploderIndex = 2;
	if (isdefined (level.lightningExploderIndex))
		exploder(level.lightningExploder[level.lightningExploderIndex]);

	[[flashfunc]]();
//	wait (0.1);
}

lightningFlash(normal, flashfunc)
{
	flash[0] = "quick";
	flash[1] = "double";
	flash[2] = "triple";
//	This is commented out until thunder sounds are added to the tree
	thread thunder();			
	flashType = randomint(flash.size);

	lit_num = 0;
	if (isdefined (level.lightningExploderIndex))
	{
		while (lit_num == level.lightningExploderIndex)
			lit_num = randomint(level.lightningExploder.size);
		level.lightningExploderIndex = lit_num;
	}

//	flashtype = 2;
	switch (flash[flashType])
	{
		case "quick":
		{
			fogflash(flashfunc);
			break;
		}
		case "double":
		{
			fogflash(flashfunc);
			wait (0.05);
			fogflash(flashfunc);
			break;
		}
		case "triple":
		{
			fogflash(flashfunc);
			wait (0.05);
			fogflash(flashfunc);
			wait (0.5);
			fogflash(flashfunc);
			break;
		}
	}
}

thunder()
{
	if (level.rainLevel == 0)
		wait (6 + randomfloat(2));
	else
	if (level.rainLevel == 1)
		wait (5 + randomfloat(1.8));
	else
	if (level.rainLevel == 2)
		wait (4.5 + randomfloat(1.6));
	else
	if (level.rainLevel == 3)
		wait (4 + randomfloat(1.6));
	else
	if (level.rainLevel == 4)
		wait (3.5 + randomfloat(1.5));
	else
	if (level.rainLevel == 5)
		wait (3 + randomfloat(1.5));
	else
	if (level.rainLevel == 6)
		wait (2.5 + randomfloat(1.2));
	else
	if (level.rainLevel == 7)
		wait (2 + randomfloat(1));
	else
	if (level.rainLevel == 8)
		wait (1.9 + randomfloat(0.5));
	else
	if (level.rainLevel == 9)
		wait (1.5);
	else
	if (level.rainLevel == 10)
		wait (1);
	
	ent = spawn ("script_origin",(0,0,0));
	ent.origin = level.player.origin + (0,0,60);
	ent linkto (level.player);
	if (level.rainlevel <= 8)
		ent playsound ("elm_thunder_distant", "sounddone");
	else
	{
		ent playsound ("elm_thunder_distant", "sounddone");
		ent thread play_sound_on_entity ("elm_thunder_strike");
	}	
//	iprintlnbold ("thunder!");	
	ent waittill ("sounddone");
	ent delete();	
}


edited on Feb. 6, 2008 06:26 pm by Sevenz
Sevenz
General Member
Since: Apr 24, 2006
Posts: 1134
Last: Dec 3, 2008
[view latest posts]
Level 8
Category: CoD 4 Level Design
Posted: Wednesday, Feb. 6, 2008 06:36 pm
(more related files):

maps\createart\mp_farm_art.gsc

Code:
// _createart generated.  modify at your own risk. Changing values should be fine.
main()
{

	level.tweakfile = true;
 

	//* Fog section * 

	setdvar( "scr_fog_disable", "0" );

	setExpFog(300, 1400, 0.5, 0.5, 0.5, 0);
	VisionSetNaked( "mp_farm", 0 );

}


maps\mp_farm.gsc

Code:
main()
{
	maps\mp\mp_farm_fx::main();
	maps\createart\mp_farm_art::main();
	maps\mp\_load::main();

	maps\mp\_compass::setupMiniMap("compass_map_mp_farm");

	//setExpFog(300, 1400, 0.5, 0.5, 0.5, 0);
	ambientPlay("ambient_farm");
	//VisionSetNaked( "mp_farm" );
	
	game["allies"] = "sas";
	game["axis"] = "russian";
	game["attackers"] = "allies";
	game["defenders"] = "axis";
	game["allies_soldiertype"] = "woodland";
	game["axis_soldiertype"] = "woodland";

	setdvar( "r_specularcolorscale", "5" );

	setdvar("compassmaxrange","2000");
}


two rain-related functions are located in fx.gsc, but they are commented out!
Restricted Access Restricted Access
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD 4 Level Design
All logos and trademarks and information in this site are property of MODSonline LLC © 2008.
The comments are property of their posters.
RSS news feeds for MODSonline can be found News.php.
MODSonline Subscriptions
Partners
Battle for Europe COD2
Call of Duty Headquarters
XoXide
CODAddicts - Call of Duty News & Downloads
Frag Universe
modbase.be
The Firing Box
Ask About
Advertising
Friends
The Clan Database
CoD 4 Base
Canada Kicks Ass Clan
Ask About
Advertising
Link to Us
MODSonair
View in iTunes
Please help us to raise in the ranks of podcasting and subscribe to our itunes feed using the link above.
MODSonair Releases
MODSonair Episode 155
MODSonair Episode 154
MODSonair Episode 153
MODSonair Episode 152
MODSonair Episode 151
Next Show
The next MODSonair show will air LIVE on:
12/07/2008 12:00 EST

Time remaining:
Copyright © 2008 MODSonline
Tresware Content Management System Copyright © 2008 Tresware
Website Designed and Hosted   Tresware