Jump to content

Recommended Posts

Posted (edited)

First, create a trigger "4 MISSION START", no conditions, do script:

time = 0
visibility = math.random(500, 20000) -- random number on how low the visibility will be in feet
thickness = math.random(800, 4000) -- random number on the thickness of the fog
world.weather.setFogAnimation({ {time, visibility, thickness} })

Then create a trigger "2 REPETETIVE ACTION", no conditions, do script:

time = time - 1
if time <= 0 then
    time = math.random(100, 1800) -- random number in seconds to which the new setting should occur
    visibility = math.random(500, 20000) -- random number on how low the visibility will be in feet
    thickness = math.random(800, 4000) -- random number on the thickness of the fog
    world.weather.setFogAnimation({ {time, visibility, thickness} }) -- sets the new fog
end
-- trigger.action.outText("time : " .. time .. "\nvis : " .. visibility .. "\nthickness : " .. thickness, 30, true) -- debug purposes

Obviously, you can play with the random number limits.

Edited by d0ppler
  • Like 1
  • Thanks 3

A-10C, AV-8B, Ka-50, F-14B, F-16C, F-5E, F/A-18C, L-39, Mi-8, MiG-21, MiG-29, SA34, Spitfire, Su-27, Su-33, UH-1H

  • d0ppler changed the title to Create random and dynamic fog in your mission!
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...