Home   Help Search Login Register  

Author Topic: fog or cloud cover  (Read 1226 times)

0 Members and 1 Guest are viewing this topic.

Offline gaz2644

  • Members
  • *
fog or cloud cover
« on: 26 Mar 2009, 17:59:09 »
Hello.
Im making a mission where the player starts off flying through heavy fog or clouds for a short time and then the fog/clouds clear.
My question is, is there a way of putting fog/clouds on a certain part of a map ?
I'v looked through the forum posts and haven't found anything.
Any help would be appreciated.

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: fog or cloud cover
« Reply #1 on: 26 Mar 2009, 19:09:35 »
 hey there
 i am at work at moment still but here on my laptop i have an old script i am sure itt works ,but will need a little tidying and probably some sqf man will make it efficient for you ;).

 [myplane] exec "clouds.sqs"
 clouds.sqs =
Code: [Select]
~1
private ["_obj","_pos","_ang","_dir","_rad","_i"]
_obj = _this select 0
_i = 0
_d = 250

#loop
_i = _i +1
_pos = position _obj
_dir = getdir _obj
_ang = random 360
_rad = random 11400
_colors = [[0,0,0],[0,0,0],[1,1,1]]
_sel = random (count _colors)
_sel = _sel - (_sel % 1)
_color = (_colors select _sel)
_posStruct = [_x + (sin _dir), _y + (cos _dir),_cm]
drop ["\ca\data\cl_basic", "", "Billboard", 220.1, 1320, [(_pos select 0)+sin(_ang)*_rad, (_pos select 1)+cos(_ang)*_rad,380], [random 3,random 3,0.001], 1, 1.275, 1, 1, [195,195],[[1,1,1,1]], [0,0], 0, 0, "", "",""]




_wait = .01

~_wait
?(_i > 2000) : goto "end"
goto "loop"
#end
exit

 i havent tested in a while ,if it wont work straight off ,i will give you some support later when i return you see this here *_rad,380 look in script and change 380 to a new height ,this is how far above the plane the clouds fog will appear, it can also be used for fog on ground etc. i think most of it originates from Nim weather , i happened upon it when i was converting nim weather to arma and so credit for some goes to sentinel (if it works still). oh and thisa random 11400 is how far the radius of the clouds/fog will be from original object so reduce for smaller areas and remomve random factor for a specific defined area

« Last Edit: 26 Mar 2009, 19:13:23 by DeanosBeano »
I love ofp

Offline gaz2644

  • Members
  • *
Re: fog or cloud cover
« Reply #2 on: 26 Mar 2009, 21:25:24 »
Hi mate
Thanks for your reply. :)
The script works fine thanks.
The thing is it puts small cloud formations that follow the plane. What im after is a dirty great big cloud at the start of the mission for the plane to fly through. btw i forgot to mention there are about 10 planes that need to fly through it.
I am no good at scripting but if this script can be made to do this that would be exelent  :good:

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: fog or cloud cover
« Reply #3 on: 26 Mar 2009, 22:04:24 »
 hmm

 try this its still many clouds but there right on the plane .
 
Code: [Select]
~1
private ["_obj","_pos","_ang","_dir","_rad","_i"]
_obj = _this select 0
_i = 0
_d = 250

#loop
_i = _i +1
_pos = position _obj
_dir = getdir _obj
_ang = random 360
_rad = random 1400
_colors = [[0,0,0],[0,0,0],[1,1,1]]
_sel = random (count _colors)
_sel = _sel - (_sel % 1)
_color = (_colors select _sel)
_posStruct = [_x + (sin _dir), _y + (cos _dir),_cm]
drop ["\ca\data\cl_basic", "", "Billboard", 220.1, 1320, [(_pos select 0)+sin(_ang)*_rad, (_pos select 1)+cos(_ang)*_rad,getpos _obj select 2], [random 3,random 3,0.001], 1, 1.275, 1, 1, [395,395],[[1,1,1,1]], [0,0], 0, 0, "", "",""]


?(_i > 2000) : goto "end"
goto "loop"
#end
exit

[395,395] this is size  and adjust the _i>2000 for amount of clouds in radius . i just changed size and took out the wait.
 mess with those and see how ya go, if the planes start neare eachother just run the script on one .

I love ofp

Offline gaz2644

  • Members
  • *
Re: fog or cloud cover
« Reply #4 on: 26 Mar 2009, 23:59:26 »
Thanks that works fine  :good:
All i done was add an ai plane flying in my group with the script assigned to that. Then i set a way point for it to dissapear and when it did the fog cleared. There may be another way but that works for me  :D
So thanks again  :)
« Last Edit: 27 Mar 2009, 00:32:38 by gaz2644 »