Jump to content

Epoch 0.5 / static weather


Ghostrider-GRG

Recommended Posts

I've been wrestling with getting static weather to work with this build of epoch. Thus far I have:

set up static weather parameters in @epochhive\epochconfig.hpp:  WeatherStaticForecast[] = {68,0,{0,0,0},0,{0.3,0.3},0};   // Note the added 0 for lightening.

Commented out the "ChangeWeather" event in this same file:    // { 18000000, "ChangeWeather", 1 , 1},

Is there anything I am missing?

Many thanks in advance.

Link to comment
Share on other sites

Works for me on Altis with:

WeatherStaticForecast[] = {75.5,0,{0,0,0},0.4,{1,1},0}; // Default: {75.5,0,{0,0,0},0,{1,1}}; // Clear day; {19,1,{1,1,40},1,{5,5}}; // Cold Foggy Rainy Overcast Windy; Format: {temp <scalar>,rain <scalar>,fog <array>,overcast <scalar>,wind <array>}
events[] = {
    //{ 3600, "CarnivalSpawner", 0 , 1}, // SECOND <scalar>, EVENT <string>, INIT <scalar> 1 = run script at startup, 0 normal delay, PREPOSTFIX <scalar> 1 = use pre/postfix path (inside epoch settings pbo) 0 = use full file path
    // { 1800, "PaydayEvent", 0, 1},
    // { 1200, "MessageServer", 0, 1},
    { 2700, "AirDrop", 0 , 1},
    { 2400, "EarthQuake", 0 , 1},
    //{ 900, "ChangeWeather", 1 , 1},
    { 1200, "ContainerSpawner", 0 , 1},
    { 300, "PlantSpawner", 0 , 1} //No comma on last Entry
};

 

Link to comment
Share on other sites

1 minute ago, Grahame said:

Works for me on Altis with:


WeatherStaticForecast[] = {75.5,0,{0,0,0},0.4,{1,1},0}; // Default: {75.5,0,{0,0,0},0,{1,1}}; // Clear day; {19,1,{1,1,40},1,{5,5}}; // Cold Foggy Rainy Overcast Windy; Format: {temp <scalar>,rain <scalar>,fog <array>,overcast <scalar>,wind <array>}
events[] = {
    //{ 3600, "CarnivalSpawner", 0 , 1}, // SECOND <scalar>, EVENT <string>, INIT <scalar> 1 = run script at startup, 0 normal delay, PREPOSTFIX <scalar> 1 = use pre/postfix path (inside epoch settings pbo) 0 = use full file path
    // { 1800, "PaydayEvent", 0, 1},
    // { 1200, "MessageServer", 0, 1},
    { 2700, "AirDrop", 0 , 1},
    { 2400, "EarthQuake", 0 , 1},
    //{ 900, "ChangeWeather", 1 , 1},
    { 1200, "ContainerSpawner", 0 , 1},
    { 300, "PlantSpawner", 0 , 1} //No comma on last Entry
};

Thanks for the quick response - I will give that a try. I no doubt made a silly error somewhere.

 

Link to comment
Share on other sites

28 minutes ago, 82ndAB_Bravo17 said:

It looks like the changeweather script is supposed to set the static weather settings if they are provided, but for some reason it appears to be ignoring them and always setting its own weather.

Not for me... My Altis server is completely rain free on 0.5 with the above settings. Of course if you don't comment (or increase the timeout) of the ChangeWeather script's execution then it changes the weather and you only get your static settings until it does

Link to comment
Share on other sites

As far as I can tell, the params statement at line 26 of ChangeWeather,sqf is producing values that are only valid within the if statement because

diag_log format ["Static Weather is %1", EPOCH_WeatherStaticForecast];
if !(EPOCH_WeatherStaticForecast isEqualTo []) then {
    EPOCH_WeatherStaticForecast params ["_tempOVRD","_rainOVRD","_fogOVRD","_overcastOVRD","_windOVRD","_lightningOVRD"];
    diag_log format["Temp %1 Rain %2 Fog %3 Overcast %4 Wind %5 Lightning %6",_tempOVRD,_rainOVRD,_fogOVRD,_overcastOVRD,_windOVRD,_lightningOVRD];
} else {
	// Make database call to get "Weather:InstanceID" that can be set in the database to allow for weather controls outside of the game.
	_response = ["Weather", (call EPOCH_fn_InstanceID)] call EPOCH_fnc_server_hiveGETRANGE;
	if ((_response select 0) == 1 && (_response select 1) isEqualType [] && !((_response select 1) isEqualTo[])) then {
		_arr = _response select 1;
        _arr params ["_tempOVRD","_rainOVRD","_fogOVRD","_overcastOVRD","_windOVRD","_lightningOVRD"];
	};
};
diag_log format["Temp %1 Rain %2 Fog %3 Overcast %4 Wind %5 Lightning %6",_tempOVRD,_rainOVRD,_fogOVRD,_overcastOVRD,_windOVRD,_lightningOVRD];

Produces this

19:31:05 "Static Weather is [75.5,0,[0,0,0],0,[2,2],0]"
19:31:05 "Temp 75.5 Rain 0 Fog [0,0,0] Overcast 0 Wind [2,2] Lightning 0"
19:31:05 "Temp any Rain any Fog any Overcast any Wind any Lightning any"

 

Link to comment
Share on other sites

@82ndAB_Bravo17 You are 100% correct, I made this mistake. params make the variables local to the innermost code block and the reason most of the privates are done at the top of a script, instead of at the instantiation point of a variable.

it is just like using:

private _variableName = "somedata";

have fixed this for the next experimental build: https://github.com/EpochModTeam/Epoch/blob/experimental/Sources/epoch_server_settings/EpochEvents/ChangeWeather.sqf#L26-L36

Link to comment
Share on other sites

3 hours ago, vbawol said:

@82ndAB_Bravo17 You are 100% correct, I made this mistake. params make the variables local to the innermost code block and the reason most of the privates are done at the top of a script, instead of at the instantiation point of a variable.

it is just like using:


private _variableName = "somedata";

have fixed this for the next experimental build: https://github.com/EpochModTeam/Epoch/blob/experimental/Sources/epoch_server_settings/EpochEvents/ChangeWeather.sqf#L26-L36

Bizarre... I guess my weather is being set to that defined in mission.sqm and never changing because ChangeWeather.sqf is commented? Or have I just been really lucky? Because initially I'd forgotten to comment ChangeWeather after the new release and it started raining. Commenting it has left Altis sunny and bright...

Link to comment
Share on other sites

9 hours ago, Grahame said:

Bizarre... I guess my weather is being set to that defined in mission.sqm and never changing because ChangeWeather.sqf is commented? Or have I just been really lucky? Because initially I'd forgotten to comment ChangeWeather after the new release and it started raining. Commenting it has left Altis sunny and bright...

@Grahame we miss you in arma2 forums :laugh:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...