Jump to content

How To | Disable Rain & Fog | Multiple setups available


Scenic

Recommended Posts

Explanation:

 

  • Ever had the problem of low fps due rain on your server?
  • Or you have a low visibility due to fog?
  • In this thread I will explain how to correctly edit & implement a custom dynamicweathereffects.sqf
  • Please read carefully!

 

Difficulty and time taken:

 

  • Approximately 10 minutes taken
  • Relatively easy installation

 

Premade setups:

 

Skip to your choice by using CTRL + F and searching for the corresponding number!

  1. No Rain & Fog
  2. Slight Fog, No Rain
  3. Low Rain, Slight Fog
  4. Extreme rain & fog

 

1. (No rain or fog)

http://pastebin.com/7AenujW7

 

2. (slight fog, no rain)

http://pastebin.com/0E2H2Tgh

 

3. (Low Rain, Slight Fog)

http://pastebin.com/Cts4qWZh

 

4. (Extreme rain & fog)

http://pastebin.com/MYaeWPJf

 

How to install your choice of weather:

 

  1. Create a new .sqf named: DynamicWeatherEffects.sqf
  2. Paste the pastebin of your choice into the .sqf
  3. Copy the contents of this pastebin: http://pastebin.com/bAcfmWC9 into another .sqf and name it: Compiles.sqf
  4. Place both DynamicWeatherEffects & Compiles in your mission.pbo

Open your Init.sqf and find: 

call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";	

Replace it with:

call compile preprocessFileLineNumbers "compiles.sqf";

Re .pbo your mission.pbo and upload it to your server, and it should be good to go!

 

 

Note: (I'm not 100% sure but I think if you already have a custom compiles.sqf you can add this line)

	//Start Dynamic Weather
	execVM "DynamicWeatherEffects.sqf";
Link to comment
Share on other sites

  • 3 weeks later...

Is there a way to adjust this so it only rains at night and you always get clear weather during day time?

you could use the defualt version with a loop that checks if its night or day and while its day set the rain to 0 and when its night let it carry on randomly getting the rain value from the defined min max settings like it usually would

Link to comment
Share on other sites

Would you mind giving me an example on how to achieve this on a managed server? Would the check be done with BEC scheduler? What is the command it should execute to enable/disable weather? Also I got the OP script to work but it caused my bandages to stop working. Any idea why? Thanks

Link to comment
Share on other sites

Would you mind giving me an example on how to achieve this on a managed server? Would the check be done with BEC scheduler? What is the command it should execute to enable/disable weather? Also I got the OP script to work but it caused my bandages to stop working. Any idea why? Thanks

 

I need to update the compiles.sqf that you need for the download, it appears it is outdated due to the epoch update

 

Updated with new compiles.sqf

http://pastebin.com/bAcfmWC9

Link to comment
Share on other sites

I need to update the compiles.sqf that you need for the download, it appears it is outdated due to the epoch update

 

Updated with new compiles.sqf

http://pastebin.com/bAcfmWC9

 

 

Thank you for the fix, I didn't know the problem was in the compiles.sqf. I ran into this info on another post that helped me understand how this is done. Quoting it here so I can find it next time there is an update.

 

 

To change the weather you need to change the complies.sqf ran to a copy version on server side in the Mission Files / BPO

 

Example:

call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf"; //Compile Regular Functions
call compile preprocessFileLineNumbers "compiles.sqf"; //Compile Custom Functions and/or Weather

If you put complies in a folder rename accordingly.

call compile preprocessFileLineNumbers "folder\compiles.sqf"; //Compile Custom Functions and Weather

Down the bottom of the compiles.sqf you will see this.

initialized = true;

Change that to this.

//Start Dynamic Weather
execVM "folder\DynamicWeatherEffects.sqf";
initialized = true;
Link to comment
Share on other sites

  • 3 months later...
  • 2 weeks later...

I have a custom complies.sqf. Instead of copying over the compiles.sqf with every Epoch update, I simply call the regular compiles.sqf AND the custom compiles.sqf:

call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf"; //Compile regular functions
progressLoadingScreen 0.5;
call compile preprocessFileLineNumbers "server_traders.sqf"; //Compile trader configs
call compile preprocessFileLineNumbers "custom\compiles.sqf"; //Compile custom compilesprogressLoadingScreen 1.0;

My custom compiles.sqf looks like this:

fnc_usec_selfActions = compile preprocessFileLineNumbers "custom\fn_selfActions.sqf";            // fnc_usec_selfActions - adds custom actions to dayz code
player_build = compile preprocessFileLineNumbers "custom\snap_build\player_build.sqf";
player_buildControls = compile preprocessFileLineNumbers "custom\snap_build\player_buildControls.sqf";
snap_object = compile preprocessFileLineNumbers "custom\snap_build\snap_object.sqf";

So I simply add the line loading the DynamicWeatherEffects.sqf to the bottom of that?

fnc_usec_selfActions = compile preprocessFileLineNumbers "custom\fn_selfActions.sqf";            // fnc_usec_selfActions - adds custom actions to dayz code
player_build = compile preprocessFileLineNumbers "custom\snap_build\player_build.sqf";
player_buildControls = compile preprocessFileLineNumbers "custom\snap_build\player_buildControls.sqf";
snap_object = compile preprocessFileLineNumbers "custom\snap_build\snap_object.sqf";
//Start Dynamic Weather
execVM "DynamicWeatherEffects.sqf";

 

Link to comment
Share on other sites

  • 3 weeks later...

just an update to this. The call to the compiles.sqf is wrong. You dont need to do anything with that. 

 

All you have to do is change your missions .pbo -> init.sqf

 

from

//Start Dynamic Weather
execVM "\z\addons\dayz_code\external\DynamicWeatherEffects.sqf";

to

//Start Dynamic Weather
execVM "whereever\youput\yournew\DynamicWeatherEffects.sqf";
Link to comment
Share on other sites

Anyone have it so it snows?

I want it 

Some fog and rain and little chance of snow showers 

Any way you could add this

http://www.armaholic.com/page.php?id=13307

There are plenty of snow scripts out there. Here's a couple I have.

 

Snowstorm.sqf

//Snow Storm
//Modified by Audio Rejectz, all credits go to original creators JW - Snow script / BI - Wind & Dust particles
"filmGrain" ppEffectEnable true;
"filmGrain" ppEffectAdjust [0.02, 1, 1, 0.1, 1, false];
"filmGrain" ppEffectCommit 5;
 
setviewdistance 900;
bis_fog = 0.8;
 
setviewdistance 900;
0 setovercast 0.9;
0 setrain 1;
//0 setfog 0.8;
0 setfog bis_fog;
 
[] spawn {
    _delay = 3;
    sleep 0.01;
    while {true} do {
        _delay  setovercast 0.9;
        _delay  setrain 1;
        _delay  setfog bis_fog;
        sleep _delay ;
    };
};
 
//--- Wind & Dust
[] spawn {
    waituntil {isplayer player};
    setwind [0.201112,0.204166,true];
    while {true} do {
        _ran = ceil random 5;
        playsound format ["wind_%1",_ran];
        _obj = vehicle player;
        _pos = position _obj;
 
        //--- Dust
            setwind [0.201112*2,0.204166*2,false];
        _velocity = [random 10,random 10,-1];
        _color = [1.0, 0.9, 0.8];
        _alpha = 0.02 + random 0.02;
        _ps = "#particlesource" createVehicleLocal _pos;
        _ps setParticleParams [["\Ca\Data\ParticleEffects\Universal\universal.p3d", 16, 12, 8], "", "Billboard", 1, 3, [0, 0, -6], _velocity, 1, 1.275, 1, 0, [9], [_color + [0], _color + [_alpha], _color + [0]], [1000], 1, 0, "", "", _obj];
        _ps setParticleRandom [3, [30, 30, 0], [0, 0, 0], 1, 0, [0, 0, 0, 0.01], 0, 0];
        _ps setParticleCircle [0.1, [0, 0, 0]];
        _ps setDropInterval 0.01;
 
        sleep (random 1);
        deletevehicle _ps;
        _delay = 10 + random 20;
        sleep _delay;
 
    };
};
 
//Snow script
 
setWind [0, -5, true];
 
_obj = player;
 
_pos = position (vehicle _obj);
 
_d  = 15;
_h  = 12;
_h1 = 8;
_h2 = 4;
_density = 20000;
 
 
 
_fog1 = "#particlesource" createVehicleLocal _pos;
_fog1 setParticleParams [
  ["\Ca\Data\ParticleEffects\Universal\universal.p3d" , 16, 12, 13, 0], "", "Billboard", 1, 10,
  [0, 0, -6], [0, 0, 0], 1, 1.275, 1, 0,
  [7,6], [[1, 1, 1, 0], [1, 1, 1, 0.04], [1, 1, 1, 0]], [1000], 1, 0, "", "", _obj
];
_fog1 setParticleRandom [3, [55, 55, 0.2], [0, 0, -0.1], 2, 0.45, [0, 0, 0, 0.1], 0, 0];
_fog1 setParticleCircle [0.001, [0, 0, -0.12]];
_fog1 setDropInterval 0.01;
 
_fog2 = "#particlesource" createVehicleLocal _pos;
_fog2 setParticleParams [
  ["\Ca\Data\ParticleEffects\Universal\universal.p3d" , 16, 12, 13, 0], "", "Billboard", 1, 10,
  [0, 0, -6], [0, 0, 0], 1, 1.275, 1, 0,
  [7,6], [[1, 1, 1, 0], [1, 1, 1, 0.04], [1, 1, 1, 0]], [1000], 1, 0, "", "", _obj
];
_fog2 setParticleRandom [3, [55, 55, 0.2], [0, 0, -0.1], 2, 0.45, [0, 0, 0, 0.1], 0, 0];
_fog2 setParticleCircle [0.001, [0, 0, -0.12]];
_fog2 setDropInterval 0.01;
 
_fog3 = "#particlesource" createVehicleLocal _pos;
_fog3 setParticleParams [
  ["\Ca\Data\ParticleEffects\Universal\universal.p3d" , 16, 12, 13, 0], "", "Billboard", 1, 10,
  [0, 0, -6], [0, 0, 0], 1, 1.275, 1, 0,
  [7,6], [[1, 1, 1, 0], [1, 1, 1, 0.04], [1, 1, 1, 0]], [1000], 1, 0, "", "", _obj
];
_fog3 setParticleRandom [3, [55, 55, 0.2], [0, 0, -0.1], 2, 0.45, [0, 0, 0, 0.1], 0, 0];
_fog3 setParticleCircle [0.001, [0, 0, -0.12]];
_fog3 setDropInterval 0.01;
 
 
while {true} do
{
_a = 0;
while { _a < _density } do
{
_pos = position player;
_fog1 setpos _pos;
_fog2 setpos _pos;
_fog3 setpos _pos;
0 setRain 0;
 
_dpos = [((_pos select 0) + (_d - (random (2*_d))) + ((velocity vehicle player select 0)*1)),((_pos select 1) + (_d - (random (2*_d))) + ((velocity vehicle player select 0)*1)),((_pos select 2) + _h)];
drop ["\ca\data\cl_water", "", "Billboard", 1, 7, _dpos, [0,0,-1], 1, 0.0000001, 0.000, 0.7, [0.07], [[1,1,1,0], [1,1,1,1], [1,1,1,1], [1,1,1,1]], [0,0], 0.2, 1.2, "", "", ""];    _a = _a + 1;
 
 
_dpos = [((_pos select 0) + (_d - (random (2*_d))) + ((velocity vehicle player select 0)*1)),((_pos select 1) + (_d - (random (2*_d))) + ((velocity vehicle player select 0)*1)),((_pos select 2) + _h1)];
drop ["\ca\data\cl_water", "", "Billboard", 1, 7, _dpos, [0,0,-1], 1, 0.0000001, 0.000, 0.7, [0.07], [[1,1,1,0], [1,1,1,1], [1,1,1,1], [1,1,1,1]], [0,0], 0.2, 1.2, "", "", ""];
 
 
_dpos = [((_pos select 0) + (_d - (random (2*_d))) + ((velocity vehicle player select 0)*1)),((_pos select 1) + (_d - (random (2*_d))) + ((velocity vehicle player select 0)*1)),((_pos select 2) + _h2)];
drop ["\ca\data\cl_water", "", "Billboard", 1, 7, _dpos, [0,0,-1], 1, 0.0000001, 0.000, 0.7, [0.07], [[1,1,1,0], [1,1,1,1], [1,1,1,1], [1,1,1,1]], [0,0], 0.2, 1.2, "", "", ""];
 
};
sleep 0.2;
};

Also here is a way to use the snow script that Namalsk uses, which ties into your dynamicweather.sqf compliments of Vampire who created DZMS..

http://opendayz.net/threads/tutorial-snow-added-to-dynamic-weather.15294/

Link to comment
Share on other sites

  • 3 months later...

Getting this error:
 

10:41:59 Error in expression <e {
_weatherType = "FOG";
};
};








if (_weatherType == "FOG") then {


drn_Dynam>
10:41:59 Error position: <_weatherType == "FOG") then {


drn_Dynam>
10:41:59 Error Undefined variable in expression: _weathertype
10:41:59 File z\addons\dayz_code\external\DynamicWeatherEffects.sqf, line 333
Link to comment
Share on other sites

 

Getting this error:

 

10:41:59 Error in expression <e {
_weatherType = "FOG";
};
};








if (_weatherType == "FOG") then {


drn_Dynam>
10:41:59 Error position: <_weatherType == "FOG") then {


drn_Dynam>
10:41:59 Error Undefined variable in expression: _weathertype
10:41:59 File z\addons\dayz_code\external\DynamicWeatherEffects.sqf, line 333

 

 

looks like you didn't follow the instructions there buddy. The error is generated by the dynamicweatherfile that should not be used.

Link to comment
Share on other sites

  • 11 months later...

same error as above:

10:09:16 Error in expression <e {
_weatherType = "FOG";
};
};




if (_weatherType == "FOG") then {

drn_Dynam>
10:09:16   Error position: <_weatherType == "FOG") then {

drn_Dynam>
10:09:16   Error Undefined variable in expression: _weathertype
10:09:16 File mpmissions\DayZ_Epoch_24.Napf\custom\DynamicWeatherEffects.sqf, line 333
Link to comment
Share on other sites

Same error

19:21:25 Error in expression <e {_weatherType = "FOG";};}; if (_weatherType == "FOG") then { drn_Dynam>19:21:25 Error position: <_weatherType == "FOG") then { drn_Dynam>19:21:25 Error Undefined variable in expression: _weathertype19:21:25 File mpmissions\DayZ_Epoch_24.Napf\custom2\DynamicWeatherEffects.sqf, line 333
 
Link to comment
Share on other sites

Here's a link to the DynamicWeatherEffects.sqf I use. It gives clear skies with no clouds all the time. Maybe that's what you guys are looking for: https://www.dropbox.com/s/vuiuoztrlx6lenz/DynamicWeatherEffects.sqf?dl=0

 

Put that in your mission pbo and call it from init.sqf, such as this:

execVM "custom\weather\DynamicWeatherEffects.sqf";
Link to comment
Share on other sites

No fog is what I'm looking for. And I have followed the guide and fog is o (off) but still see the fog ingame? Like it's "off" the map so to speak?

 

What you are seeing is the view distance, most likely. There's a script around here that lets you adjust your view distance using binos and range finders. That way each player can adjust the view distance/fog to their own liking and performance.

Link to comment
Share on other sites

 

Here's a link to the DynamicWeatherEffects.sqf I use. It gives clear skies with no clouds all the time. Maybe that's what you guys are looking for: https://www.dropbox.com/s/vuiuoztrlx6lenz/DynamicWeatherEffects.sqf?dl=0

 

Put that in your mission pbo and call it from init.sqf, such as this:

execVM "custom\weather\DynamicWeatherEffects.sqf";

thx man, no more errors in rpt  ;)

Link to comment
Share on other sites

Hello,  I apologize for asking what most if not all of you will see as a very silly question,   but I am a first time server owner,   and have followed your instructions to the letter,  however the part where it then says Edit you init.sql file,   I cannot seem to locate this file. 

 

Could you possibly tell me the directory I would find that in,  or,  if I am meant to create it,   where I should put it in the file structure on the server. 

 

I appreciate all help given. 

 

Jake

Link to comment
Share on other sites

Hello,  I apologize for asking what most if not all of you will see as a very silly question,   but I am a first time server owner,   and have followed your instructions to the letter,  however the part where it then says Edit you init.sql file,   I cannot seem to locate this file. 

 

Could you possibly tell me the directory I would find that in,  or,  if I am meant to create it,   where I should put it in the file structure on the server. 

 

I appreciate all help given. 

 

Jake

 

Hi Jake, it's in the MPMissions folder

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...