Jump to content

Recommended Posts

I am going to put some fog into my mission but wanted the Fog to start coming in over the first hour then disperse over the next hour

Would this work ? and would it be JIP compatible as i is running on the server ?

init.sqf

if (isServer) then {
[] execVM "Weather.sqf";
};

Weather.sqf

if(not isServer) exitWith{};
3600 setFog [0.5, 0.01, 80]  ///  come in over the hour
sleep 3610  /// wait for Fog to be for 1 hour
3600 setFog [0, 0, 0]  // take fog off over the hour

Edited by psvialli

Share this post


Link to post
Share on other sites

hi,

I tested it out and if I put it on the server like this:

init.sqf

if (isServer) then {
[] execVM "fog.sqf";
};  

and fog.sqf:

if(not isServer) exitWith{};

sleep 30;
0 setFog [0.08,0.1,50];
sleep 3;
3 setFog [0.08,0.1,40];
sleep 3;
3 setFog [0.08,0.1,30];
sleep 3;
3 setFog [0.08,0.1,20];
sleep 3;
3 setFog [0.08,0.1,10];
sleep 3;
3 setFog [0.08,0.1,5];
sleep 3;
3 setFog [0.08,0.1,0];
sleep 18;
hint "1st";
3 setFog [0.08,0.1,5];
sleep 3;
3 setFog [0.08,0.1,10];
sleep 3;
3 setFog [0.08,0.1,20];
sleep 3;
3 setFog [0.08,0.1,30];
sleep 3;
3 setFog [0.08,0.1,40];
sleep 3;
3 setFog [0.08,0.1,50];
sleep 18;
hint "2nd";
3 setFog [0.08,0.1,40];
sleep 3;
3 setFog [0.08,0.1,30];
sleep 3;
3 setFog [0.08,0.1,20];
sleep 3;
3 setFog [0.08,0.1,10];
sleep 3;
3 setFog [0.08,0.1,5];
sleep 3;
3 setFog [0.08,0.1,0];
hint "end";

No fog or hints appear. But if I do it like this:

init.sqf

_null = [] execVM "scripts\fog.sqf";

and fog.sqf:

sleep 30; 
0 setFog [0.08,0.1,50]; 
sleep 3; 
3 setFog [0.08,0.1,40]; 
sleep 3; 
3 setFog [0.08,0.1,30]; 
sleep 3; 
3 setFog [0.08,0.1,20]; 
sleep 3; 
3 setFog [0.08,0.1,10]; 
sleep 3; 
3 setFog [0.08,0.1,5]; 
sleep 3; 
3 setFog [0.08,0.1,0]; 
sleep 18; 
hint "1st"; 
3 setFog [0.08,0.1,5]; 
sleep 3; 
3 setFog [0.08,0.1,10]; 
sleep 3; 
3 setFog [0.08,0.1,20]; 
sleep 3; 
3 setFog [0.08,0.1,30]; 
sleep 3; 
3 setFog [0.08,0.1,40]; 
sleep 3; 
3 setFog [0.08,0.1,50]; 
sleep 18; 
hint "2nd"; 
3 setFog [0.08,0.1,40]; 
sleep 3; 
3 setFog [0.08,0.1,30]; 
sleep 3; 
3 setFog [0.08,0.1,20]; 
sleep 3; 
3 setFog [0.08,0.1,10]; 
sleep 3; 
3 setFog [0.08,0.1,5]; 
sleep 3; 
3 setFog [0.08,0.1,0]; 
hint "end";

everything works fine but it isn't sync to other player.

So i made it static and player can choose via parameter:

init.sqf:

if (PARAMS_WithFog == 1) then { _null = [] execVM "scripts\fog.sqf"; };

description.ext:

class Params
{
class WithFog
{
	title = "Enable New Fog";
	values[] = {1,0};
	texts[] = {"Yes","No"};
	default = 1;
};
};

and fog.sqf:

0 setFog [1,0.1,1];

I hope that help you a bit.

Anjan

Edited by Anjan-Riot

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  

×