Weather - Add variable to temporarily pause wind simulation (#9057)

* added exit condition

This would enable mission maker to temporarily disable the execution of setWind every second.
Currently, a temporary pause isnt possible.

* Update weather-framework.md

* Apply suggestions from code review

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* actually disable wind simulation

---------

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: LinkIsGrim <salluci.lovi@gmail.com>
This commit is contained in:
Mr. Zorn 2023-11-23 19:16:55 +01:00 committed by GitHub
parent 3f61a41be3
commit 65be883eea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -20,8 +20,8 @@ missionNamespace setVariable [QGVAR(currentOvercast), overcast, true];
[] call FUNC(updateTemperature);
[] call FUNC(updateHumidity);
// Wind simulation
if (GVAR(windSimulation) && CBA_missionTime > GVAR(next_wind_udpate)) then {
// Wind simulation, take API for temporarily disabling into account along with setting
if (GVAR(windSimulation) && {!(missionNamespace getVariable [QGVAR(disableWindSimulation), false])} && {CBA_missionTime > GVAR(next_wind_udpate)}) then {
GVAR(current_wind_direction) = GVAR(next_wind_direction);
GVAR(current_wind_speed) = GVAR(next_wind_speed);

View File

@ -15,6 +15,9 @@
* Public: No
*/
// Public API to temporarily disable wind simulation
if (missionNamespace getVariable [QGVAR(disableWindSimulation), false]) exitWith {};
private _speed = linearConversion [GVAR(last_wind_update), GVAR(next_wind_udpate), CBA_missionTime, GVAR(current_wind_speed), GVAR(next_wind_speed), true];
private _direction = linearConversion [GVAR(last_wind_update), GVAR(next_wind_udpate), CBA_missionTime, GVAR(current_wind_direction), GVAR(next_wind_direction), true];

View File

@ -19,3 +19,10 @@ ACE3 Weather extends the existing weather by temperature, humidity and air press
The additional wind simulation, which is also influenced by the season and the geographical location, can be deactivated if necessary.
Cloud cover, rain and fog can still be set via the mission settings.
## 2. Wind Simulation
## 2.1 Temporarily Pause Wind Simulation
When Wind Simulation is enabled at mission start, it can be temporarily disabled by setting `ace_weather_disableWindSimulation = true`. To reenable wind simulation, the variable must either be set to `false` or `nil`.