Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved weather parameters #209

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions modules/env_parameters/params.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,32 @@ class Weather {
default = -1;
};

class ace_weather_windSimulation {
title = "ACE Wind Simulation (must be disabled for parameterized wind)";
ACE_setting = 1;
values[] = {-1, 1, 0};
texts[] = {"Mission/Server Default", "Enabled", "Disabled"};
default = -1;
};

class Wind {
title = "Wind";
texts[] = {"Mission default", "No Wind", "Light breeze", "Moderate breeze", "Strong breeze", "Strong gale", "Violent storm", "Random"};
values[] = {-1, 0, 2, 4, 6, 8, 10, -10};
texts[] = {"Mission default", "No Wind", "Light Breeze (2 m/s)", "Gentle Breeze (4 m/s)", "Fresh Breeze (9 m/s)", "Strong Breeze (12 m/s)", "High Wind (15 m/s)", "Gale (20 m/s)", "Storm (26 m/s)", "Violent Storm (30 m/s)"};
values[] = {-1, 0, 2, 4, 9, 12, 15, 20, 26, 30};
default = -1;
};

class WindDir {
title = "Wind Direction (blowing from; only affects parameterized wind)";
texts[] = {"North (0°)", "North-Northeast (22.5°)", "Northeast (45°)", "East-Northeast (67.5°)", "East (90°)", "East-Southeast (112.5°)", "Southeast (135°)", "South-Southeast (157.5°)", "South (180°)", "South-Southwest (202.5°)", "Southwest (225°)", "West-Southwest (247.5°)", "West (270°)", "West-Northwest (292.5°)", "Northwest (315°)", "North-Northwest (337.5°)"};
values[] = {0, 22.5, 45, 67.5, 90, 112.5, 135, 157.5, 180, 202.5, 225, 247.5, 270, 292.5, 315, 337.5};
default = 90;
};

class Fog {
title = "Fog";
texts[] = {"Mission default", "No Fog", "Slightly Foggy", "Foggy", "Very Foggy", "Random"};
values[] = {-1, 0, 1, 2, 3, -10};
texts[] = {"Mission default", "No Fog", "Slightly Foggy", "Foggy", "Very Foggy"};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intend to remove the functionality for random fog?

values[] = {-1, 0, 1, 2, 3};
default = -1;
};

Expand Down
34 changes: 13 additions & 21 deletions modules/env_parameters/preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -63,27 +63,19 @@ if (isMultiplayer) then {
0 setOvercast (_overcast / 10);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Towards the top of this file, _windDir should be declared as a private variable, as per the other parameters.


};

_WindParam = "Wind" call BIS_fnc_getParamValue;

if (_WindParam != -1) then {

_wind = _WindParam;
if (_wind == -10) then {
_wind = random 10;
};
0 setWindStr (_wind / 10);

if ((_wind / 10) * 1.25 > 1) then {

0 setGusts 1;

} else {

0 setGusts ((_wind / 10) * 1.25);

};
};

_wind = "Wind" call BIS_fnc_getParamValue;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my fork's implementation I've called the "getParamValue" function using the alternative syntax (i.e. specifying a default value) just as a note if this gets merged into the Olsen Framework.

_windDir = "WindDir" call BIS_fnc_getParamValue;
if (_wind != -1) then {
//calculate X and Y component of wind direction vector
//convert to CCW from X-axis, inverted (so the wind blows *from* that dir)
_windDir = 90 + (180 - _windDir);
_dirX = cos _windDir;
_dirY = sin _windDir;

0 setWindStr 1;
setWind [_dirX * _wind, _dirY * _wind, true];
};

_FogParam = "Fog" call BIS_fnc_getParamValue;

Expand Down
16 changes: 8 additions & 8 deletions modules/start_in_vehicle/functions/CfgFunctions.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class StartInVehicle {
class VehicleStart
{
file = "modules\start_in_vehicle\functions\VehicleStart";
class moveInVehicle {};
class startInVehicle {};
};
};
class StartInVehicle {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a purely formatting change, so maybe remove it from the pull request?

class VehicleStart
{
file = "modules\start_in_vehicle\functions\VehicleStart";
class moveInVehicle {};
class startInVehicle {};
};
};