Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weather - Winter Terrain Temperatures #9943

Merged
merged 26 commits into from
Apr 10, 2024
Merged
Changes from 21 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a211f70
a -> an
OverlordZorn May 8, 2023
1b492a9
Merge branch 'master' of https://github.com/PulsarNeutronStar/ACE3
OverlordZorn Sep 18, 2023
09b48e9
Merge branch 'acemod:master' into master
OverlordZorn Apr 9, 2024
282d008
Added last resort catch for winter maps to define suitable temps
OverlordZorn Apr 9, 2024
9ef5250
removed debug line
OverlordZorn Apr 9, 2024
38ca7dc
purge :soap:
OverlordZorn Apr 9, 2024
58a6a90
added check for "snow" in raintexture
OverlordZorn Apr 9, 2024
e4d7c06
cleaned up conditions
OverlordZorn Apr 9, 2024
fd05bcd
Update arma-3-scheduler-and-our-practices.md
OverlordZorn Apr 9, 2024
8ce140c
isNull && {}
OverlordZorn Apr 9, 2024
84a1e37
Merge branch 'weather-more-mapdata-winter' of https://github.com/Over…
OverlordZorn Apr 9, 2024
df8e0b4
Update fnc_getMapData.sqf
OverlordZorn Apr 9, 2024
ee272ef
Update fnc_getMapData.sqf
OverlordZorn Apr 9, 2024
0271dc1
Update fnc_getMapData.sqf
OverlordZorn Apr 9, 2024
5ab66bf
changed order in condition checks and indentation
OverlordZorn Apr 9, 2024
62471c9
not so lazy
OverlordZorn Apr 9, 2024
41cff48
deep config lookup -> _cfg
OverlordZorn Apr 9, 2024
07439e4
comment
OverlordZorn Apr 9, 2024
4908b6e
removed accidental empty line
OverlordZorn Apr 9, 2024
8fb4423
:roller_coaster:
OverlordZorn Apr 9, 2024
a57d114
Update fnc_getMapData.sqf
OverlordZorn Apr 9, 2024
cf5a2bb
Revert "Update fnc_getMapData.sqf"
OverlordZorn Apr 9, 2024
f173097
Update addons/weather/functions/fnc_getMapData.sqf
OverlordZorn Apr 9, 2024
de28754
Update addons/weather/functions/fnc_getMapData.sqf
OverlordZorn Apr 9, 2024
5fa9309
Update addons/weather/functions/fnc_getMapData.sqf
OverlordZorn Apr 9, 2024
6fa4ea9
then -> exitWith
OverlordZorn Apr 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 24 additions & 23 deletions addons/weather/functions/fnc_getMapData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,17 @@ GVAR(currentHumidity) = 0;
GVAR(currentOvercast) = 0;

// Get all non inherited arrays to filter maps that inherit from Stratis/Altis/Tanoa
private _nonInheritedArrays = configProperties [configFile >> "CfgWorlds" >> _worldName, "isArray _x", false];
private _cfgPath = (configFile >> "CfgWorlds" >> _worldName);
OverlordZorn marked this conversation as resolved.
Show resolved Hide resolved
private _nonInheritedArrays = configProperties [_cfgPath, "isArray _x", false];
// And check if any custom non-inherited weather is defined through config and use that if so
if ((configFile >> "CfgWorlds" >> _worldName >> "ACE_TempDay") in _nonInheritedArrays) exitWith {
if (isArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_TempDay")) then {
GVAR(TempDay) = getArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_TempDay");
};
if (isArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_TempNight")) then {
GVAR(TempNight) = getArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_TempNight");
};
if (isArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_Humidity")) then {
GVAR(Humidity) = getArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_Humidity");
};
if (isArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_WindSpeedMin")) then {
GVAR(WindSpeedMin) = getArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_WindSpeedMin");
};
if (isArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_WindSpeedMean")) then {
GVAR(WindSpeedMean) = getArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_WindSpeedMean");
};
if (isArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_WindSpeedMax")) then {
GVAR(WindSpeedMax) = getArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_WindSpeedMax");
};
if (isArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_WindDirectionProbabilities")) then {
GVAR(WindDirectionProbabilities) = getArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_WindDirectionProbabilities");
};
if ((_cfgPath >> "ACE_TempDay") in _nonInheritedArrays) exitWith {
if (isArray (_cfgPath >> "ACE_TempDay")) then { GVAR(TempDay) = getArray (_cfgPath >> "ACE_TempDay");};
OverlordZorn marked this conversation as resolved.
Show resolved Hide resolved
if (isArray (_cfgPath >> "ACE_TempNight")) then { GVAR(TempNight) = getArray (_cfgPath >> "ACE_TempNight");};
if (isArray (_cfgPath >> "ACE_Humidity")) then { GVAR(Humidity) = getArray (_cfgPath >> "ACE_Humidity");};
if (isArray (_cfgPath >> "ACE_WindSpeedMin")) then { GVAR(WindSpeedMin) = getArray (_cfgPath >> "ACE_WindSpeedMin");};
if (isArray (_cfgPath >> "ACE_WindSpeedMax")) then { GVAR(WindSpeedMax) = getArray (_cfgPath >> "ACE_WindSpeedMax");};
if (isArray (_cfgPath >> "ACE_WindSpeedMean")) then { GVAR(WindSpeedMean) = getArray (_cfgPath >> "ACE_WindSpeedMean");};
if (isArray (_cfgPath >> "ACE_WindDirectionProbabilities")) then { GVAR(WindDirectionProbabilities) = getArray (_cfgPath >> "ACE_WindDirectionProbabilities");};
};

// Check if the map is among the most popular
Expand Down Expand Up @@ -239,3 +226,17 @@ if (_worldName in ["kunduz"]) exitWith {
[0.04, 0.02, 0.05, 0.14, 0.19, 0.07, 0.10, 0.07] // December
];
};


// Catches any "Winter" Map that hasnt been defined otherwise - this should stay at the end of the file
// Values are not based on any RL reference since the snow terrain textures persists regardless the date
private _cfgPath = (_cfgPath >> "RainParticles");
OverlordZorn marked this conversation as resolved.
Show resolved Hide resolved
if (
"winter" in _worldName ||
{"snow" in getText (_cfgPath >> "rainDropTexture")} ||
{!isNull (_cfgPath >> "snow") && { getNumber (_cfgPath2 >> "snow") != 0 }}
OverlordZorn marked this conversation as resolved.
Show resolved Hide resolved
) exitWith {
GVAR(TempDay) = [-10,-9,-8,-7,-6,-5,-6,-7,-8,-9,-10,-11];
GVAR(TempNight) = [-15,-14,-13,-12,-11,-10,-9,-10,-11,-12,-13,-17];
GVAR(Humidity) = [82, 80, 81, 82, 83, 82, 81, 82, 83, 82, 83, 82];
};