[SOLVED] Where are the weather settings?

BetterDeadThanZed

Valued Member!
In my init.c, I see this:

Code:
weather.MissionWeather(false);    // false = use weather controller from Weather.c

I can't find a Weather.c file anywhere. Where do I adjust the values to alter wind, clouds, rain, etc?
 
Are temperature settings located here as well?

Nevermind - they seem to originate from the map .pbo data
 
Last edited:
I know that there are some weather parameters in the init.c file in the mission folder.
I have not yet experimented with the values but maybe it helps you.
 
Can be done via the init.c

But you have to move the code further down the init for them to work.


Code:
/////////////////////////////////////////////////////////
    //INIT ECONOMY--------------------------------------
    Hive ce = CreateHive();
    if ( ce )
        ce.InitOffline();
/////////////////////////////////////////////////////////
    //DATE RESET AFTER ECONOMY INIT-------------------------
    int year;
    int month;
    int day;
    int hour;
    int minute;

    GetGame().GetWorld().GetDate(year, month, day, hour, minute);

    if (((month <= 9) && (day < 20)) || ((month >= 10) && (day > 20)))
    {
        month = 9;
        day = 20;
       
        GetGame().GetWorld().SetDate(year, month, day, hour, minute);
    }
/////////////////////////////////////////////////////////
//PUT WEATHER HERE =)
    Weather weather = g_Game.GetWeather();
    weather.MissionWeather(true);    // false = use weather controller from Weather.c
    weather.GetOvercast().SetLimits(0.2, 0.5);
    weather.GetRain().SetLimits(0.2, 0.5);
    weather.GetFog().SetLimits(0.0, 0.25);

    weather.GetOvercast().SetForecastChangeLimits(0.2, 0.5);
    weather.GetRain().SetForecastChangeLimits(0.2, 0.5);
    weather.GetFog().SetForecastChangeLimits(0.15, 0.45);

    weather.GetOvercast().SetForecastTimeLimits(1800, 1800);
    weather.GetRain().SetForecastTimeLimits(600, 600);
    weather.GetFog().SetForecastTimeLimits(1800, 1800);

    weather.GetOvercast().Set(Math.RandomFloatInclusive(0.5, 1.0), 0, 0);
    weather.GetRain().Set(Math.RandomFloatInclusive(0.0, 0.2), 0, 0);
    weather.GetFog().Set(Math.RandomFloatInclusive(0.0, 0.1), 0, 0);

    weather.SetWindMaximumSpeed(40);
    weather.SetWindFunctionParams(15, 40, 50);
 
Can be done via the init.c

But you have to move the code further down the init for them to work.


Code:
/////////////////////////////////////////////////////////
    //INIT ECONOMY--------------------------------------
    Hive ce = CreateHive();
    if ( ce )
        ce.InitOffline();
/////////////////////////////////////////////////////////
    //DATE RESET AFTER ECONOMY INIT-------------------------
    int year;
    int month;
    int day;
    int hour;
    int minute;

    GetGame().GetWorld().GetDate(year, month, day, hour, minute);

    if (((month <= 9) && (day < 20)) || ((month >= 10) && (day > 20)))
    {
        month = 9;
        day = 20;
      
        GetGame().GetWorld().SetDate(year, month, day, hour, minute);
    }
/////////////////////////////////////////////////////////
//PUT WEATHER HERE =)
    Weather weather = g_Game.GetWeather();
    weather.MissionWeather(true);    // false = use weather controller from Weather.c
    weather.GetOvercast().SetLimits(0.2, 0.5);
    weather.GetRain().SetLimits(0.2, 0.5);
    weather.GetFog().SetLimits(0.0, 0.25);

    weather.GetOvercast().SetForecastChangeLimits(0.2, 0.5);
    weather.GetRain().SetForecastChangeLimits(0.2, 0.5);
    weather.GetFog().SetForecastChangeLimits(0.15, 0.45);

    weather.GetOvercast().SetForecastTimeLimits(1800, 1800);
    weather.GetRain().SetForecastTimeLimits(600, 600);
    weather.GetFog().SetForecastTimeLimits(1800, 1800);

    weather.GetOvercast().Set(Math.RandomFloatInclusive(0.5, 1.0), 0, 0);
    weather.GetRain().Set(Math.RandomFloatInclusive(0.0, 0.2), 0, 0);
    weather.GetFog().Set(Math.RandomFloatInclusive(0.0, 0.1), 0, 0);

    weather.SetWindMaximumSpeed(40);
    weather.SetWindFunctionParams(15, 40, 50);

Hey Bro, is it keep working ?! I've tried it on my 1.06 Server, but doen't work at all, I'm trying to disable rain. My INI.C looks like it below:

//INIT WEATHER BEFORE ECONOMY INIT------------------------
Weather weather = g_Game.GetWeather();

weather.MissionWeather(true); // false = use weather controller from Weather.c

weather.GetOvercast().SetLimits(0.0, 0.0);
weather.GetRain().SetLimits(0.0, 0.0);
weather.GetFog().SetLimits(0.0, 0.0);

weather.GetOvercast().SetForecastChangeLimits(0.0, 0.0);
weather.GetRain().SetForecastChangeLimits(0.0, 0.0);
weather.GetFog().SetForecastChangeLimits(0.0, 0.0);

weather.GetOvercast().SetForecastTimeLimits(0, 0);
weather.GetRain().SetForecastTimeLimits(0, 0);
weather.GetFog().SetForecastTimeLimits(0, 0);

weather.GetOvercast().Set( Math.RandomFloatInclusive(0.0, 0.0), 0, 0);
weather.GetRain().Set(Math.RandomFloatInclusive(0.0, 0.0), 0, 0);
weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);

weather.SetWindMaximumSpeed(40);
weather.SetWindFunctionParams(15, 40, 50);
 
Back
Top