mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Set wind and rain syncing. Change ACE_wind from macro to global variable
This commit is contained in:
parent
71bd34234b
commit
4a29f6a3c3
@ -100,9 +100,6 @@
|
|||||||
|
|
||||||
#define ACE_BWC ace_bwc = 1
|
#define ACE_BWC ace_bwc = 1
|
||||||
|
|
||||||
#define ACE_wind ([] call ace_ballistic_fnc_wind)
|
|
||||||
|
|
||||||
|
|
||||||
// SCRIPTING MACROS
|
// SCRIPTING MACROS
|
||||||
|
|
||||||
// Items
|
// Items
|
||||||
|
@ -4,9 +4,13 @@
|
|||||||
"ACE_WIND_PARAMS" addPublicVariableEventHandler { GVAR(wind_period_start_time) = time; };
|
"ACE_WIND_PARAMS" addPublicVariableEventHandler { GVAR(wind_period_start_time) = time; };
|
||||||
"ACE_RAIN_PARAMS" addPublicVariableEventHandler { GVAR(rain_period_start_time) = time; };
|
"ACE_RAIN_PARAMS" addPublicVariableEventHandler { GVAR(rain_period_start_time) = time; };
|
||||||
|
|
||||||
_fnc_uptadeWind = {
|
simulWeatherSync;
|
||||||
|
_fnc_updateWind = {
|
||||||
_wind = ([] call FUNC(getWind));
|
_wind = ([] call FUNC(getWind));
|
||||||
|
ACE_wind = [_wind select 0, _wind select 1];
|
||||||
setWind [_wind select 0, _wind select 1, true];
|
setWind [_wind select 0, _wind select 1, true];
|
||||||
|
2 setGusts 0;
|
||||||
|
//systemChat format ["w: %1 %2, ACE_wind: %1 %2", [wind select 0, wind select 1, ACE_wind select 0, ACE_wind select 1]];
|
||||||
// _nWind = wind;
|
// _nWind = wind;
|
||||||
// _pW = [_nWind select 0, _nWind select 1, 0] call CBA_fnc_vect2polar;
|
// _pW = [_nWind select 0, _nWind select 1, 0] call CBA_fnc_vect2polar;
|
||||||
// _pAW = [_wind select 0, _wind select 1, 0] call CBA_fnc_vect2polar;
|
// _pAW = [_wind select 0, _wind select 1, 0] call CBA_fnc_vect2polar;
|
||||||
@ -14,7 +18,7 @@ _fnc_uptadeWind = {
|
|||||||
// diag_log text format["ACE_WIND,%1,%2,%3,%4,%5", time, _pW select 1, _pw select 0, _pAW select 1, _pAW select 0];
|
// diag_log text format["ACE_WIND,%1,%2,%3,%4,%5", time, _pW select 1, _pw select 0, _pAW select 1, _pAW select 0];
|
||||||
};
|
};
|
||||||
|
|
||||||
[_fnc_uptadeWind, 1, []] call CBA_fnc_addPerFrameHandler;
|
[_fnc_updateWind, 1, []] call CBA_fnc_addPerFrameHandler;
|
||||||
|
|
||||||
_fnc_updateRain = {
|
_fnc_updateRain = {
|
||||||
if(GVAR(enableRain)) then {
|
if(GVAR(enableRain)) then {
|
||||||
@ -30,4 +34,4 @@ _fnc_updateRain = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
[_fnc_updateRain, 0, []] call CBA_fnc_addPerFrameHandler;
|
[_fnc_updateRain, 2, []] call CBA_fnc_addPerFrameHandler;
|
@ -7,8 +7,9 @@ LOG(MSG_INIT);
|
|||||||
PREP(serverController);
|
PREP(serverController);
|
||||||
PREP(getWind);
|
PREP(getWind);
|
||||||
|
|
||||||
|
ACE_wind = [0, 0];
|
||||||
|
|
||||||
GVAR(enableRain) = false;
|
GVAR(enableRain) = true;
|
||||||
|
|
||||||
GVAR(overcast_multiplier) = 1;
|
GVAR(overcast_multiplier) = 1;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ if(GVAR(rain_period_count) > GVAR(rain_next_period)) then {
|
|||||||
if(overcast >= 0.7) then {
|
if(overcast >= 0.7) then {
|
||||||
_lastRain = GVAR(current_rain);
|
_lastRain = GVAR(current_rain);
|
||||||
_rainOverCast = ((overcast-0.7)/0.3);
|
_rainOverCast = ((overcast-0.7)/0.3);
|
||||||
GVAR(rain_next_period) = ceil((1+random(10))/(GVAR(overcast_multiplier)));
|
GVAR(rain_next_period) = ceil((1+random(10))/GVAR(overcast_multiplier));
|
||||||
|
|
||||||
GVAR(current_rain) = (GVAR(current_rain)+(((GVAR(current_rain)))*((_rainOverCast*(GVAR(overcast_multiplier)))/8)*GVAR(rain_current_range)));
|
GVAR(current_rain) = (GVAR(current_rain)+(((GVAR(current_rain)))*((_rainOverCast*(GVAR(overcast_multiplier)))/8)*GVAR(rain_current_range)));
|
||||||
GVAR(current_rain) = (GVAR(current_rain) max 0.01) min 1;
|
GVAR(current_rain) = (GVAR(current_rain) max 0.01) min 1;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#define COMPONENT weather
|
#define COMPONENT weather
|
||||||
#include "\z\ace\addons\main\script_mod.hpp"
|
#include "\z\ace\addons\main\script_mod.hpp"
|
||||||
#define DEBUG_ENABLED_WEATHER
|
//#define DEBUG_ENABLED_WEATHER
|
||||||
#ifdef DEBUG_ENABLED_WEATHER
|
#ifdef DEBUG_ENABLED_WEATHER
|
||||||
#define DEBUG_MODE_FULL
|
#define DEBUG_MODE_FULL
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user