Set wind and rain syncing. Change ACE_wind from macro to global variable

This commit is contained in:
Nicolás Badano 2015-01-20 23:17:09 -03:00
parent 71bd34234b
commit 4a29f6a3c3
5 changed files with 15 additions and 13 deletions

View File

@ -52,7 +52,7 @@
#define ACE_NOZEROING discreteDistance[] = {}; \
discreteDistanceInitIndex = 0; \
weaponInfoType = "RscWeaponEmpty"
#define ACE_NOTURRETZEROING discreteDistance[] = {}; \
discreteDistanceInitIndex = 0; \
turretInfoType = "RscWeaponEmpty"
@ -62,7 +62,7 @@
irDistance = 300
#define ACE_LASER_DISTANCE_VANILLA irDistance = 300
#define ACE_NOLASER irLaserPos = "laser pos"; \
irLaserEnd = "laser dir"; \
irDistance = 0
@ -100,9 +100,6 @@
#define ACE_BWC ace_bwc = 1
#define ACE_wind ([] call ace_ballistic_fnc_wind)
// SCRIPTING MACROS
// Items
@ -129,7 +126,7 @@
#define KNOCKOUT ace_common_fx_fnc_knockout
#define RING ace_common_fx_fnc_ring
// Stamina
// Stamina
#define INC_MASS ace_stamina_fnc_inc_mass
// Does this work, due to BWC_CONFIG(NAME) ?
@ -164,7 +161,7 @@
}
// Addaction defines for colored text
#define ACE_TEXT_ORANGE(Text) ("<t color='#ffa500'>" + ##Text + "</t>")
#define ACE_TEXT_ORANGE(Text) ("<t color='#ffa500'>" + ##Text + "</t>")
#define ACE_TEXT_RED(Text) ("<t color='#FF0000'>" + ##Text + "</t>")
#define ACE_TEXT_GREEN(Text) ("<t color='#00FF00'>" + ##Text + "</t>")
#define ACE_TEXT_YELLOW(Text) ("<t color='#FFFF00'>" + ##Text + "</t>")

View File

@ -4,9 +4,13 @@
"ACE_WIND_PARAMS" addPublicVariableEventHandler { GVAR(wind_period_start_time) = time; };
"ACE_RAIN_PARAMS" addPublicVariableEventHandler { GVAR(rain_period_start_time) = time; };
_fnc_uptadeWind = {
simulWeatherSync;
_fnc_updateWind = {
_wind = ([] call FUNC(getWind));
ACE_wind = [_wind select 0, _wind select 1];
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;
// _pW = [_nWind select 0, _nWind 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];
};
[_fnc_uptadeWind, 1, []] call CBA_fnc_addPerFrameHandler;
[_fnc_updateWind, 1, []] call CBA_fnc_addPerFrameHandler;
_fnc_updateRain = {
if(GVAR(enableRain)) then {
@ -30,4 +34,4 @@ _fnc_updateRain = {
};
};
[_fnc_updateRain, 0, []] call CBA_fnc_addPerFrameHandler;
[_fnc_updateRain, 2, []] call CBA_fnc_addPerFrameHandler;

View File

@ -7,8 +7,9 @@ LOG(MSG_INIT);
PREP(serverController);
PREP(getWind);
ACE_wind = [0, 0];
GVAR(enableRain) = false;
GVAR(enableRain) = true;
GVAR(overcast_multiplier) = 1;

View File

@ -6,7 +6,7 @@ if(GVAR(rain_period_count) > GVAR(rain_next_period)) then {
if(overcast >= 0.7) then {
_lastRain = GVAR(current_rain);
_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) max 0.01) min 1;

View File

@ -1,6 +1,6 @@
#define COMPONENT weather
#include "\z\ace\addons\main\script_mod.hpp"
#define DEBUG_ENABLED_WEATHER
//#define DEBUG_ENABLED_WEATHER
#ifdef DEBUG_ENABLED_WEATHER
#define DEBUG_MODE_FULL
#endif