| Author |
Topic: Rain & lightning tuts for SP? |
| elmer_fudd |
 |
General Member Since: Feb 20, 2007 Posts: 125 Last: Mar 20, 2009 [view latest posts] |
|
|
|
|
| SparkyMcSparks |
 |
General Member Since: Feb 28, 2004 Posts: 1713 Last: Dec 29, 2016 [view latest posts] |
|
|
 |
|
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. |
|
|
|
| elmer_fudd |
 |
General Member Since: Feb 20, 2007 Posts: 125 Last: Mar 20, 2009 [view latest posts] |
|
|
|
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]](images/BBCode/smilies/eek.gif) . What did I do wrong? ![[cry]](images/BBCode/smilies/cry.gif) .
I've recompiled and gone through the rest without any errors. |
 |
|
|
| Mystic |
 |
General Member Since: Apr 10, 2004 Posts: 6147 Last: Apr 15, 2018 [view latest posts] |
|
|
 |
 |
|
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. |
 |
|
|
| SparkyMcSparks |
 |
General Member Since: Feb 28, 2004 Posts: 1713 Last: Dec 29, 2016 [view latest posts] |
|
|
 |
|
Category: CoD4 SP Mapping Posted: Monday, Mar. 17, 2008 05:51 pm |
 |
elmer_fudd writes...
No rain in my map ![[eek]](images/BBCode/smilies/eek.gif) . What did I do wrong? ![[cry]](images/BBCode/smilies/cry.gif) .
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. |
|
|
|
| elmer_fudd |
 |
General Member Since: Feb 20, 2007 Posts: 125 Last: Mar 20, 2009 [view latest posts] |
|
|
|
Category: CoD4 SP Mapping Posted: Wednesday, Mar. 19, 2008 02:47 pm |
 |
Sparks. writes...Quote: elmer_fudd writes...
No rain in my map ![[eek]](images/BBCode/smilies/eek.gif) . What did I do wrong? ![[cry]](images/BBCode/smilies/cry.gif) .
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]](images/BBCode/smilies/lol.gif) , 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]](images/BBCode/smilies/rolleyes.gif)
I'll go and add it manually and see if that'll help, I'm sure it will ![[thumbs_up]](images/BBCode/smilies/thumbs_up.gif) Thanks Sparks. ![[wave]](images/BBCode/smilies/wave.gif) |
 |
|
|
| elmer_fudd |
 |
General Member Since: Feb 20, 2007 Posts: 125 Last: Mar 20, 2009 [view latest posts] |
|
|
|
|
| infinet |
General Member Since: Feb 4, 2008 Posts: 208 Last: Jan 23, 2013 [view latest posts] |
|
|
|
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. |
 |
|
|
| sam_fisher3000 |
 |
General Member Since: Apr 18, 2007 Posts: 816 Last: Jul 16, 2016 [view latest posts] |
|
|
 |
|
|
| infinet |
General Member Since: Feb 4, 2008 Posts: 208 Last: Jan 23, 2013 [view latest posts] |
|
|
|
|
|
|
mp_TempleCall of Duty: Mods: Multiplayer (624.12Kb)
|