Creepy night fog

None of us are perfect man. Retra is a decent fellow but we all make mistakes. But here is a thought ( I myself subscribe to the "not perfect" thing, just learned basics of scripting recently.) couldnt you define
Code:
_inVehicle = (vehicle player != player);
_vehiclePlayer = (vehicle player);
within _pos so it recognizes that a player is in a vehicle as well as not in a vehicle ?

Has anyone actually tested this out?

Just want to know if I made a valid educated guess ^.^
 
Code:
_inVehicle = (vehicle player != player);
if (_inVehicle) then {
_obj = (vehicle player);
} else {
_obj = player;
};
_pos = position _obj;

You need to use the vehicle variables, not just define them (as torturedchunk said). Here I use _inVehicle as a test in the if statement, so it should be able to recognize the difference between the two (in car or not).

It's early though, and I just woke up, so I may have missed something.
 
Code:
_inVehicle = (vehicle player != player);
if (_inVehicle) then {
_obj = (vehicle player);
} else {
_obj = player;
};
_pos = position _obj;

You need to use the vehicle variables, not just define them (as torturedchunk said). Here I use _inVehicle as a test in the if statement, so it should be able to recognize the difference between the two (in car or not).

It's early though, and I just woke up, so I may have missed something.


Looks good to me mmmyum. I haven't had enough time to play with the original script but the above should provide the necessary fix. :)
 
Well, here is what I have working for player only. Still does not work while in vehicle. It could be the way createVehicleLocal is working. Not sure. Still testing it a bit.

Code:
private ["_obj","_pos","_d","_h","_h1","_h2","_density","_fog1","_fog2","_fog3"];
waitUntil {!isNull player};
 
while {alive player} do {
 
    if(daytime < 5 || daytime > 19) then {
 
        //_obj = player;
        //_pos = position (vehicle _obj);
        _inVehicle = (vehicle player != player);
        if (_inVehicle) then {
            _obj = (vehicle player);
        } else {
            _obj = player;
        };
     
        _pos = position _obj;
     
        setWind [0, -2, true];
 
        _d = 15;
        _h = 12;
        _h1 = 8;
        _h2 = 4;
        _density = 20000;
 
        _fog1 = "#particlesource" createVehicleLocal _pos;
        _fog1 setParticleParams [
        ["\Ca\Data\ParticleEffects\Universal\universal.p3d" , 16, 12, 13, 0], "", "Billboard", 1, 10,
            [0, 0, -6], [0, 0, 0], 1, 1.275, 1, 0,
            [7,6], [[1, 1, 1, 0], [1, 1, 1, 0.04], [1, 1, 1, 0]], [1000], 1, 0, "", "", _obj
        ];
        _fog1 setParticleRandom [3, [55, 55, 0.2], [0, 0, -0.1], 2, 0.45, [0, 0, 0, 0.1], 0, 0];
        _fog1 setParticleCircle [0.001, [0, 0, -0.12]];
        _fog1 setDropInterval 0.01;
 
        _fog2 = "#particlesource" createVehicleLocal _pos;
        _fog2 setParticleParams [
        ["\Ca\Data\ParticleEffects\Universal\universal.p3d" , 16, 12, 13, 0], "", "Billboard", 1, 10,
            [0, 0, -6], [0, 0, 0], 1, 1.275, 1, 0,
            [7,6], [[1, 1, 1, 0], [1, 1, 1, 0.04], [1, 1, 1, 0]], [1000], 1, 0, "", "", _obj
        ];
        _fog2 setParticleRandom [3, [55, 55, 0.2], [0, 0, -0.1], 2, 0.45, [0, 0, 0, 0.1], 0, 0];
        _fog2 setParticleCircle [0.001, [0, 0, -0.12]];
        _fog2 setDropInterval 0.01;
 
        _fog3 = "#particlesource" createVehicleLocal _pos;
        _fog3 setParticleParams [
        ["\Ca\Data\ParticleEffects\Universal\universal.p3d" , 16, 12, 13, 0], "", "Billboard", 1, 10,
            [0, 0, -6], [0, 0, 0], 1, 1.275, 1, 0,
            [7,6], [[1, 1, 1, 0], [1, 1, 1, 0.04], [1, 1, 1, 0]], [1000], 1, 0, "", "", _obj
        ];
        _fog3 setParticleRandom [3, [55, 55, 0.2], [0, 0, -0.1], 2, 0.45, [0, 0, 0, 0.1], 0, 0];
        _fog3 setParticleCircle [0.001, [0, 0, -0.12]];
        _fog3 setDropInterval 0.01
    };
sleep 120;
};
 
Ok Cancel that. In mission Editor, this works after the sleep 120 completes. There is always a "but", driving the fog cant keep up with you in front and more or less follows you.

Try out what I posted in the editor and you will see what I mean.

:)


EDIT: 2 more things, the very first fog that spawns around you, will stay there if you get in a vehicle and drive around. while still after the 120 sleep the new fog is around you and the vehicle. And Vice Versa.

ie, On foot spawns 1 Fog cloud, In vehicle spawns 1 fog cloud. one or the other stays until the player has changed to on foot or in vehicle then deletes and recreates.


Youll see in the editor what I mean if you try it.
 
That has
Ok Cancel that. In mission Editor, this works after the sleep 120 completes. There is always a "but", driving the fog cant keep up with you in front and more or less follows you.

Try out what I posted in the editor and you will see what I mean.

:)


EDIT: 2 more things, the very first fog that spawns around you, will stay there if you get in a vehicle and drive around. while still after the 120 sleep the new fog is around you and the vehicle. And Vice Versa.

ie, On foot spawns 1 Fog cloud, In vehicle spawns 1 fog cloud. one or the other stays until the player has changed to on foot or in vehicle then deletes and recreates.


Youll see in the editor what I mean if you try it.
Whether or not the fog can keep up with you while driving is dependent on the fog settings, provided the delay between when you get in a vehicle and when it starts spawning is eliminated. I have settings that work great with the Rockhount fog, but I haven't tried to accomplish the same with this one since it never worked in vehicles before. I'll do some experimenting, but I'm pretty sure if you change the radius to 300m, change the respawn rate, and increase the randomization range of the cloud size, you can outpace any ground vehicle.

Unfortunately I have had no luck getting Rockhount's fog to follow players in DayZ... works fine in the editor, but DayZ doesn't seem to run the FSM.

It looks a bit funny with helicopters regardless since you can't cover the entire map without getting cloud pockets. I really wish someone knew exactly how they got it to work in Breaking Point.
 
I had major fps drop using the fog.fsm. I prefer this fog script and I will continue to tinker with it.

I'll update when I can. :)
 
I had major fps drop using the fog.fsm. I prefer this fog script and I will continue to tinker with it.

I'll update when I can. :)
Were you able to get the FSM version to work in multi with it tied to the player? If so, I'd love to know how.

I tweaked the settings quite a bit in the editor and was able to get it to where it was visually impressive but didn't tank my laptop performance. I just could never get it to run in an actual DayZ server like it did in the editor. I had to use fog generators for the server, which when there's more than one, totally slaughters the performance and causes some weird flash syncs when you have too many of them.
 
Once I noticed the performance drop in the editor, I stopped there. If you want I can take a look yours and see if I can get it to work.

Let me know.
 
I gave up on the FSM. Its a great idea, but to get the results out of it that look any good at all, you drop 15-20fps. Much worse of an affect than the OP. Here is what I came up with. Vehicle is still iffy because of the sleeps, but I added a variable so JIP stays synced and it also deletes the fog each time it spawns to keep it smooth.

I noticed with the OP, if you didnt move, after about 2 mins, you could watch the fog wig out. This fixes that by deleting and creating the effect each time. Try this out and let me know. :)

Mission init.sqf
Code:
_GF = [] execVM "path\ground_fog.sqf";
path = wherever you put your custom scripts (ie fixes)


ground_fog.sqf
Code:
// Ground Fog - TorturedChunk - Kaysi - mmmyum @ OpenDayZ.net
waitUntil {!isNull player};
doofog = {
private ["_obj","_pos","_fog1","_fog2","_fog3","_inVehicle"];
        _inVehicle = (vehicle player != player);
 
        if (_inVehicle) then {
            _obj = (vehicle player);
        } else {
            _obj = player;
        };
 
        _pos = position _obj;
 
        _fog1 = "#particlesource" createVehicleLocal _pos;
        _fog1 setParticleParams [
        ["\Ca\Data\ParticleEffects\Universal\universal.p3d" , 16, 12, 13, 0], "", "Billboard", 1, 10,
            [0, 0, -6], [0, 0, 0], 1, 1.275, 1, 0,
            [7,6], [[1, 1, 1, 0], [1, 1, 1, 0.04], [1, 1, 1, 0]], [1000], 1, 0, "", "", _obj
        ];
        _fog1 setParticleRandom [3, [55, 55, 0.2], [0, 0, -0.1], 2, 0.45, [0, 0, 0, 0.1], 0, 0];
        _fog1 setParticleCircle [0.001, [0, 0, -0.12]];
        _fog1 setDropInterval 0.01;
 
        _fog2 = "#particlesource" createVehicleLocal _pos;
        _fog2 setParticleParams [
        ["\Ca\Data\ParticleEffects\Universal\universal.p3d" , 16, 12, 13, 0], "", "Billboard", 1, 10,
            [0, 0, -6], [0, 0, 0], 1, 1.275, 1, 0,
            [7,6], [[1, 1, 1, 0], [1, 1, 1, 0.04], [1, 1, 1, 0]], [1000], 1, 0, "", "", _obj
        ];
        _fog2 setParticleRandom [3, [55, 55, 0.2], [0, 0, -0.1], 2, 0.45, [0, 0, 0, 0.1], 0, 0];
        _fog2 setParticleCircle [0.001, [0, 0, -0.12]];
        _fog2 setDropInterval 0.01;
 
        _fog3 = "#particlesource" createVehicleLocal _pos;
        _fog3 setParticleParams [
        ["\Ca\Data\ParticleEffects\Universal\universal.p3d" , 16, 12, 13, 0], "", "Billboard", 1, 10,
            [0, 0, -6], [0, 0, 0], 1, 1.275, 1, 0,
            [7,6], [[1, 1, 1, 0], [1, 1, 1, 0.04], [1, 1, 1, 0]], [1000], 1, 0, "", "", _obj
        ];
        _fog3 setParticleRandom [3, [55, 55, 0.2], [0, 0, -0.1], 2, 0.45, [0, 0, 0, 0.1], 0, 0];
        _fog3 setParticleCircle [0.001, [0, 0, -0.12]];
        _fog3 setDropInterval 0.01;
 
        _this setVariable ["playerfog", floor time + 5];
 
        sleep 120;
 
        deleteVehicle _fog1;
        deleteVehicle _fog2;
        deleteVehicle _fog3;
    };
[] spawn {
    while {true} do {
        if(daytime < 7 || daytime > 19) then {
            if (player getVariable ["playerfog", -1] < time) then {
                player setVariable ["playerfog", floor time + 5];
                player spawn doofog;
                sleep 120;
            };
        };
    };
};

Change the "daytime" values to your liking. This only creates the fog if the time is <7am or >7pm
 
hey there , there is no fog when i drive around in a vehicle

Edit : ok i fixed it with this :
Code:
        _vehicle = vehicle player;
        _inVehicle = (_vehicle != player);

instead this : _inVehicle = (vehicle player != player);

now the fog appears in a vehicle ... but when i drive the fog spawns to slowly or the radius must be bigger ... never worked with particleSettings before :/
 
Its hard to judge for vehicles because they all vary in speed so much. The above works pretty good because once you stop it catches up.


:)
 
Hi all,

Works fine with dayz epoch 1.4.2a. But the spawn area is a little bittle small.

Could anyone help me to make the range up to 200-250m?

Thanks an sry for bad english
 
Back
Top