[Tutorial] Snow added to Dynamic Weather

Vampire

OpenDayZ Rockstar!
So I was wondering how to add snow to the dynamic weather like everyone else, and then realised that snow was dynamic on Namalsk. So I looked at how it was done, and seen that Namalsk uses a custom dynamic weather script with snow as a logic function. Thought I was crazy for trying but I managed to get it working on my Epoch server.

All credits go to Sumrak (http://www.nightstalkers.cz/) for putting so much work into Namalsk.​
All this code is his, I simply figured out how to port it from Namalsk to any map.​
First create a folder in your mission.pbo called Weather, and put these two scripts in there:​
Hit "RAW" next to download, to copy and paste.​
First script: DynamicWeatherEffects.sqf​
(You can modify the settings at the top, but it only snows if it's over .75 overcast)​

Hit "RAW" next to download, to copy and paste.
Second script: fn_dzn_snowfall.sqf
(This script even takes into account if you are inside a building, so it doesn't snow inside)
http://pastebin.com/nmmFrJyZ

Then you need to open up your init.sqf (on Epoch) or custom compiles and point the dynamic weather location to your script instead.
Like so:
Code:
        //Start Dynamic Weather
    execVM "Weather\DynamicWeatherEffects.sqf";
When the script wants it to snow, it calls the snow function, which runs the script. We need to add the snow function.

Open your Description.ext
Under the class RscPicture block of code, add this.
Code:
class CfgFunctions {
    class DZN {
        class Functions {
            class snowfall {
                description = "Simple snowfall script";
                file = "Weather\fn_dzn_snowfall.sqf";
            };
        };
    };
};
In the DynamicWeather I have Debug turned on. Turn it off if you don't want it logging the current weather to your .RPT.

Enjoy everyone!
 

Vampire

OpenDayZ Rockstar!
If someone could modify the fn_dzn_snowfall.sqf to use the snow from the other snow script everyone is using, that would be great.

The Namalsk snow is nice, but it's not dense enough for my liking.
 

Vampire

OpenDayZ Rockstar!
There is a classname for snow, but to cover your entire map in it would be too much. Maybe some code to spawn patches of it accross the map?
 

Stuff and Junk

Well-Known Member
Glad to see someone else figured this out. I just added the snow to my fixes folder and changed the line to call it. Didnt have to mess with anything else :/
 

Vampire

OpenDayZ Rockstar!
You cant add new skins to a mod unless you make a new mod.
You can adjust the tempurature by adjusting fn_temperatur.sqf
 

Vampire

OpenDayZ Rockstar!
Oh I see.

You would probably just code into fn_tempuratur.sqf that if the player model matches those in an array then the overall temperature is higher
 

Hertizch

Well-Known Member
You need some new variables, for example:

Factors:
_warm_clothes = 10;

And for posistive effects:
if (((typeOf player) == "Sniper1_DZ")) then {
_difference= _difference + _warm_clothes;
};

I guess that will work :)
 
IDK, but I did everything as in the tutorial. The only thing I have added a script to clean weather at certain times of day. Like this in DynamicWeatherEffects.sqf

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;
    };
 
And there is error in RPT:
"0:0 Debug: Starting script WeatherEffects.sqf..."

Code:
16:12:27 Error in expression <ndZ, true];
 
 
if (_currentWeatherChange == "OVERCAST") then {
_timeUntilCompleti>
16:12:27  Error position: <== "OVERCAST") then {
_timeUntilCompleti>
16:12:27  Error Generic error in expression
16:12:27 File mpmissions\dayz_1.Chernarus\Fixes\compile\DynamicWeatherEffects.sqf, line 191
 

Vampire

OpenDayZ Rockstar!
Don't change the amount, just change snow chance to 100% and rain to 0.
These lines:
Code:
_rainIntervalRainProbability = 50;
_snowIntervalSnowProbability = 50;
 
Top