Home   Help Search Login Register  

Author Topic: Fog  (Read 1041 times)

0 Members and 1 Guest are viewing this topic.

Offline Knight Trane

  • Members
  • *
Fog
« on: 21 Dec 2008, 12:35:30 »
Looking for a way to limit the altitude of Fog.  This goes for MP as well as SP.  The idea is to have low lying fog. 

I was wondering if there was some way to limit the altitude of the existing fog?  That would make it appear low lying.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Fog
« Reply #1 on: 21 Dec 2008, 14:28:17 »
I can't see how you'd do it effectively using the existing fog command. You could change the value based on the player's height, but then you wouldn't see fog on the ground when you were in the air. You'd be able to clearly see infantry on the ground from the air, for example, even if they couldn't see you. Maybe that is fine for you though...

The only thing I can think of is generating particle-based fog which hugs the ground, though that wouldn't look so good and would be laggy if you wanted a reasonable amount of it.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Knight Trane

  • Members
  • *
Re: Fog
« Reply #2 on: 21 Dec 2008, 14:41:55 »
I guess I'm misunderstanding what "Fog" is in this game.  I thought at some level it was particle based like smoke.  My idea is not going to work.  I was thinking that if my player was at say elevation 100, and my advancing AI OPFOR were coming through a valley that was at say 50.  I could set the fog to a heavy setting and have it top out at 60.  My player wouldn't be able to see the advancing AI until they came out of the fog, but would be able to see targets out on hill tops and the like.

I have to say, I love this game.  Even with its short comings.

If any one has any thoughts please post.  Its interesting what comes out through this process.

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: Fog
« Reply #3 on: 21 Dec 2008, 18:36:29 »
You'd have to use the drop-command, as Spooner said, to generate particles to simulate fog. If done right, it can look quite neat, but most likely lag quite a bit. Also, I think AI will see through it. Anyways, I just started looking into making some mist for ArmA, and nicked a version of BAS' mist script from OFP that Captain had rewritten to work in ArmA. I just changed it to be a .sqf instead of .sqs...

Code: [Select]
_pos = _this select 0;
_delay = _this select 1;
_lifeTime = _this select 2;
_vel = _this select 3;
_pLifeTime = _this select 4;

_lifeTicks = _lifeTime / _delay;
_lifeTick = _lifeTicks;


while {_lifeTick > 0} do
{
_count =0;

while {_count <20} do
{
_dir = random 360;
_velx = _vel *sin  _dir;
_vely = _vel *cos _dir;
drop ["\ca\data\cl_basic", "", "Billboard", 1, _pLifeTime, [_pos select 0,_pos select 1,0.5], [_velx,_vely,0], 1, 1.275, 1, 0, [1 + (random 2)], [[0.8,0.8,0.8,0.1]], [0], 0, 0, "", "", ""];
_count = _count +1;
};

sleep (_delay);
_lifeTick = _lifeTick - 1;
};

Execute with [position, delay, lifeTime, velocity, partile lifetime] execVM "mist.sqf"

Here position is the positon that the mist will be created, lifetime is the time the script will run, velocity is the velocity of the particles and particle lifetime is the lifetime of each particle...

Just play around with it a bit I guess...if there's 2 thing I'm not good at in scripting it's dialog and drop command... :D