mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
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:
parent
3f61a41be3
commit
65be883eea
@ -20,8 +20,8 @@ missionNamespace setVariable [QGVAR(currentOvercast), overcast, true];
|
|||||||
[] call FUNC(updateTemperature);
|
[] call FUNC(updateTemperature);
|
||||||
[] call FUNC(updateHumidity);
|
[] call FUNC(updateHumidity);
|
||||||
|
|
||||||
// Wind simulation
|
// Wind simulation, take API for temporarily disabling into account along with setting
|
||||||
if (GVAR(windSimulation) && CBA_missionTime > GVAR(next_wind_udpate)) then {
|
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_direction) = GVAR(next_wind_direction);
|
||||||
GVAR(current_wind_speed) = GVAR(next_wind_speed);
|
GVAR(current_wind_speed) = GVAR(next_wind_speed);
|
||||||
|
@ -15,6 +15,9 @@
|
|||||||
* Public: No
|
* 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 _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];
|
private _direction = linearConversion [GVAR(last_wind_update), GVAR(next_wind_udpate), CBA_missionTime, GVAR(current_wind_direction), GVAR(next_wind_direction), true];
|
||||||
|
|
||||||
|
@ -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.
|
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.
|
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`.
|
Loading…
Reference in New Issue
Block a user