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

Members Online

»
0 Active | 7 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

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: CoD4 SP Mapping
CoD 4 mapping and level design for single player.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: Rain & lightning tuts for SP?
elmer_fudd
General Member
Since: Feb 20, 2007
Posts: 125
Last: Mar 20, 2009
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Monday, Mar. 17, 2008 02:44 am
I've been trying to put a rain/lightning effects in my SP map that I've been playing around with but, I can't for the life of me find a tutorial for neither one.

I've tried using the tutorials in MP section but, it apparently doesn't work in SP maps.

I've tried different versions of the effect posted by several people and since MP rain/lightning script doesn't seem to work(at least for my SP map), could someone lead me to SP tutorials on rain/lightning?
Share |
SparkyMcSparks
General Member
Since: Feb 28, 2004
Posts: 1713
Last: Dec 29, 2016
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD4 SP Mapping
Posted: Monday, Mar. 17, 2008 02:53 am
Here's how I got rain in a map I was originally working on:

mapname_fx.gsc
Code:
#include maps\_utility;

#include maps\_weather;


main()
{	
	// Rain FX
	level._effect["rain_heavy_cloudtype"]	= loadfx ("weather/rain_heavy_cloudtype");
	level._effect["rain_drops"] = loadfx ("weather/rain_drops_fastrope");
	
	// Start Rain
	level.rainLevel = 8;
	thread playerWeather();
}


Lightning is a little harder, I never got it working but this is what I had when attempting to get it to work:
Code:
normal()
{
	wait (0.05);
    resetSunLight();
}

flash()
{		
    wait (.05);
    setSunLight( 1, 1, 1.2 );
    wait (.05);
    setSunLight( 3, 3, 3.7 );
    wait (.1);
    thread normal();
    setSunLight( 1, 1, 1.2 );
    wait (.05);
}

I think there's a function in the weather utility that takes those two functions, but I wasn't sure how to toy with it and never bothered to look into it more.

edited on Mar. 16, 2008 10:54 pm by Sparks.
Share |
elmer_fudd
General Member
Since: Feb 20, 2007
Posts: 125
Last: Mar 20, 2009
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Monday, Mar. 17, 2008 05:26 pm
Thanks Sparks,
I've tried the script you posted for rain and named it test2_fx.gsc(name of my test map) and installed it into maps\ folder:

#include maps\_utility;
#include maps\_weather;

main()
{
// Rain FX
level._effect["rain_heavy_cloudtype"] = loadfx ("weather/rain_heavy_cloudtype");
level._effect["rain_drops"] = loadfx ("weather/rain_drops_fastrope");

// Start Rain
level.rainLevel = 8;
thread playerWeather();
}

Then I modified my test map's .gsc file to look as follows:

#include maps\_utility;
#include maps\_anim;
#using_animtree("generic_human");

main()
{

maps\test2_fx::main();
maps\_load::main();



level.early_level[level.script]=false;
}

No rain in my map [eek]. What did I do wrong?[cry].
I've recompiled and gone through the rest without any errors.
Share |
Mystic
General Member
Since: Apr 10, 2004
Posts: 6147
Last: Apr 15, 2018
[view latest posts]
Level 10
Forum Moderator
Im a fan of MODSonair
Category: CoD4 SP Mapping
Posted: Monday, Mar. 17, 2008 05:38 pm
Look like i do it a different way to sparks but try this see if it worls for you..

In your _fx.gsc add these efx
Code:

	// Rain
	level._effect["rain_heavy_mist_heli_hack"]	= loadfx ("weather/rain_heavy_mist_heli_hack");
	level._effect["rain_drops_fastrope"]		= loadfx ("weather/rain_drops_fastrope");

	level._effect["rain_heavy_cloudtype"]		= loadfx ("weather/rain_heavy_cloudtype");

		//level.the_rain		= loadfx ("weather/rain_9");
		level._effect["rain_10"]	= loadfx ("weather/rain_9");
		level._effect["rain_9"]		= loadfx ("weather/rain_9");
		level._effect["rain_8"]		= loadfx ("weather/rain_8");
		level._effect["rain_7"]		= loadfx ("weather/rain_7");
		level._effect["rain_6"]		= loadfx ("weather/rain_6");
		level._effect["rain_5"]		= loadfx ("weather/rain_5");
		level._effect["rain_4"]		= loadfx ("weather/rain_4");
		level._effect["rain_3"]		= loadfx ("weather/rain_3");
		level._effect["rain_2"]		= loadfx ("weather/rain_2");
		level._effect["rain_1"]		= loadfx ("weather/fog_bog_b");	
		level._effect["rain_0"]		= loadfx ("weather/rain_splash_mp_farm");
		level._effect["rain_drops"]	= loadfx ("weather/rain_splash_mp_farm");


at the bottom add

Code:
	thread rainControl();
	thread playerWeather();


Now add a new function, you can change the init to "none" "light" or "hard"

Code:
rainControl()
{
	rainInit("light");
	
}


Don't forget

Code:
#include maps\_weather;


and your good to go.
Share |
SparkyMcSparks
General Member
Since: Feb 28, 2004
Posts: 1713
Last: Dec 29, 2016
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD4 SP Mapping
Posted: Monday, Mar. 17, 2008 05:51 pm
elmer_fudd writes...
No rain in my map [eek]. What did I do wrong?[cry].
I've recompiled and gone through the rest without any errors.
Did you update zone file? The Rain FX should appear in the missing assets.
Share |
elmer_fudd
General Member
Since: Feb 20, 2007
Posts: 125
Last: Mar 20, 2009
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Wednesday, Mar. 19, 2008 02:47 pm
Sparks. writes...
Quote:
elmer_fudd writes...
No rain in my map [eek]. What did I do wrong?[cry].
I've recompiled and gone through the rest without any errors.

Did you update zone file? The Rain FX should appear in the missing assets.
By rest, I meant the rest of the process [lol], yes, I did update the zone file too and there weren't an entry for the rain fx in the missing assets, in fact, I rarely ever get anything to show up in that window. It never worked right from the beginning. I've been manually adding things as I go but I forgot about this one. [rolleyes]
I'll go and add it manually and see if that'll help, I'm sure it will [thumbs_up] Thanks Sparks.[wave]
Share |
elmer_fudd
General Member
Since: Feb 20, 2007
Posts: 125
Last: Mar 20, 2009
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Saturday, Mar. 22, 2008 04:00 pm
I give up... I tried both methods but unable to make it work[cry]. No big deal, just an effect any way.
Thanks for the info though[thumbs_up]
Share |
infinet
General Member
Since: Feb 4, 2008
Posts: 208
Last: Jan 23, 2013
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Tuesday, Mar. 23, 2010 04:20 am
Bumping this instead of creating a new thread.

Rasta's code worked perfectly for my map. But is there also a way to add another rain fx. I want to add the following as well:

weather/rain_heavy_mist

I replaced weather/rain_heavy_cloudtype with it, but it didn't do anything. I even tried putting it in place of some of the rain_# like this:



Code:
	level.the_rain		= loadfx ("weather/rain_heavy_mist");
	level._effect["rain_10"]	= loadfx ("weather/rain_heavy_mist");
	level._effect["rain_9"]		= loadfx ("weather/rain_9");
	level._effect["rain_8"]		= loadfx ("weather/rain_heavy_mist");
	level._effect["rain_7"]		= loadfx ("weather/rain_7");
	level._effect["rain_6"]		= loadfx ("weather/rain_heavy_mist");
	level._effect["rain_5"]		= loadfx ("weather/rain_5");
	level._effect["rain_4"]		= loadfx ("weather/rain_heavy_mist");
	level._effect["rain_3"]		= loadfx ("weather/rain_3");
	level._effect["rain_2"]		= loadfx ("weather/rain_heavy_mist");
	level._effect["rain_1"]		= loadfx ("weather/rain_1");	
	level._effect["rain_0"]		= loadfx ("weather/rain_splash_mp_farm");
	level._effect["rain_drops"]	= loadfx ("weather/rain_splash_mp_farm");


But then my rain drops dont work. So I dont know how to include it in.
Share |
sam_fisher3000
General Member
Since: Apr 18, 2007
Posts: 816
Last: Jul 16, 2016
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD4 SP Mapping
Posted: Tuesday, Mar. 23, 2010 05:29 am
Use this, I used this for my heli map.

#include common_scripts\utility;
#include maps\_utility;
#include maps\_weather;

main()
{

thread rain();

}

rain()
{


level._effect["rain_heavy_cloudtype"] = loadfx ("weather/rain_heavy_cloudtype");

level._effect["cloud_cover_icbm"] = loadfx ("weather/cloud_cover_icbm");

level._effect["water_noise"] = loadfx ("weather/water_noise");


if( getdvarint( "r_zFeather" ) )
{
level._effect["rain_10"] = loadfx ("weather/rain_heavy_mist");
level._effect["rain_9"] = loadfx ("weather/rain_heavy_mist");
level._effect["rain_8"] = loadfx ("weather/rain_heavy_mist");
level._effect["rain_7"] = loadfx ("weather/rain_heavy_mist");
level._effect["rain_6"] = loadfx ("weather/rain_heavy_mist");
level._effect["rain_5"] = loadfx ("weather/rain_heavy_mist");
level._effect["rain_4"] = loadfx ("weather/rain_heavy_mist");
level._effect["rain_3"] = loadfx ("weather/rain_heavy_mist");
level._effect["rain_2"] = loadfx ("weather/rain_heavy_mist");
level._effect["rain_1"] = loadfx ("weather/rain_heavy_mist");
level._effect["rain_0"] = loadfx ("weather/rain_heavy_mist");
}
else
{
level._effect["rain_10"] = loadfx ("misc/blank");
level._effect["rain_9"] = loadfx ("misc/blank");
level._effect["rain_8"] = loadfx ("misc/blank");
level._effect["rain_7"] = loadfx ("misc/blank");
level._effect["rain_6"] = loadfx ("misc/blank");
level._effect["rain_5"] = loadfx ("misc/blank");
level._effect["rain_4"] = loadfx ("misc/blank");
level._effect["rain_3"] = loadfx ("misc/blank");
level._effect["rain_2"] = loadfx ("misc/blank");
level._effect["rain_1"] = loadfx ("misc/blank");
level._effect["rain_0"] = loadfx ("misc/blank");
}

thread rainControl(); // level specific rain settings.
thread playerWeather(); // make the actual rain effect generate around the player

// Thunder & Lightning
level._effect["lightning"] = loadfx ("weather/lightning");
level._effect["lightning_bolt"] = loadfx ("weather/lightning_bolt");
level._effect["lightning_bolt_lrg"] = loadfx ("weather/lightning_bolt_lrg");


addLightningExploder(10); // these exploders make lightning flashes in the sky
addLightningExploder(11);
addLightningExploder(12);
level.nextLightning = gettime() + 1;//10000 + randomfloat(4000); // sets when the first lightning of the level will go off

}



rainControl()
{
// controls the temperment of the weather
rainInit("hard"); // "none" "light" or "hard"


}



Then update your zone file. I assume you know what to do. This script works. I may create a tutorial.

edited on Mar. 23, 2010 01:29 am by sam_fisher3000

edited on Mar. 23, 2010 01:31 am by sam_fisher3000
Share |
infinet
General Member
Since: Feb 4, 2008
Posts: 208
Last: Jan 23, 2013
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Tuesday, Mar. 23, 2010 04:27 pm
I know how to get the heavy mist working. Right now it's either heavy mist or rain drops. I want the heavy mist AND the rain drops to work together with the rain and lightning. That's what I am trying to do. Get both without sacrificing the other.
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 SP Mapping

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

»