Ground Fog - Guide

Hi im having that problem ..canyou tell me excatly what I need to delete plz..I think its somewhere by here:

Code:
#waittoactivate
~300
goto "[B][COLOR=#ff0000]nighttest[/COLOR][/B]"

but not sure what to delete and what to leave in.
I cant even stop it from saying 'cannot find fog.sqs!!

ill include a snippet from my mission.sqm below :

Code:
items=1;
                class Item0
                {
                    position[]={6288.5488,304.98645,7825.8896};
                    id=3;
                    side="LOGIC";
                    vehicle="Logic";
                    leader=1;
                    skill=0.60000002;
                    init="[this,10000,10000,7,19] exec ""fogs.sqs""";
                };

goto "nighttest"
 
So my fog.sqs should look like:?

Code:
_Center = _this select 0
_dist1=_this select 1
_dist2= _this select 2
 
?(count _this > 3):_endNight=_this select 3;_startNight=_this select 4; goto "nighttest"
?(count _this == 3):goto "bigloop"
 
#nighttest
_hours = Date select 3
?((_hours>=_endNight) && (_hours<_startNight)): goto "waittoactivate"
 
#bigloop
@(Player distance _Center)<_dist2
_i=0
#loop
_height=-0.3
_Rradius=180
_Cloudalpha=1
?((Player distance _Center)>_dist1):_Cloudalpha= 1-(((Player distance _Center) - _dist1)/(_dist2- _dist1))
_radius=(random 10)+random _Rradius
_angle=(random 360)
_size = 5
_col = 1
_CC=[_col,_col,_col,.3*_Cloudalpha]
drop ["\ca\data\cl_basic", "", "Billboard", 8+random 1,8+random 1,  [(getpos Player select 0)+_radius*(sin(_angle)),(getpos Player select 1)+_radius*(cos(_angle)),_height],[0,0,0],5 , 0.2, 0.1568, 0,[_size], [[_col,_col,_col,0],_CC,_CC,_CC,_CC,_CC,_CC,[_col,_col,_col,0]], [0],0,0,"", "",""]
_i=_i+1
?(_i<1800):goto "loop"
~1
?(count _this == 3): goto "bigloop"
goto "nighttest"
 
 
 
#waittoactivate
~300
goto "nighttest"
 
So my fog.sqs should look like:?

Code:
_Center = _this select 0
_dist1=_this select 1
_dist2= _this select 2
 
?(count _this > 3):_endNight=_this select 3;_startNight=_this select 4; goto "nighttest"
?(count _this == 3):goto "bigloop"
 
#nighttest
_hours = Date select 3
?((_hours>=_endNight) && (_hours<_startNight)): goto "waittoactivate"
 
#bigloop
@(Player distance _Center)<_dist2
_i=0
#loop
_height=-0.3
_Rradius=180
_Cloudalpha=1
?((Player distance _Center)>_dist1):_Cloudalpha= 1-(((Player distance _Center) - _dist1)/(_dist2- _dist1))
_radius=(random 10)+random _Rradius
_angle=(random 360)
_size = 5
_col = 1
_CC=[_col,_col,_col,.3*_Cloudalpha]
drop ["\ca\data\cl_basic", "", "Billboard", 8+random 1,8+random 1,  [(getpos Player select 0)+_radius*(sin(_angle)),(getpos Player select 1)+_radius*(cos(_angle)),_height],[0,0,0],5 , 0.2, 0.1568, 0,[_size], [[_col,_col,_col,0],_CC,_CC,_CC,_CC,_CC,_CC,[_col,_col,_col,0]], [0],0,0,"", "",""]
_i=_i+1
?(_i<1800):goto "loop"
~1
?(count _this == 3): goto "bigloop"
goto "nighttest"
 
 
 
#waittoactivate
~300
goto "nighttest"


yup! also make sure its a .sqs file not a .sqf - the one attached to the OP is a .sqf so you have to change it.
change the id=3 to id=1 also make sure its in the correct place in mission.sqm.. yours looks like it isn't in the right spot.

this section should be about line 1150 or so
Code:
        class Item1
        {
            side="LOGIC";
            class Vehicles
            {
                items=1;
                class Item0
                {
                    position[]={708.96582,35.858719,3533.1272};
                    id=50;
                    side="LOGIC";
                    vehicle="FunctionsManager";
                    leader=1;
                    lock="UNLOCKED";
                    skill=0.60000002;
                };
            };
        };
        class Item2
        {
            side="LOGIC";
            class Vehicles
            {
                items=1;
                class Item0
                {
                    position[]={6279.4966,304.98645,7825.8896};
                    id=1;
                    side="LOGIC";
                    vehicle="Logic";
                    leader=1;
                    skill=0.60000002;
                    init="[this,10000,10000, 7, 19] exec ""fog.sqs""";
                };
            };
        };
    };
 
Sure Aaron.

1) Download this.
2) Extract the "fog.fsm".
3) Put the "fog.fsm" on your mission folder in a folder named "Scripts". (Just so you don't have to modify my file).
4) Download my testing script here.
5) Put the file on the "Scripts" folder you just created.
6) Open or create the init.sqf for your mission.
7) Add in the following line at the bottom:

Code:
[]execVM "Scripts\GroundFog.sqf";

8) Save everything.
9) Open your mission and try it out.

I highly recommend you maintain the file names and paths for this test. It won't work if you change the names or the paths. You'll have to manually change them inside the GroundFog.sqf which can be a pain. Also, this test is meant for LINGOR. It'll work in any map, but I don't know where specifically.

To check if it worked, ON LINGOR, go to grid coordinate 025-076. Fog should spawn as soon as you start.

I also recommend you try this off-line on the 3D editor before you try to add it to your server. Also, read the information on fog.fsm, it's very useful.

I tried this and got it working offline in the 3D editor. But when i run it on my server it dosnt work. I run a Dayz Controle Center Chernarus server. Anybody who did get it working?
 
You sure you didn't wrap the call or the script on "if (isServer)" brackets or something similar? The script is client-side, so if you make it so only the server runs it, nobody will see the clouds. It works on single player because even if the said command is used, the game understands you are the server.

Also, if you can link me the file maybe I can take a look at it.
 
I just did what you sayd in the quote above. I gotte be honest i have no experience with scripting so i dont realy know what im doing. So i have no idear about running it client or server side. Dosnt it run it client side when it's in my dayz_1.chernarus.pbo ?

Code:
// Ground Fog Spawner - TEST
 
if (isServer) then {
 
//_GF0 = createTrigger ["EmptyDetector", [11598.463, 10637.396]];
//_GF0 setTriggerActivation ["LOGIC", "NOT PRESENT", false];
//_GF0 setTriggerStatements ["this", "null=[GF0,70,1,300,10,20,-1.5,3,0.6,1,1,1,20,20,40,false,0.3,10,0.3,0.5,0.5,0,0.5,23.5] execFSM ""Scripts\Fog.fsm"";", ""];
//GF0 = _GF0;
 
_GF2 = createTrigger ["EmptyDetector", [4909.1504, 5612.3276]];
_GF2 setTriggerActivation ["LOGIC", "NOT PRESENT", false];
_GF2 setTriggerStatements ["this", "null=[GF2,70,1,300,10,20,-1.5,3,0.6,1,1,1,20,20,40,false,0.3,10,0.3,0.5,0.5,0,0.5,23.5] execFSM ""Scripts\Fog.fsm"";", ""];
GF2 = _GF2;
 
processInitCommands;
};
 
Yeah, that code is old, I've been reworking the spawner.

For now, try this:

Code:
_GF0 = createTrigger ["EmptyDetector", [11598.463, 10637.396]];
_GF0 setTriggerActivation ["LOGIC", "NOT PRESENT", false];
_GF0 setTriggerStatements ["this", "null=[GF0,70,1,300,10,20,-1.5,3,0.6,1,1,1,20,20,40,false,0.3,10,0.3,0.5,0.5,0,0.5,23.5] execFSM ""Scripts\Fog.fsm"";", ""];
GF0 = _GF0;
 
_GF2 = createTrigger ["EmptyDetector", [4909.1504, 5612.3276]];
_GF2 setTriggerActivation ["LOGIC", "NOT PRESENT", false];
_GF2 setTriggerStatements ["this", "null=[GF2,70,1,300,10,20,-1.5,3,0.6,1,1,1,20,20,40,false,0.3,10,0.3,0.5,0.5,0,0.5,23.5] execFSM ""Scripts\Fog.fsm"";", ""];
GF2 = _GF2;

When I get home tonight I'll link my new version which is a bit more efficient.

EDIT:

Try this.
 
I tried it and in the editor it works fine but still nothing on the server. Am i suppose to put anything in the mission.sqm? Or does it not work for the first person who logs onto the server like the OP fog? With Andrews fog it seems the first person on the server dosnt get the fog. And ever after that it's kind of hit or mis. So it might be DayzCC screwing me.
 
Hum, I had a problem with it yesterday regarding people being able to see it or not...

Not sure what is wrong, I've gotten it working with the old version. Give me some time to test it today and I'll come back with more info.
 
I am rarely Pedantic, but this mod is technically not fog, it would be considered mist due the visibility. Fog would be much thicker and visibility would be much less.
 
It's really very simple if you read the instructions properly.

Just download the fog.fsm (second link) and put it into your mission file.
Enter your game, press Control + E to enter you 3D editor.
Put down a Game Logic (create a Center Logic, Group Logic and in Units look for "Game Logic").
Name this Game Logic something, I went for "FogTrigger".
In the init of the Game Logic put the suggested command:

Code:
null=[l1,100,11,10,3,7,-0.3,0.1,0.5,1,1,1,13,12,15,true,2,2.1,0.1,4,6,0,3. 5,17.5] execFSM "Fog.fsm";

Now, change the "l1" for "FogTrigger" (try it with and without the inverted commas if it doesn't work and bear in mind it's case sensitive) and then see how it works.

Now all that complicated line of code is actually the different configurations of the fog you are putting down. If you look at the Fog.fsm file, it comes with a very detailed explanation of what each number is related to. Size, height, quantity of clouds, respawn frecuency, if affected by wind or not, wind strength, etc.

I found out that for a "thick" realistic fog, it's better to keep cloud size between 10-20 and quantity to four or five times the affected area. Suppose you are trying to cover a 50m area, set cloud count to 250. But you can try your own combinations and see what fits your idea best.

where do i put this code?

activateAddons [
];

activateAddons [];
initAmbientLife;

_this = createCenter west;
_center_0 = _this;

_group_0 = createGroup _center_0;

_unit_0 = objNull;
if (true) then
{
_this = _group_0 createUnit ["Camo1_DZ", [7357.9395, 7790.7275, 0], [], 0, "CAN_COLLIDE"];
_unit_0 = _this;
_this setVehicleInit "null=[player,100,11,10,3,7,-0.3,0.1,0.5,1,1,1,13,12,15,true,2,2.1,0.1,4,6,0,3.5,17.5] execFSM ""Fog.fsm"";";
_this setUnitAbility 0.60000002;
if (true) then {_group_0 selectLeader _this;};
if (true) then {selectPlayer _this;};
};

processInitCommands;
runInitScript;
finishMissionInit;
 
Alright... I'm assuming you are using the script method from what you linked.

Grab your script file, erase everything, and put this in:

Code:
GF0 = createTrigger ["EmptyDetector", [7357.9395, 7790.7275, 0]];
GF0 setTriggerActivation ["LOGIC", "NOT PRESENT", false];
GF0 setTriggerStatements ["this", "null=[GF0,70,1,300,10,20,-1.5,3,0.6,1,1,1,20,20,40,false,0.3,10,0.3,0.5,0.5,0,3.5,17.5] execFSM ""Fog.fsm"";", ""];

I changed the object to which the fog is attached to a logic trigger, instead of a unit as you did. Also, check the pathing for the Fog.fsm file and make sure it's right for you.

Always test the mission off-line.

Bear in mind I've had people complain about FPS loss with the fog. Currently I have removed it from my server.
 
I've managed to get it looking alright. The compromise is a much limited range on the fog. This would work reasonably well for flatter maps, but it wouldn't look very nice on any map with hills and bumps all over. Spent time trying to figure it out, but can't determine why things go all smoke grenade with an expanded range.

i second that, ide love to see those files :)
 
Hey guys, I will be showing you how to add fog to your server that looks like the fog from breaking point DayZ mod. It looks like this.. covering Balota airfield.
6JLohaQ.jpg


To add fog to your server you will need to only need to edit your mission.sqm file and add one more file.
Before I teach you guys how to add fog I need to explain what it is and what it does (might seem like something stupid to do.. but it will help with understanding later) The fog is spawned around a set point. For an example, 4743.666,9,2542.4561 is a point at Balota Airfield where the fog above is spawning.
I will teach you how to spawn/put fog in two different ways.
You place fog on points and it spreads out in a set distance in x and y, so you can place it in certain places on the map. >Airfields, Big cities, Forests
OR you can place one point of fog in the center of the map and have it spread around the whole map.. giving an eerie look where ever you go.
On to what you have to do

First you will need to create a file called fog.sqs and paste this inside of it (I will also attach my fog file for you guys at the bottem.. to make it easier)

Code:
_Center = _this select 0
_dist1=_this select 1
_dist2= _this select 2
 
_height=-0.3
_Rradius=250
#bigloop
@(Player distance _Center)<_dist2
_i=0
#loop
_Cloudalpha=1
?((Player distance _Center)>_dist1):_Cloudalpha= 1-(((Player distance _Center) - _dist1)/(_dist2- _dist1))
_radius=(random 10)+random _Rradius
_angle=(random 360)
_size = 5
_col = 1
_CC=[_col,_col,_col,.3*_Cloudalpha]
drop ["\ca\data\cl_basic", "", "Billboard", 8+random 1,8+random 1,  [(getpos Player select 0)+_radius*(sin(_angle)),(getpos Player select 1)+_radius*(cos(_angle)),_height],[0,0,0],5 , 0.2, 0.1568, 0,[_size], [[_col,_col,_col,0],_CC,_CC,_CC,_CC,_CC,_CC,[_col,_col,_col,0]], [0],0,0,"", "",""]
_i=_i+1
?(_i<1800):goto "loop"
~1
goto "bigloop"

Explaining what some values you can edit in here (best to leave them alone.. but are editable if needed)
height - the spawn height of the clouds.. best to have that under zero for the effect of being ground fog..

Pack that into your mission.pbo - you don't need to edit it more.

Now how to place fog around the map!

Method One.
To place fog in packets around the map, so they are only in certain points and not everywhere you open your mission.sqm file scroll all the way down.. past the first class items 0-99 to the next class items starting at class item1 which looks like this at about line 1146 (using notepad++)
AFTER THIS IS WHERE YOU START EDITING FOG*** Posting this to help you guys find where you need to edit - Using cntrl+f or however you go about it
Code:
class Item1
        {
            side="LOGIC";
            class Vehicles
            {
                items=1;
                class Item0
                {
                    position[]={708.96582,35.858719,3533.1272};
                    id=50;
                    side="LOGIC";
                    vehicle="FunctionsManager";
                    leader=1;
                    lock="UNLOCKED";
                    skill=0.60000002;
                };
            };
        };
AFTER THE LAST CLOSURE IS WHERE YOU EDIT
Code:
class Item2
{
side="LOGIC";
class Vehicles
{
items=1;
class Item0
{
position[]={4743.666,9,2542.4561};
id=1;
side="LOGIC";
vehicle="Logic";
leader=1;
skill=0.60000002;
init="[this,100,150] exec ""fog.sqs""";
};
};
};
class Item3
{
side="LOGIC";
class Vehicles
{
items=1;
class Item0
{
position[]={4838.4629,5.7515168,2328.8635};
id=2;
side="LOGIC";
vehicle="Logic";
leader=1;
skill=0.60000002;
init="[this,100,150] exec ""fog.sqs""";
};
};
};
Paste that before classmarkers but still in the class items section (looking at mission.sqm you will understand)
That will spawn one set of fog at balota airfield near the ATC tower and one near the industrial hangers (based on coordinates - edit to whatever you want)
class Item1 is the functionsmanager so class item2 and above can be anything

TO EDIT FOG LOCATION/VALUES
Edit the Coordinates based on ARMA 2 COORDS - {X,Z,Y} On where you want the fog to be
id=1 Change that for each set of fog you need to add +1 to each set of fog placements you add so my first fog is id=1 then the second fog is id=2 and so on (3rd fog would be id=3 etc..)
Down to the last bit of code.. where it says [this,100,150] is where you can edit how big the fog is, increasing to how far it spawns. [X,Y]

LAST PART! VERY IMPORTANT
Edit this number based on how much fog you add at the points I showed you above.
Lets say you add 2 spots of fog like I did.
On the top of mission.sqm it says class Groups on line 33 One line below this it says items=2 which accounts for the first classitem 0-99 and the second set which we are editing.
For each placement of fog you add you need to add +1 to that items= If you added 2 fog placement points edit that number to items=4.. if you added 3 fog placements edit that to be items=5 and so on!

Method Two.
If you want to place fog through out the entire map follow this!

You edit under the same values as before ^ follow above
For data points I choose stary since its almost the center
Code:
class Item2
        {
            side="LOGIC";
            class Vehicles
            {
                items=1;
                class Item0
                {
                    position[]={6288.5488,304.98645,7825.8896};
                    id=3;
                    side="LOGIC";
                    vehicle="Logic";
                    leader=1;
                    skill=0.60000002;
                    init="[this,10000,10000] exec ""fog.sqs""";
                };
            };
        };
Change your items= to items=3 under class groups ^ addressed above and you are done!




To set a fog trigger to spawn fog during the night only see this post (bottom of the page)

Enjoy

Let me know if you need me to be clearer on any parts of this.. Thanks




I cannot upload a .sqs file so please change it to a .sqs file after you download or make your own shown above!
hey so followed your tutorial , and keep getting the error " cannot load mission " . has anyone encountered this before ? we are using utes map . have tried both options . full map and small points . still am yet to get it to work . please advice lol
 
Did you repack your pbo or leave your mission.sqm out? Its something bigger then just the fog, you wouldnt be able to see it if it didnt work, it wouldnt break your mission im pretty sure
 
sorry for the late reply , had to sleep , from the headache this stuff is giving me lol . ok so . repacked and fog were repacked in . we have put other " mods/scripts in " nothing major just like a debug and all into the pbo . but as soon as we put the fog in . bang cannot load mission . can we possibbly get someone to either give it a go for us ? or some help . ive looked for hours online cant find anything for our issue .
 
Back
Top