Jump to content
  • 0

Clouds Speed


Donnovan

Question

I finished a simple time control code that allow you to accelerate time.

 

Actually i'm using that:

 

00:00 - 04:00 [12 minutes]
04:00 - 08:00 [18 minutes]
08:00 - 12:00 [30 minutes]
12:00 - 16:00 [30 minutes]
16:00 - 20:00 [18 minutes]
20:00 - 24:00 [12 minutes]

 

Total Day Time = 2 hours.

 

It have smooth clouds movement, but since this demands many more and smaller skipTime commands and since skipTime command decrease fps, you have a hurt in fps of 15%.

 

If i can control clouds speed, this would open new possibilities because i can use less and bigger skipTime commands.

 

I tried to mess with setWind command, but this seens not to affect clouds speed.

 

Anyone know how to set clouds speed?

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

This is the client side of the script, just to give the topic something more. Don't use it, it's missing the server side here! Thankyou!

//DONN Time Control
if (isNil "drn_fnc_DynamicWeather_SetWeatherLocal") then {
        0 setOvercast 0;
        0 setFog 0;
        setWind [1, 1, true];
};
if (isServer) then {
	donn_setSpeed = {
		private ["_dayTime"];
		_dayTime = _this select 0;
		if (_dayTime >= 8 && _dayTime <= 16) then {donn_speed =  4.000;};
		if (_dayTime >  4 && _dayTime <   8) then {donn_speed =  6.666;};
		if (_dayTime > 16 && _dayTime <  20) then {donn_speed =  6.666;};
		if (_dayTime <= 4 || _dayTime >= 20) then {donn_speed = 10.000;};
	};
};
if (!isServer) then {
	"cad_pvar_server_date" addPublicVariableEventHandler {_this call donn_setdate;};
	donn_setdate = {
		private ["_dateSer","_dateCli","_date_diff"];
		_dateSer = ((_this select 1) select 0);
		_dateCli = date;
		_date_diff = (
			((_dateSer select 0) - (_dateCli select 0))*12*31*24 +
			((_dateSer select 1) - (_dateCli select 1))*31*24 +
			((_dateSer select 2) - (_dateCli select 2))*24 +
			((_dateSer select 3) - (_dateCli select 3)) +
			((_dateSer select 4) - (_dateCli select 4))/60
		);
		donn_speed = ((_this select 1) select 1);
		if (_date_diff > 30/60) then {skipTime _date_diff;};
		donn_skipExit = true;
		diag_log format [
			"HOUR BEFORE: %1 / HOUR RECEIVED: %2 / DIFF MIN: %3 ",
			date,
			(_this select 1) select 0,
			floor (_date_diff*60)
		];
	};
};
if (isServer) then {donn_skipExit = false;};
[] spawn {
	private ["_sleep","_speed","_timePixel","_tickTime","_skipTime","_tickTimeLen"];
	waitUntil {!isNil "donn_speed" && !isNil "donn_skipExit"};
	while {true} do {
		_speed = donn_speed;
		if (isNil "drn_fnc_DynamicWeather_SetWeatherLocal") then {
			private ["_donn_speed"];
			_donn_speed = (donn_speed min 20) max 4;
			_sleep = 1-((_donn_speed-4)/16*0.9);
		} else {
			_sleep = 0.02;
		};
		_timePixel = 0;
		_skipTime = 0;
		_tickTimeLen = 0;
		_tickTime = diag_tickTime;
		while {!donn_skipExit} do {
			sleep _sleep;
			skipTime (_timePixel/3600);
			_skipTime = _skipTime+_timePixel;
			_tickTimeLen = diag_tickTime-_tickTime;
			_timePixel = (_timePixel*31+((_speed-1)*_tickTimeLen-_skipTime))/32;
		};
		donn_skipExit = false;
	};
};
Link to comment
Share on other sites

  • 0

Have at look at the DRN Dynamic Weather readme in dayz_code/external if you haven't already ;)

 

Due to the dynamic weather in epoch (clients weather is synced via the server) you would probably have to stick to Sunny/Clear/Partly Cloudy weather for your script to work and keep fps drops to a minimum.

 

You could call the drn_fnc_DynamicWeather_SetWeatherLocal via the PVDZE with each setDate, keeping everyone on the server in sync, this way you will only ever have 30 minutes of 'Dynamic' weather before it's reset again, minimising the variation of weather and it might reduce the fps hit a bit.

 

IIRC without scripts like dynamic weather, Arma's skies are fairly static.

Link to comment
Share on other sites

  • 0

Not really Uro1, the low clouds moves with and without Dynamic Weather.

On the Arma 2 AO files there is a Ca.pbo file and this code bellow is into its config.bin file: see code below.

This sets the overcast behavior. I believe the low clouds speed is the speed paremeter.

Anyone know if is possible to put a changed version of it into the mission folder?

 

class CfgWorlds {
	initWorld = "utes";
	demoWorld = "Chernarus";
	
	class DefaultWorld {
		class Weather {
			class Overcast {
				class Weather1;	// External class reference
				class Weather2;	// External class reference
				class Weather3;	// External class reference
				class Weather4;	// External class reference
				class Weather5;	// External class reference
			};
		};
	};
	
	class CAWorld : DefaultWorld {
		class Weather : Weather {
			class Overcast : Overcast {
				class Weather1 : Weather1 {
					sky = "ca\data\data\sky_clear_sky.paa";
					skyR = "ca\data\data\sky_clear_lco.paa";
					horizon = "ca\data\data\sky_clear_horizont_sky.paa";
					overcast = 0;
					alpha = 0;
					size = 0.1;
					height = 1.0;
					bright = 0.7;
					speed = 0;
					through = 1.0;
					diffuse = 1.0;
					cloudDiffuse = 0.95;
					waves = 0.2;
					lightingOvercast = 0.0;
				};
				
				class Weather7 : Weather1 {
					sky = "ca\data\data\sky_veryclear_sky.paa";
					skyR = "ca\data\data\sky_clear_lco.paa";
					horizon = "ca\data\data\sky_veryclear_horizont_sky.paa";
					overcast = 0.07;
					alpha = 0.5;
					size = 0.2;
					height = 0.95;
					bright = 0.5;
					speed = 0.1;
					through = 1.0;
					diffuse = 1.0;
					cloudDiffuse = 0.95;
					waves = 0.2;
					lightingOvercast = 0.0;
				};
				
				class Weather2 : Weather2 {
					sky = "ca\data\data\sky_almostclear_sky.paa";
					skyR = "ca\data\data\sky_almostclear_lco.paa";
					horizon = "ca\data\data\sky_almostclear_horizont_sky.paa";
					overcast = 0.25;
					alpha = 0.6;
					size = 0.3;
					height = 0.9;
					bright = 0.45;
					speed = 0.25;
					through = 1.0;
					lightingOvercast = 0.1;
					diffuse = 1.0;
					waves = 0.22;
				};
				
				class Weather3 : Weather3 {
					sky = "ca\data\data\sky_semicloudy_sky.paa";
					skyR = "ca\data\data\sky_semicloudy_lco.paa";
					horizon = "ca\data\data\sky_semicloudy_horizont_sky.paa";
					overcast = 0.4;
					alpha = 0.8;
					size = 0.5;
					height = 0.8;
					bright = 0.4;
					speed = 0.45;
					through = 0.7;
					lightingOvercast = 0.5;
					diffuse = 0.8;
					waves = 0.32;
				};
				
				class Weather4 : Weather4 {
					sky = "ca\data\data\sky_cloudy_sky.paa";
					skyR = "ca\data\data\sky_cloudy_lco.paa";
					horizon = "ca\data\data\sky_cloudy_horizont_sky.paa";
					overcast = 0.6;
					alpha = 0.99;
					size = 0.65;
					height = 0.75;
					bright = 0.5;
					speed = 0.55;
					through = 0.4;
					lightingOvercast = 0.85;
					diffuse = 0.6;
					waves = 0.32;
				};
				
				class Weather5 : Weather5 {
					sky = "ca\data\data\sky_mostlycloudy_sky.paa";
					skyR = "ca\data\data\sky_mostlycloudy_lco.paa";
					horizon = "ca\data\data\sky_mostlycloudy_horizont_sky.paa";
					overcast = 0.9;
					alpha = 0.55;
					size = 0.8;
					height = 0.7;
					bright = 0.33;
					speed = 0.75;
					through = 0;
					lightingOvercast = 0.98;
					diffuse = 0.3;
					waves = 0.52;
				};
				
				class Weather6 : Weather5 {
					sky = "ca\data\data\sky_overcast_sky.paa";
					skyR = "ca\data\data\sky_overcast_lco.paa";
					horizon = "ca\data\data\sky_overcast_horizont_sky.paa";
					overcast = 1.0;
					alpha = 0.4;
					bright = 0.2;
					size = 1.0;
					height = 0.6;
					speed = 0.95;
					through = 0;
					lightingOvercast = 0.98;
					diffuse = 0.1;
					waves = 0.7;
				};
			};
			
			class ThunderboltNorm {
				model = "\ca\data\blesk1.p3d";
				soundNear[] = {"\ca\sounds\sfx\thunder01", 31.6228, 1};
				soundFar[] = {"\ca\sounds\sfx\thunder02", db20, 1};
			};
			
			class ThunderboltHeavy {
				model = "\ca\data\blesk2.p3d";
				soundNear[] = {"\ca\sounds\sfx\thunder09hard", 31.6228, 1};
				soundFar[] = {"\ca\sounds\sfx\thunder10hard", db20, 1};
			};
		};
		
		class Rain {
			texture = "ca\data\data\rain_ca.paa";
			raindrop = "\ca\data\raindrop.p3d";
			speed = 1;
			levels[] = {8, 2};
		};
		skyTexture = "ca\data\data\sky_semicloudy_sky.paa";
		skyTextureR = "ca\data\data\sky_semicloudy_lco.paa";
		seaTexture = "ca\data\seatexture_co.paa";
		clouds[] = {"ca\data\mrak1.p3d", "ca\data\mrak2.p3d", "ca\data\mrak3.p3d", "ca\data\mrak4.p3d"};
		skyObject = "ca\data\obloha.p3d";
		starsObject = "ca\data\stars.p3d";
		pointObject = "ca\data\point.p3d";
		horizontObject = "ca\data\horizont.p3d";
		haloObject = "ca\data\sunhalo.p3d";
		sunObject = "ca\data\sun.p3d";
		rainbowObject = "ca\data\rainbow.p3d";
		moonObject = "ca\data\moon.p3d";
	};
};
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...