[Guide] Clear nights!

Lartza

New Member
Recently few of my players complained about my night cycle, that even though there were street and houselights they are of no help in the woods. I searched around a bit and couldn't find a way to get nights clearer, so I did it myself! (All the available solutions made daytime also no overcast etc, and I don't want that)

What you have to do is open up dayz_code.pbo from the DayZ mod itself, and find system\DynamicWeatherEffects.sqf
Copy that file to somewherere in your mission file, I copied it to a folder called "fixes"

Now open that sqf, and find a part where it says
Code:
    _currentOvercast = _this select 0;
    _currentFog = _this select 1;
    _currentRain = _this select 2;
    _currentWeatherChange = _this select 3;
    _targetWeatherValue = _this select 4;
    _timeUntilCompletion = _this select 5;
    _currentWindX = _this select 6;
    _currentWindZ = _this select 7;
It should be lines 148-155

Then edit that part to be like this
Code:
    if(daytime<6||daytime>19)then {
        _currentOvercast = 0;
        _currentFog = 0;
        _currentRain = 0;
        _currentWeatherChange = _this select 3;
        _targetWeatherValue = _this select 4;
        _timeUntilCompletion = _this select 5;
        _currentWindX = _this select 6;
        _currentWindZ = _this select 7;
    }
    else {
        _currentOvercast = _this select 0;
        _currentFog = _this select 1;
        _currentRain = _this select 2;
        _currentWeatherChange = _this select 3;
        _targetWeatherValue = _this select 4;
        _timeUntilCompletion = _this select 5;
        _currentWindX = _this select 6;
        _currentWindZ = _this select 7;
    };
That makes it so that between 19:00 and 6:00 server time, there will be no overcast, no fog and no rain. You can mess with the values if you want something else.

Oh and you need to have your compiles.sqf overriden too, get that from dayz_code\init and put it to your missionfile also, I have it on the root of the missionfile.
Then make init.sqf load
Code:
call compile preprocessFileLineNumbers "compiles.sqf";
and edit compiles.sqf to load
Code:
execVM "fixes\DynamicWeatherEffects.sqf";

And that's it! If someone has a better way of doing this, I'd love to hear it! But this seems to work just fine. Hope this helps someone else!
 
Awesome! Going to try this! :) Do you also know how to increase view distance?
View distance is controlled from the server's ArmA2OAProfile, like for example you might have dayz_1.chernarus\Users\Reality\Reality.ArmA2OAProfile

It cannot be changed on a running server as far as I know, by any scripting command.
 
It's the mod's file. You can find it example: C/program files/steam/arma2oa/addons/dayz

For me, it was in C:\Program Files (x86)\CapsuleGames\ARMA II Operation Arrowhead - PC\@DayZ\Addons in case anyone else didn't get OA on Steam (I got it on Greenman Gaming).
 
Back
Top