Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 80 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

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 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: Rain Script for Multiplayer by Brandon
batistablr
Preferred PLUS Member
Since: Jul 13, 2005
Posts: 2066
Last: Dec 23, 2015
[view latest posts]
Level 8
Forum Moderator
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Wednesday, Feb. 14, 2007 01:13 am
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().

Code:

main()
{
     maps\mp\_load::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.

Code:

main()
{
     maps\mp\_load::main();
     maps\mp\mp_rain.gsc::main();
}


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.

Code:

main() 
{
	//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
rain()
{
	while(1)
	{
		players = getentarray("player", "classname");
		
		for(i=0; i<players.size; i++)
		{
			//I don't think dead people care about rain... :/
			if (!isAlive(players[i]))
				continue;
			
			//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[0] + x, players[i].origin[1] + y, level.mapheight), false, false);
			if (above["fraction"] < .9) continue;
			
			//Please rain
			playfx(level._effect["rain"], above["position"]);
			
			wait .05;
		}
		
		wait .05;
	}
}


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. [thumbs_up]



edited on Feb. 13, 2007 08:16 pm by Batistablr
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
MODSonair is a weekly podcast bringing you the news from a modders perspective. Tune in every Sunday at 12pm EST to listen LIVE.
Share |
WHC_Grassy
General Member
Since: Apr 20, 2005
Posts: 1426
Last: Aug 25, 2007
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Wednesday, Feb. 14, 2007 01:58 am
Nice work mate, I like the clever use of the "continue" command, I tend to forget about that one all too often. [thumbs_up]
Share |
batistablr
Preferred PLUS Member
Since: Jul 13, 2005
Posts: 2066
Last: Dec 23, 2015
[view latest posts]
Level 8
Forum Moderator
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Wednesday, Feb. 14, 2007 02:10 am
Thanks for the feedback, I hope that this is useful to someone :)
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
MODSonair is a weekly podcast bringing you the news from a modders perspective. Tune in every Sunday at 12pm EST to listen LIVE.
Share |
tourist.Tam
General Member
Since: Feb 2, 2007
Posts: 397
Last: Oct 6, 2009
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Wednesday, Feb. 14, 2007 04:33 am
usefull? more than likely mate. ;) it works like a charm.

Cheers


Tam

PS: thanks for everyone involved in this script.
Share |
batistablr
Preferred PLUS Member
Since: Jul 13, 2005
Posts: 2066
Last: Dec 23, 2015
[view latest posts]
Level 8
Forum Moderator
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Wednesday, Feb. 14, 2007 05:27 am
Thank you tourist.Tam. I hope it gets added to the CoD2 Tutorials section.
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
MODSonair is a weekly podcast bringing you the news from a modders perspective. Tune in every Sunday at 12pm EST to listen LIVE.
Share |
batistablr
Preferred PLUS Member
Since: Jul 13, 2005
Posts: 2066
Last: Dec 23, 2015
[view latest posts]
Level 8
Forum Moderator
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Wednesday, Feb. 14, 2007 06:57 pm
FIX:
main()
{
maps\mp\_load::main();
maps\mp\mp_rain.gsc::main();
}

REMOVE THE .GSC
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
MODSonair is a weekly podcast bringing you the news from a modders perspective. Tune in every Sunday at 12pm EST to listen LIVE.
Share |
Ricsta
General Member
Since: Jun 10, 2004
Posts: 933
Last: Nov 27, 2014
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Wednesday, Feb. 14, 2007 07:04 pm
So what exactly did you change from Rasta's script.

Ive not used it proply before but if you cant see the fx when you look up then surely thats how the fx file its self is made?

Rastas script spawns rain/snow above you so i would of thought you could see it when you looked up :/
Share |
batistablr
Preferred PLUS Member
Since: Jul 13, 2005
Posts: 2066
Last: Dec 23, 2015
[view latest posts]
Level 8
Forum Moderator
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Wednesday, Feb. 14, 2007 10:18 pm
It only spawns right above your head, so it looks like its spawning high. Its only in your view, if you look up you see nothing.
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
MODSonair is a weekly podcast bringing you the news from a modders perspective. Tune in every Sunday at 12pm EST to listen LIVE.
Share |
KeiserSoze
General Member
Since: Feb 20, 2007
Posts: 11
Last: Aug 6, 2008
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Tuesday, Feb. 20, 2007 02:43 pm
And it should work with dx7 and dx9, or just dx9?

What about scoped rifles? Is the rain visible at the other side?
The thing I'm trying to create is low visibility effect with heavy rain, is it possible?

edited on Feb. 20, 2007 09:45 am by KeiserSoze
Share |
Gagarin
General Member
Since: Apr 21, 2006
Posts: 35
Last: Feb 3, 2008
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Tuesday, Feb. 20, 2007 03:22 pm
Hm, i made all rhis thing , but not seen the rain . wtf ?
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»