Call of Duty 5: Fog: Difference between revisions

From COD Modding & Mapping Wiki
Jump to navigation Jump to search
(New page: Image:Nutshell.png There are now 2 type of scripted fog in COD:WW, here is a quick tutorial on how to use them and what they do. ==SetExpFog== ===Theory=== This function has been pr...)
 
Line 7: Line 7:
This function has been present in previous COD games, it creates an exponential fog on your level:
This function has been present in previous COD games, it creates an exponential fog on your level:


With:                                        Without:
With:                                        Without:<br><br>
[[Image:setexpfog_on.jpg|500px]] [[Image:setexpfog_off.jpg|500px]]
[[Image:setexpfog_on.jpg|350px]] [[Image:setexpfog_off.jpg|350px]]
 


*The functions is of this form:
*The functions is of this form:
Line 21: Line 22:
*<font color="yellow"><green></font> The red component of the fog as a value between 0.0 and 1.0  
*<font color="yellow"><green></font> The red component of the fog as a value between 0.0 and 1.0  
*<font color="yellow"><blue></font> The red component of the fog as a value between 0.0 and 1.0  
*<font color="yellow"><blue></font> The red component of the fog as a value between 0.0 and 1.0  
*<font color="yellow"><transition time></font> transition time in seconds  
*<font color="yellow"><transition time></font> transition time in seconds


===Implementation in Levels===
===Implementation in Levels===

Revision as of 19:38, 30 November 2008

There are now 2 type of scripted fog in COD:WW, here is a quick tutorial on how to use them and what they do.

SetExpFog

Theory

This function has been present in previous COD games, it creates an exponential fog on your level:

With: Without:


  • The functions is of this form:
SetExpFog( <startDist>, <halfwayDist>, <red>, <green>, <blue>, <transition time> )
  • Parameters:
  • <startDist> The distance, in world units, at which the fog begins.
  • <halfwayDist> The distance, beyond the startDist, at which the scene will be 50% fogged.
  • <red> The red component of the fog as a value between 0.0 and 1.0
  • <green> The red component of the fog as a value between 0.0 and 1.0
  • <blue> The red component of the fog as a value between 0.0 and 1.0
  • <transition time> transition time in seconds

Implementation in Levels

  • To add SetExpFog to your level open up your Map GSC and anywhere after maps\mp\_load::main() add this:
setExpFog(300, 1800, 0.4, 0.425, 0.44, 0.0);
  • Replace the values to your liking of course (Values above are the one used in the example pictures on top)
 SetExpFog is the function used to create Nightmode in many mods for COD4.

SetVolFog

Theory

This function is new to COD games, it creates an volumetric fog on your level. Main difference with the above SetExpFog is that SetVolFog has 2 extra parameters for the height of the fog.

With: Without:

  • The functions is of this form:
setVolFog(<startDist>, <halfwayDist>, <halfwayHeight>, <baseHeight>, <red>, <green>, <blue>, <transition time>)
  • Parameters:
  • <startDist> The distance, in world units, at which the fog begins.
  • <halfwayDist> The distance, beyond the startDist, at which the scene will be 50% fogged.
  • <halfwayHeight> The height, in world units, at which the fog will be fogged
  • <baseHeight> The height, in world units, at which the fog will begins
  • <red> The red component of the fog as a value between 0.0 and 1.0
  • <green> The red component of the fog as a value between 0.0 and 1.0
  • <blue> The red component of the fog as a value between 0.0 and 1.0
  • <transition time> transition time in seconds

Implementation in Levels

  • To add SetExpFog to your level open up your Map GSC and anywhere after maps\mp\_load::main() add this:
setVolFog(300, 1800, 0, 0, 0.4, 0.425, 0.44, 0.0);
  • Replace the values to your liking of course (Values above are the one used in the example pictures on top)