Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Get passed values from Description.ext
- _DAP_time = "DAP_timeOfDay" call BIS_fnc_getParamValue;
- _DAP_weather = "DAP_overcast" call BIS_fnc_getParamValue;
- _DAP_fogAmt = "DAP_fog" call BIS_fnc_getParamValue;
- _DAP_rain = "DAP_rain" call BIS_fnc_getParamValue;
- _DAP_windStr = "DAP_windStrength" call BIS_fnc_getParamValue;
- _DAP_windFrc = "DAP_windForce" call BIS_fnc_getParamValue;
- _DAP_windGst = "DAP_windGusts" call BIS_fnc_getParamValue;
- _DAP_lightnings = "DAP_lightning" call BIS_fnc_getParamValue;
- _DAP_waveInt = "DAP_waves" call BIS_fnc_getParamValue;
- _DAP_refresh = "DAP_refresh" call BIS_fnc_getParamValue;
- diag_log format ["_DAP_weather fetched from description.ext: %1", _DAP_weather];
- // Get current system time
- _systemTime = systemTime;
- _year = _systemTime select 0;
- _month = _systemTime select 1;
- _day = _systemTime select 2;
- _hour = (_systemTime select 3) + 1;
- _minute = _systemTime select 4;
- // Handle Weather parameter
- if (_DAP_weather == 2) then {
- _randomWeather = [0, 0.25, 0.50, 0.75, 1] call BIS_fnc_selectRandom;
- [-24] remoteExec ["skipTime", 0];
- [86400, _randomWeather] remoteExec ["setOvercast", 0];
- [24] remoteExec ["skipTime", 0];
- [_randomWeather] remoteExec ["simulSetHumidity", 0];
- 0 = [] spawn { sleep 0.1; simulWeatherSync;};
- } else {
- [-24] remoteExec ["skipTime", 0];
- [86400,_DAP_weather] remoteExec ["setOvercast", 0];
- [24] remoteExec ["skipTime", 0];
- [_DAP_weather] remoteExec ["simulSetHumidity", 0];
- 0 = [] spawn { sleep 0.1; simulWeatherSync;};
- [_DAP_weather, _DAP_refresh] spawn {
- params ["_DAP_weather", "_DAP_refresh"];
- while {true} do {
- [0,_DAP_weather] remoteExec ["setOvercast", 0];
- sleep _DAP_refresh;
- };
- };
- };
- // Handle Fog parameter
- if (_DAP_fogAmt == 2) then {
- _randomFog = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0.10, 0.25, 0.50, 0.65, 0.75] call BIS_fnc_selectRandom;
- [0, _randomFog] remoteExec ["setFog", 0];
- [999999, _randomFog] remoteExec ["setFog", 0];
- } else {
- [0, _DAP_fogAmt] remoteExec ["setFog", 0];
- [999999, _DAP_fogAmt] remoteExec ["setFog", 0];
- [_DAP_fogAmt, _DAP_refresh] spawn {
- params ["_DAP_fogAmt", "_DAP_refresh"];
- while {true} do {
- [0, _DAP_fogAmt] remoteExec ["setFog", 0];
- sleep _DAP_refresh;
- };
- };
- };
- // Handle Rain parameter
- switch (_DAP_rain) do {
- case 2: {
- _randomRain = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.25, 0.50, 0.75, 1] call BIS_fnc_selectRandom;
- [0, _randomRain] remoteExec ["setRain", 0];
- [_randomRain] remoteExec ["setHumidity", 0];
- [_randomRain] remoteExec ["simulSetHumidity", 0];
- };
- default {
- [_DAP_rain] remoteExec ["setHumidity", 0];
- [0, _DAP_rain] remoteExec ["setRain", 0];
- [_DAP_rain, _DAP_refresh] spawn {
- params ["_DAP_rain", "_DAP_refresh"];
- while {true} do {
- [_DAP_rain] remoteExec ["setHumidity", 0];
- [0, _DAP_rain] remoteExec ["setRain", 0];
- sleep _DAP_refresh;
- };
- };
- };
- case 3: {
- [0, 1] remoteExec ["setRain", 0];
- [0, 0.1] remoteExec ["setFog", 0];
- [0.9] remoteExec ["setHumidity", 0];
- [[false, true]] remoteExec ["enableEnvironment", 0];
- [
- [
- "a3\data_f\snowflake4_ca.paa",
- 4,
- 0.01,
- 25,
- 0.05,
- 2.5,
- 0.5,
- 0.5,
- 0.07,
- 0.07,
- [1, 1, 1, 0.5],
- 0.0,
- 0.2,
- 0.5,
- 0.5,
- true,
- false
- ]
- ] remoteExec ["BIS_fnc_setRain", 0];
- [_DAP_refresh] spawn {
- params ["_DAP_refresh"];
- while {true} do {
- [0, 1] remoteExec ["setRain", 0];
- [0, 0.1] remoteExec ["setFog", 0];
- [0.9] remoteExec ["setHumidity", 0];
- [
- [
- "a3\data_f\snowflake4_ca.paa",
- 4,
- 0.01,
- 25,
- 0.05,
- 2.5,
- 0.5,
- 0.5,
- 0.07,
- 0.07,
- [1, 1, 1, 0.5],
- 0.0,
- 0.2,
- 0.5,
- 0.5,
- true,
- false
- ]
- ] remoteExec ["BIS_fnc_setRain", 0];
- sleep _DAP_refresh;
- };
- };
- };
- };
- // Handle Wind Strength parameter
- if (_DAP_windStr == 2) then {
- _randomwindStr = [0, 0, 0, 0, 0.25, 0.50, 0.75, 1] call BIS_fnc_selectRandom;
- [0, _randomWindStr] remoteExec ["setWindStr", 0];
- } else {
- [0, _DAP_windStr] remoteExec ["setWindStr", 0];
- [_DAP_windStr, _DAP_refresh] spawn {
- params ["_DAP_windStr", "_DAP_refresh"];
- while {true} do {
- [0, _DAP_windStr] remoteExec ["setWindStr", 0];
- sleep _DAP_refresh;
- };
- };
- };
- // Handle Wind Force parameter
- if (_DAP_windFrc == 2) then {
- _randomWindFrc = [0, 0, 0, 0, 0.25, 0.50, 0.75, 1] call BIS_fnc_selectRandom;
- [0, _randomWindFrc] remoteExec ["setWindForce", 0];
- } else {
- 0 setWindForce _DAP_windFrc;
- [0, _DAP_windFrc] remoteExec ["setWindForce", 0];
- [_DAP_windFrc, _DAP_refresh] spawn {
- params ["_DAP_windFrc", "_DAP_refresh"];
- while {true} do {
- [0, _DAP_windFrc] remoteExec ["setWindForce", 0];
- sleep _DAP_refresh;
- };
- };
- };
- // Handle Wind Gusts parameter
- if (_DAP_windGst == 2) then {
- _randomWindGst = [0, 0, 0, 0, 0.25, 0.50, 0.75, 1] call BIS_fnc_selectRandom;
- [0, _randomWindGst] remoteExec ["setGusts", 0];
- } else {
- [0, _DAP_windGst] remoteExec ["setGusts", 0];
- [_DAP_windGst, _DAP_refresh] spawn {
- params ["_DAP_windGst", "_DAP_refresh"];
- while {true} do {
- [0, _DAP_windGst] remoteExec ["setGusts", 0];
- sleep _DAP_refresh;
- };
- };
- };
- // Handle Lightnings parameter
- if (_DAP_lightnings == 2) then {
- _randomLightnings = [0, 0, 0, 0, 0.25, 0.50, 0.75, 1] call BIS_fnc_selectRandom;
- [0, _randomLightnings] remoteExec ["setLightnings", 0];
- } else {
- [0, _DAP_lightnings] remoteExec ["setLightnings", 0];
- [_DAP_lightnings, _DAP_refresh] spawn {
- params ["_DAP_lightnings", "_DAP_refresh"];
- while {true} do {
- [0, _DAP_lightnings] remoteExec ["setLightnings", 0];
- sleep _DAP_refresh;
- };
- };
- };
- // Handle Wave Intensity parameter
- if (_DAP_waveInt == 2) then {
- _randomWaves = [0, 0, 0, 0, 0.25, 0.50, 0.75, 1] call BIS_fnc_selectRandom;
- [0, _randomWaves] remoteExec ["setWaves", 0];
- } else {
- [0, _DAP_waveInt] remoteExec ["setWaves", 0];
- [_DAP_waveInt, _DAP_refresh] spawn {
- params ["_DAP_waveInt", "_DAP_refresh"];
- while {true} do {
- [0, _DAP_waveInt] remoteExec ["setWaves", 0];
- sleep _DAP_refresh;
- };
- };
- };
- // Set Time
- switch (_DAP_time) do {
- case 101: {
- setDate [_year, _month, _day, _hour, _minute];
- };
- case 0: {
- _randomTime = [4, 8, 12, 16, 18, 20, 24, 12, 16, 18] call BIS_fnc_selectRandom;
- [[_year, _month, _day, _randomTime, 0]] remoteExec ["setDate"];
- };
- case 4: {
- [[_year, _month, _day, 4, 0]] remoteExec ["setDate", 0];
- };
- case 8: {
- [[_year, _month, _day, 8, 0]] remoteExec ["setDate", 0];
- };
- case 12: {
- [[_year, _month, _day, 12, 0]] remoteExec ["setDate", 0];
- };
- case 16: {
- [[_year, _month, _day, 16, 0]] remoteExec ["setDate", 0];
- };
- case 18: {
- [[_year, _month, _day, 18, 0]] remoteExec ["setDate", 0];
- };
- case 20: {
- [[_year, _month, _day, 20, 0]] remoteExec ["setDate", 0];
- };
- case 24: {
- [[_year, _month, _day, 24, 0]] remoteExec ["setDate", 0];
- };
- };
- // Log Weather and Time Initialization
- diag_log "// === Weather & Time Initialization Complete ===//";
- diag_log "Selected Settings";
- diag_log format ["Overcast: %1 ", _DAP_weather];
- diag_log format ["Fog: %1 ", _DAP_fogAmt];
- diag_log format ["Rain: %1 ", _DAP_rain];
- diag_log format ["Wind Strength: %1 ", _DAP_windStr];
- diag_log format ["Wind Force: %1 ", _DAP_windFrc];
- diag_log format ["Wind Gusts: %1 ", _DAP_windGst];
- diag_log format ["Lightning: %1 ", _DAP_lightnings];
- diag_log format ["Wave Intensity: %1 ", _DAP_waveInt];
- diag_log format ["Time: %1", _DAP_time];
- diag_log "Results";
- diag_log format ["Overcast: %1 ", overcast];
- diag_log format ["Fog: %1 ", fog];
- diag_log format ["Rain: %1 ", rain];
- diag_log format ["Wind Strength: %1 ", windStr];
- diag_log format ["Snow: %1", rainparams select 15];
- diag_log format ["Wind Force: %1 ", Wind];
- diag_log format ["Wind Gusts: %1 ", gusts];
- diag_log format ["Lightning: %1 ", lightnings];
- diag_log format ["Wave Intensity: %1 ", waves];
- diag_log format ["Time: %1", systemTime];
- diag_log "// ======================================//";
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement