Jump to content
Sign in to follow this  
--Scorpion--

Question about the Weather Module

Recommended Posts

Is it possible to change the height the clouds are spawn ?

Correct me if I'm wrong but the height they spawn seem to be around 300. It will be fine for a chopper mission but in my mission, I'm a aircraft pilot flying most of the time between 1000-2000 so they only have a effect when I take off and when I'm landing.

Any help will be really appreciated.

Share this post


Link to post
Share on other sites

Your best bet for this is to rip open the pbo that contains the modules and see how it creates the clouds and and what height they are created at. You then might be able to make your own script with your own custom spawn height.

Share this post


Link to post
Share on other sites

I've found a solution after looking at the scripts inside the Modules.pbo.

Create a scripts folder inside your mission folder and put these two scripts inside the scripts folder.

BIS_CloudSystem.sqs

_PositionArray = [];
_PostArray = [];
_LifeTime = 285;
_Ocpos = [-1000,-1000];




#update
~1

_PosX = (getpos player) select 0;
_PosY = (getpos player) select 1;

_PosXc = (_PosX / 1000) - ((_PosX / 1000) % 1);
_PosYc = (_PosY / 1000) - ((_PosY / 1000) % 1);

_cpos = [_PosXc,_PosYc];
?( ((_cpos select 0) == (_Ocpos select 0)) && ((_cpos select 1) == (_Ocpos select 1))) : goto "wait"
_Ocpos = _cpos;

_i = -2;
_io = -2;
_j = -2;
_ijmax = 3;









#posloop
_level = 0
_pos = format ["%1%2",(_PosXc + _i),(_PosYc + _j)]
? (!(_pos in _PositionArray)): while { _level < 1 } do { [((1000 * (_PosXc + _i)) + 500),((1000 * (_PosYc + _j)) + 500),(0 + _level*5000),0] exec "scripts\BIS_Cloud.sqs"; _level = _level + 1 }; _PositionArray = _PositionArray + [_pos]; _PostArray = _PostArray + [_time]
_i = _i + 1
~0.1
?(_i < _ijmax):goto "posloop"
_i = _io
_j = _j + 1
?(_j < _ijmax):goto "posloop"

_max = count _PositionArray
_a = 0
?(_max == 0):goto "wait"







#check
_ctime = (_PostArray select _a)
?((_ctime + _LifeTime) < _time):_PositionArray = _PositionArray - [(_PositionArray select _a)]; _max = count _PositionArray; _PostArray = _PostArray - [(_PostArray select _a)]
_a = _a + 1
?(_a < _max):goto "check"

BIS_Cloud.sqs

_x = _this select 0
_y = _this select 1
_z = _this select 2
_type = _this select 3

~1

_color = ([[0.95,0.95,0.95],[0.95,0.95,0.95],[0.75,0.75,0.75],[0.715,0.719,0.793],[0.5,0.5,0.5]] select _type)
_opa0 = _color + [0]
_opa1 = _color + [0.4]
_colord = ([[0.75,0.75,0.75],[0.75,0.75,0.75],[0.5,0.5,0.5],[0.434,0.438,0.504],[0.25,0.25,0.25]] select _type)
_opad0 = _colord + [0]
_opad1 = _colord + [0.5]
_color = [_opa0,_opa1,_opa1,_opa1,_opa1,_opa1,_opa1,_opa1,_opa1,_opa1,_opa0]
_colord = [_opad0,_opad1,_opad1,_opad1,_opad1,_opad1,_opad1,_opad1,_opad1,_opad1,_opad0]


_densi = ([[2,1], [1,0.7], [10,0.8], [3,1], [1,0.45]] select _type)
_d_overall = _densi select 0
_d_cloud = _densi select 1



_shape = ([[[250,30],[1,5],30,250], [[400,300],[1,3],100,300], [[200,20],[1,1],55,400], [[400,35],[2,5],35,250], [[500,25],[1,2],10,250]] select _type)
_a = ((_shape select 0) select 0)
_h = ((_shape select 0) select 1)

_peakheight = _shape select 2
_flyheight = _shape select 3


; ----------------------------------------

_cloud = 0
#cloud
_peaks = random (((_shape select 1) select 1) - ((_shape select 1) select 0)) + ((_shape select 1) select 0)
_cx = _x + (500 - (random 1000))
_cy = _y + (500 - (random 1000))
_cz = (_flyheight + (25 - (random 50))) + _z

_amou = ((_a^2 * _h) * (_d_cloud/200000))
_drop = 0

#cloudparticles
~0.01
_crx = _cx + ((_a/2) - (random _a))
_cry = _cy + ((_a/2) - (random _a))
_crz = _cz + (random _h)
drop ["\ca\data\cl_basic", "", "Billboard", 10, 330, [_crx,_cry,_crz], [0,0,0], 0.1, 1.275, 1, 1, [150 + (random 75)], _color, [0,0], 0, 0, "", "",""]
_drop = _drop + 1
if (_drop < _amou) then { goto "cloudparticles" }



_tcolor = _color
_th = _h
_tcz = _cz
_color = _colord
_h = 10
_cz = _cz - 25

_amou = ((_a^2 * _h) * (_d_cloud/200000))
_drop = 0

_script = ""


#cloudparticlesdark
~0.01
_crx = _cx + ((_a/2) - (random _a))

Now the thing you need to edit is this line _cz = (_flyheight + (25 - (random 50))) + _z in the BIS_Cloud.sqs

change the number 25 to any number you want but keep in mind that the clouds are spawned at a default height of 250

ex: _cz = (_flyheight + (250 - (random 50))) + _z will spawn the clouds at a height of 500

ex: _cz = (_flyheight + (500 - (random 50))) + _z will spawn the clouds at a height of 750

Finally, put this line this exec "scripts\BIS_CloudSystem.sqs" in the init of any units or your init file.

P.S. You don't need the weather module or the function module on the map anymore.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×