Snarkpit Articles

Adding Fog

Colour & Distance
Adding fog to your map is very simple, it only requires a small script to be done. We will presume you have a map ready for fog to be added & a .gsc file to edit.

First we need to work out the colour of the fog we want. Open the microsoft paint program (normally located in start/programs/accessories/)

Once open, click on colors/edit colors...

Article image


Now click on define custom colors & it will open a color selection pannel.

Article image


Use this to select a color that will be the same as your fog in game, I have chosen a rather odd green. Notice that in the bottom right my RGB Values have been set to 5/140/60. This is basically how much of each primary color is needed to make my green.

Article image


Now we have to re-calculate our color so that CoD can use it. CoD uses a decimal value for RGB so 100% is 1.00 & 50% is 0.50 - to re-calculate our values we need to indivudually divide them by 255 (the max amount of color possible).

Open microsoft calculator (normally located in start/programs/accessories/) & enter your red value. in this case "5". now hit the "/" key to divide, enter "255" & hit "=". From the end value take the first 3 numbers & ntoe them down.

Article image


The value we now have should be 0.01 - repeat this for the green & blue values until you have all 3 values written down. In this case 0.01 0.54 0.23.

Now open your .gsc script file & enter the following script:

setCullFog (start distance, end distance, R, G, B, Transparency);

so for example my green fog, starting from where the player stands & ending at 1024 units away with no transparency would look roughly like this:

Article image


Now test your map & look at your (hopefully not oddly coloured) fog :)

Article image

Discussion

Posted by TanK on Mon Aug 2nd 2004 at 6:08am

Can anyone tell me how to MAKE a .gsc file? I mean, it can't just be that you make a .txt file, rename it to mymap.gsc and POOF! You got a .gsc file! Do I need a program or anything?
Posted by Skeletor on Mon Mar 29th 2004 at 10:05pm

Posted by pepper on Fri Mar 19th 2004 at 6:38pm

i really wish i had call of duty
Posted by KoRnFlakes on Fri Mar 5th 2004 at 1:08pm
[Author]

If you make a bold or funny statement its likely to stay in peoples minds, making it green meant it was easier to understand & no fog isnt always grey, its various shades during whatever time & in the desert a yellow would be more suited. There is a map called fivepoints that used a dark blue & pulled it off well for night time.
Posted by matt on Fri Mar 5th 2004 at 12:19pm

Shouldn't fog be grey?