Difference between revisions of "DCS func setFogAnimation"

From DCS World Wiki - Hoggitworld.com
(Created page with "{{Template:dcs_funcs |fName= setFogAnimation |vNum= 2.9.10 |par1= world.weather |par2= |par3= |par4= |desc= Uses data from the passed table to...")
 
 
(One intermediate revision by the same user not shown)
Line 26: Line 26:
  
 
The speed at which the visibility and thickness changes is based on the time between keys and the values that visibility and thickness are being set to.  
 
The speed at which the visibility and thickness changes is based on the time between keys and the values that visibility and thickness are being set to.  
 +
 +
 +
When the function is passed an empty table {} or nil the fog animation will be discarded and whatever the current thickness and visibility are set to will remain.
  
 
|rtnType=  
 
|rtnType=  
Line 33: Line 36:
 
|reqType1= table
 
|reqType1= table
  
|reqName1= fogAnimationKeys
+
|reqName1= fogAnimationKeys/discard
  
 
|reqType2=  
 
|reqType2=  
Line 52: Line 55:
  
  
The following will take 1 hour to get to the set fog setting, maintain that fog setting for another hour, then lightly removes  
+
The following will take 1 hour to get to the first fog setting, it will maintain that fog setting for another hour, then lightly removes the fog over the 2nd and 3rd hour, the completely removes the fog after 3 hours and 3 minutes from when the function was called.
  
 
   world.weather.setFogAnimation({
 
   world.weather.setFogAnimation({
Line 61: Line 64:
 
   })
 
   })
  
 +
The following will discard the animation resulting in whatever the current fog settings are to become static.
 +
 +
  world.weather.setFogAnimation({})
  
  
Line 67: Line 73:
  
 
|notes=  
 
|notes=  
 +
 +
 
}}
 
}}
  
 
[[Category:Singleton Functions|setFogAnimation]]
 
[[Category:Singleton Functions|setFogAnimation]]
 
[[Category:Game Patch 2.9.10|setFogAnimation]]
 
[[Category:Game Patch 2.9.10|setFogAnimation]]

Latest revision as of 05:29, 2 December 2024

Scripting Root

Envrioment: Mission Scripting
Function: setFogAnimation Added with: 2.9.10
Member Of: world.weather
Syntax: world.weather.setFogAnimation(table fogAnimationKeys/discard )
Description: Uses data from the passed table to change the fog visibility and thickness over a desired timeframe. This allows for a gradual increase/decrease of fog values rather than abruptly applying the values.

Animation Key Format: {time, visibility, thickness}

Time: in seconds 0 to infinity

Time is relative to when the function was called. Time value for each key must be larger than the previous key. If time is set to 0 then the fog will be applied to the corresponding visibility and thickness values at that key. Any time value greater than 0 will result in the current fog being inherited and changed to the first key.

Visibility: in meters 100 to 100000

Thickness: in meters 100 to 5000

The speed at which the visibility and thickness changes is based on the time between keys and the values that visibility and thickness are being set to.


When the function is passed an empty table {} or nil the fog animation will be discarded and whatever the current thickness and visibility are set to will remain.


Return Value:
Return Example:
Examples: The following will set the fog in the mission to disappear in 1 minute.
  world.weather.setFogAnimation({ {60, 0, 0} })


The following will take 1 hour to get to the first fog setting, it will maintain that fog setting for another hour, then lightly removes the fog over the 2nd and 3rd hour, the completely removes the fog after 3 hours and 3 minutes from when the function was called.

  world.weather.setFogAnimation({
    {3600, 10000, 3000},    -- one hour to get to that fog setting
    {7200, 10000, 3000},    -- will maintain for 2 hours
    {10800, 20000, 2000},   -- at 3 hours visibility will have been increased while thickness decreases slightly
    {12600, 0, 0},          -- at 3:30 after the function was called the fog will be completely removed. 
  })

The following will discard the animation resulting in whatever the current fog settings are to become static.

  world.weather.setFogAnimation({})
Related Functions: World Functions: addEventHandler, removeEventHandler, getPlayer, getAirbases, searchObjects, getMarkPanels, removeJunk

world.weather getFogThickness, setFogThickness, getFogVisibilityDistance, setFogVisibilityDistance, setFogAnimation

Notes: