Forum Jump :

Author Message


Posts: 6
Rank:


Level: Member

Country: nl
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2016-01-12 16:58        
     
Hi all, I'm new to modding / scripting, so please bear with me. I want to create a feeling of constant overcast and foggy weather for chernarus, on which I installed the original Dynamic Universal War System by kibot and tried out

0 setFog [1, 0.03, 0];

in the editors local exec, which worked like a charm, but now I'm clueless as to where I have to insert it in my script to make it permanently overide the other settings of DUWS weather. Thanks in advance!


Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 57
In-game name: Kobayashi Maru

 
#2 Posted at 2016-01-12 17:18        
     
I don't know how DUWS sets the weather but generally this comes with description.ext and possible parameters at start.
You could try to add in init.sqf (if this file doesn't exist, create it in the mission folder):
waitUntil {!isNil "bis_fnc_Init"}; // in case of SP mission
if (!isServer) exitwith {};
0 setFog [1, 0.03, 0];

In MP, the 2 last lines should be sufficient. See initialization order here.

The fact you use an array is OK for the Arma3 version > 0.56. This is now a server command synchronizing theses settings on all clients.

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Advertisement


Author Message


Posts: 6
Rank:


Level: Member

Country: nl
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2016-01-12 17:43        
     
Dear Pierre,
thank you for your reply. I have tried pasting your code into init.sqf, saved and re-loaded the saved file in the Arma 3 editor. The result I get when executing from the debug console is different from what loads automatically, which leads me to believe it isnt working. Is there a specific place in the init.sqf document that I have to paste the lines into?


Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 57
In-game name: Kobayashi Maru

 
#4 Posted at 2016-01-12 21:29        
     
I don't know where the problem is. You just have to past the code I wrote in init.sqf. The line:
if (!isServer) exitwith {};
means all after this line is running on server only. So, take this into account and add these lines at the end of init.sqf. If you have other lines initializing some scripts for all players, they must be above of this one.

Are you in SP or MP ? Due to the init order, it's important to wait for all DUWS initialisation. This script could use some post-init settings. If you run the mission in SP, you have to wait with the line:
waitUntil {!isnil "bis_fnc_init"};
or
waitUntil {player == player}; // not on a dedicated server of course!
waitUntil {time > 3}; // you can add this also

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Author Message


Posts: 2
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#5 Posted at 2016-01-13 02:12        
     
DUWS has it's own weather script so simply adding a line in the init.sqf might not change anything. Depending on the DUWS fork you're playing, the init.sqf should have a line like:

if (isNil "weather_type") then {weather_type = "tropical";};     // choose between "tropical" - "arid" - "temperate" - "temperate_cold" - "mediterranean"

I don't remember any of those choices being particularly foggy though. Choose one, then you can edit the setFog parameters in dialog\startup\weather.sqf. Increase _fog_intensity and _fog_height... and for feel it might also help to adjust _overcast_intensity as well.

    case "tropical":
    {
    while {_weather_loop} do {
    _wait_after = 900; // EN SECONDES
    
    _fog_time = 5; // EN MINUTES !!
    _fog_time = (_fog_time * 60); // transforme en secondes
    _fog_intensity = random 6;
    _fog_intensity = (_fog_intensity / 10); // transforme en dixèmes
    _fog_intensity = (_fog_intensity + 0.3); // donne la valeur min
	if (_fog_intensity<0.01) then {_fog_intensity = 0.01};
    _fog_height = random 1;
    _fog_height = (_fog_height / 10); // transforme en centiemes 
	if (_fog_height<0.1) then {_fog_height = 0.1};	
	diag_log format ["DUWS DEBUG: %3 setFog [%1, %2, 10]", _fog_intensity, _fog_height, _fog_time];
    _fog_time setFog [_fog_intensity, _fog_height, 10];

    _overcast_intensity = random 1;
    0 setOvercast _overcast_intensity;
	OvercastVar = _overcast_intensity;
    publicVariable "OvercastVar";
    FogVar = fogParams;
    publicVariable "FogVar";
    WindVar = Wind;
    publicVariable "WindVar";
	weatherdone = true;
	

    _wait_total = _fog_time + _wait_after;
    _wait_total_minute = _wait_total / 60;
    sleep (_wait_total);
	
    }; //end while
    }; //end case

I haven't done much with DUWS in a while, but that should be the place to start.


Author Message


Posts: 6
Rank:


Level: Member

Country: nl
Location:
Occupation:
Age:
In-game name:

 
#6 Posted at 2016-01-13 13:20        
     
Thanks all, I will give both ideas a try and report back.