Skip to content
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
18 changes: 18 additions & 0 deletions configs/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,24 @@
<Chinesesimp>决定游戏中时间的流速</Chinesesimp>
<Russian>Определяет, как быстро проходит время в игре</Russian>
</Key>
<Key ID="STR_Vindicta_Settings_Weather_Toggle">
<Original>Weather</Original>
</Key>
<Key ID="STR_Vindicta_Settings_Weather_Toggle_Tooltip">
<Original>Determines the changing of weather over time (Requires mission restart)</Original>
</Key>
<Key ID="STR_Vindicta_Settings_Weather_Toggle">
<Original>Weather</Original>
</Key>
<Key ID="STR_Vindicta_Settings_Weather_Toggle_Disabled">
<Original>Disabled</Original>
</Key>
<Key ID="STR_Vindicta_Settings_Weather_Toggle_Clouds">
<Original>No Rain</Original>
</Key>
<Key ID="STR_Vindicta_Settings_Weather_Toggle_Enabled">
<Original>Enabled</Original>
</Key>
</Container>
<Container name="Diff">
<Key ID="STR_Vindicta_Settings_Diff">
Expand Down
6 changes: 6 additions & 0 deletions src/GameManager/GameManager.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,12 @@ CLASS("GameManager", "MessageReceiverEx")

// Game
["vin_server_gameSpeed", "SLIDER", [LOC("Game_Speed"), LOC("Game_Speed_Tooltip")], [_section, LOC("Game")], [0.1, 5, 1, 1], true] call CBA_fnc_addSetting;
["vin_server_weather_toggle", "LIST", [LOC("Weather_Toggle"), LOC("Weather_Toggle_Tooltip")], [_section, LOC("Game")], [[0, 1, 2], [LOC("Weather_Toggle_Disabled"), LOC("Weather_Toggle_Clouds"), LOC("Weather_Toggle_Enabled")], 0], true,
{
terminate gWeather_Script;
CALL_COMPILE_COMMON("Weather\initWeather.sqf");
}
] call CBA_fnc_addSetting;

#undef LOC_SCOPE
ENDMETHOD;
Expand Down
31 changes: 31 additions & 0 deletions src/Weather/initWeather.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Code for Random weather, Credits to Sil Carmikas @ https://forums.bohemia.net/forums/topic/202392-sils-simple-random-weather-script/
// Edited by Jasperdoit
gWeather_Script = [] spawn {
if isServer then {


private _weather = [
[
0.3
],
[
0.0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45
],
[
0.0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1
]
] select vin_server_weather_toggle;

//Initial weather vodoo

0 setOvercast selectRandom _weather;
forceWeatherChange;

// Random Weather
while {true} do {
private _randomTime = (random 3600 + 1200);
_randomTime setOvercast selectRandom _weather;
sleep (_randomTime + 300);
};
};
};
1 change: 0 additions & 1 deletion src/init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "common.h"

// Most normal init code is handled in GameMode init functions.

// Code which adds all objects to be edited by zeus
if (isServer) then {
[] spawn {
Expand Down
3 changes: 3 additions & 0 deletions src/initModules.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,7 @@ CALL_COMPILE_COMMON("GarrisonServer\initClasses.sqf");
// Initialize dialogue
CALL_COMPILE_COMMON("Dialogue\initClasses.sqf");

// Initialize weather
CALL_COMPILE_COMMON("Weather\initWeather.sqf");

diag_log "[initModules] Done!";