In the editor set the values for color, and distance fog to make a gradual increase and decrease fog.
But instead of the normal effect of just changing the color, and all around not visible, not very clear... Brought to the screen the data - information is correct, 0 effect.
How can I normalize the behavior of the fog that was all in the editor?
-- LUA Script - precede every function and global member with lowercase name of script
local delay = 1000
local nightdelay = 5000
local ambienceintensitymax = 34
local ambienceintensitymin = 0
local ambienceintensity = 34
local fogdistancemax = 27
local fogdistancemin = 2
local fogdistance = 27
local fogredmax = 100
local fogredmin = 0
local fogred = 100
local foggreenmax = 100
local foggreenmin = 0
local foggreen = 100
local fogbluemax = 100
local fogbluemin = 0
local fogblue = 100
local state = {}
function daynight_init(e)
state[e] = "day"
ambienceintensity = ambienceintensitymax
fogdistance = fogdistancemax
fogred = fogredmax
foggreen = foggreenmax
fogblue = fogbluemax
SetAmbienceIntensity(ambienceintensity)
SetFogDistance(fogdistance)
SetFogRed(fogred)
SetFogGreen(foggreen)
SetFogBlue(fogblue)
end
function daynight_main(e)
Text(1, 5, 2, state[e])
Text(1, 8, 2, "Timer"..GetTimer(e))
Text(1, 11, 2, "FogDist"..fogdistance)
Text(1, 14, 2, "Red"..fogred)
Text(1, 17, 2, "Green"..foggreen)
Text(1, 20, 2, "Blue"..fogblue)
if GetTimer(e) > delay and state[e] ~= "night" then
if state[e] == "day" then
if ambienceintensity > ambienceintensitymin then
ambienceintensity = ambienceintensity - 1
SetAmbienceIntensity(ambienceintensity)
if fogdistance > fogdistancemin then
fogdistance = fogdistance - 1
SetFogDistance(fogdistance)
end
if fogred > fogredmin and foggreen > foggreenmin and fogblue > fogbluemin then
fogred = fogred - 3
foggreen = foggreen - 3
fogblue = fogblue - 3
SetFogRed(fogred)
SetFogGreen(foggreen)
SetFogBlue(fogblue)
end
else
state[e] = "night"
end
end
if state[e] == "night-day" then
if ambienceintensity < ambienceintensitymax then
ambienceintensity = ambienceintensity + 1
SetAmbienceIntensity(ambienceintensity)
if fogdistance < fogdistancemax then
fogdistance = fogdistance + 1
SetFogDistance(fogdistance)
end
if fogred < fogredmax and foggreen < foggreenmax and fogblue < fogbluemax then
fogred = fogred + 3
foggreen = foggreen + 3
fogblue = fogblue + 3
SetFogRed(fogred)
SetFogGreen(foggreen)
SetFogBlue(fogblue)
end
else
state[e] = "day"
end
end
StartTimer(e)
end
if state[e] == "night" then
if GetTimer(e) > nightdelay then
state[e] = "night-day"
StartTimer(e)
end
end
end
Create a game - it's like to start a new universe where there is only you and solitude with the environment