mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
e2ac18a05d
* advanced_ballistics * advanced_fatigue * advanced_throwing * ai * aircraft * arsenal * atragmx * attach * backpacks * ballistics * captives * cargo * chemlights * common * concertina_wire * cookoff * dagr * disarming * disposable * dogtags * dragging * explosives * fastroping * fcs * finger * frag * gestures * gforces * goggles * grenades * gunbag * hearing * hitreactions * huntir * interact_menu * interaction * inventory * kestrel4500 * laser * laserpointer * logistics_uavbattery * logistics_wirecutter * magazinerepack * map * map_gestures * maptools * markers * medical * medical_ai * medical_blood * medical_menu * microdagr * minedetector * missileguidance * missionmodules * mk6mortar * modules * movement * nametags * nightvision * nlaw * optics * optionsmenu * overheating * overpressure * parachute * pylons * quickmount * rangecard * rearm * recoil * refuel * reload * reloadlaunchers * repair * respawn * safemode * sandbag * scopes * slideshow * spectator * spottingscope * switchunits * tacticalladder * tagging * trenches * tripod * ui * vector * vehiclelock * vehicles * viewdistance * weaponselect * weather * winddeflection * yardage450 * zeus * arsenal defines.hpp * optionals * DEBUG_MODE_FULL 1 * DEBUG_MODE_FULL 2 * Manual fixes * Add SQF Validator check for #include after block comment * explosives fnc_openTimerUI * fix uniqueItems
64 lines
2.2 KiB
Plaintext
64 lines
2.2 KiB
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: Ruthberg
|
|
* Inits the wind variables on the server (on mission start)
|
|
*
|
|
* Arguments:
|
|
* None
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [] call ace_weather_fnc_initWind
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
private _month = date select 1;
|
|
private _windDirectionProbabilities = GVAR(WindDirectionProbabilities) select (_month - 1);
|
|
|
|
GVAR(wind_direction_reference) = random 360;
|
|
private _sum = 0;
|
|
for "_i" from 0 to 7 do {
|
|
_sum = _sum + (_windDirectionProbabilities select _i);
|
|
};
|
|
private _rand = random _sum;
|
|
private _csum = [0, 0, 0, 0, 0, 0, 0, 0];
|
|
for "_i" from 0 to 7 do {
|
|
for "_j" from 0 to _i do {
|
|
_csum set [_i, (_csum select _i) + (_windDirectionProbabilities select _j)];
|
|
};
|
|
};
|
|
private _index = 0;
|
|
for "_i" from 0 to 7 do {
|
|
if (_rand > (_csum select _i)) then {
|
|
_index = _index + 1;
|
|
};
|
|
};
|
|
GVAR(wind_direction_reference) = 45 * _index;
|
|
|
|
GVAR(wind_mean_dir) = GVAR(wind_direction_reference);
|
|
GVAR(wind_direction_reference) = GVAR(wind_direction_reference) + (random 22.5) - (random 22.5);
|
|
GVAR(wind_direction_reference) = (360 + GVAR(wind_direction_reference)) % 360;
|
|
|
|
GVAR(min_wind_speed) = GVAR(WindSpeedMin) select (_month - 1);
|
|
GVAR(min_wind_speed) = (GVAR(min_wind_speed) select 0) + (random (GVAR(min_wind_speed) select 1)) - (random (GVAR(min_wind_speed) select 1));
|
|
GVAR(min_wind_speed) = 0 max GVAR(min_wind_speed);
|
|
GVAR(mean_wind_speed) = GVAR(WindSpeedMean) select (_month - 1);
|
|
GVAR(max_wind_speed) = GVAR(WindSpeedMax) select (_month - 1);
|
|
GVAR(max_wind_speed) = (GVAR(max_wind_speed) select 0) + (random (GVAR(max_wind_speed) select 1)) - (random (GVAR(max_wind_speed) select 1));
|
|
GVAR(max_wind_speed) = 0 max GVAR(max_wind_speed);
|
|
|
|
GVAR(wind_upper_span) = GVAR(max_wind_speed) - GVAR(mean_wind_speed);
|
|
GVAR(wind_lower_span) = GVAR(min_wind_speed) - GVAR(mean_wind_speed);
|
|
|
|
GVAR(current_wind_direction) = GVAR(wind_direction_reference);
|
|
GVAR(next_wind_direction) = GVAR(current_wind_direction);
|
|
|
|
GVAR(current_wind_speed) = GVAR(min_wind_speed) + (GVAR(max_wind_speed) - GVAR(min_wind_speed)) * (random 1);
|
|
GVAR(next_wind_speed) = GVAR(current_wind_speed);
|
|
|
|
GVAR(last_wind_update) = 0;
|
|
GVAR(next_wind_udpate) = 0;
|