2015-04-20 11:54:22 +00:00
|
|
|
/*
|
|
|
|
* Author: ACE2 Team
|
2016-01-05 07:39:29 +00:00
|
|
|
* Updates GVAR(currentHumidity)
|
2015-04-20 11:54:22 +00:00
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Arguments:
|
2015-04-20 11:54:22 +00:00
|
|
|
* Nothing
|
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Return Value:
|
2015-04-20 11:54:22 +00:00
|
|
|
* Nothing
|
2016-01-05 07:39:29 +00:00
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [] call ace_weather_fnc_updateHumidity
|
|
|
|
*
|
|
|
|
* Public: No
|
2015-04-20 11:54:22 +00:00
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-01-05 07:39:29 +00:00
|
|
|
private _month = date select 1;
|
2015-04-20 11:54:22 +00:00
|
|
|
|
2015-05-05 08:37:51 +00:00
|
|
|
GVAR(currentHumidity) = (GVAR(Humidity) select (_month - 1)) / 100;
|
2015-04-20 11:54:22 +00:00
|
|
|
|
2016-01-05 07:39:29 +00:00
|
|
|
if ((rain > 0) && {overcast > 0.7}) then {
|
2015-04-20 11:54:22 +00:00
|
|
|
GVAR(currentHumidity) = 1;
|
|
|
|
} else {
|
2016-01-05 07:39:29 +00:00
|
|
|
private _avgTemperature = ((GVAR(TempDay) select (_month - 1)) + (GVAR(TempNight) select (_month - 1))) / 2;
|
|
|
|
private _pS1 = 6.112 * exp((17.62 * _avgTemperature) / (243.12 + _avgTemperature));
|
|
|
|
private _PS2 = 6.112 * exp((17.62 * GVAR(currentTemperature)) / (243.12 + GVAR(currentTemperature)));
|
2015-04-20 11:54:22 +00:00
|
|
|
GVAR(currentHumidity) = GVAR(currentHumidity) * _PS1 / _PS2;
|
2015-04-21 18:41:50 +00:00
|
|
|
GVAR(currentHumidity) = GVAR(currentHumidity) + GVAR(humidityShift);
|
2016-05-03 00:32:44 +00:00
|
|
|
|
2015-04-22 19:16:01 +00:00
|
|
|
TRACE_1("humidityShift",GVAR(humidityShift));
|
2015-04-20 11:54:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
GVAR(currentHumidity) = 0 max GVAR(currentHumidity) min 1;
|