Jump to content
Sign in to follow this  
liuniwan528

The server is often raining, how to cancel

Recommended Posts

Why is it still raining after cancellation? 

void main()

{

 

 Hive ce = CreateHive();

 if ( ce )

  ce.InitOffline();

 

 Weather weather = g_Game.GetWeather();

 

 weather.GetOvercast().SetLimits( 0.0 , 1.0 );

 /*weather.GetRain().SetLimits( 0.0 , 1.0 );*/

 weather.GetFog().SetLimits( 0.0 , 0.25 );

 

 weather.GetOvercast().SetForecastChangeLimits( 0.0, 0.2 );

 /*weather.GetRain().SetForecastChangeLimits( 0.0, 0.1 );*/

 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.0, 0.3), 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(15);

 weather.SetWindFunctionParams(0.1, 0.3, 50);

}

Please help me, how to cancel the rainy days

Edited by liuniwan528

Share this post


Link to post
Share on other sites

you don't want to comment out that stuff

void main() {
 Hive ce = CreateHive();

 if ( ce )
  ce.InitOffline();

 Weather weather = g_Game.GetWeather();

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

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

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

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

 weather.SetWindMaximumSpeed(15);
 weather.SetWindFunctionParams(0.1, 0.3, 50);
}

This disables the Rain completely.

Edited by Aussie Cleetus

Share this post


Link to post
Share on other sites
2 hours ago, Aussie Cleetus said:

you don't want to comment out that stuff


void main() {
 Hive ce = CreateHive();

 if ( ce )
  ce.InitOffline();

 Weather weather = g_Game.GetWeather();

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

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

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

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

 weather.SetWindMaximumSpeed(15);
 weather.SetWindFunctionParams(0.1, 0.3, 50);
}

This disables the Rain completely.

thank you, friend.

Share this post


Link to post
Share on other sites
1 hour ago, Stewe88 said:

and if  i want always rain?

hrm...  let's see here... this is untested but... might work? I'm not certain of the max values for these so I am openly stating: THIS IS A GUESS

void main() {
 Hive ce = CreateHive();
 if ( ce )
  ce.InitOffline();

 Weather weather = g_Game.GetWeather();

 weather.GetOvercast().SetLimits( 0.0 , 1.0 );
 weather.GetRain().SetLimits( 1.0 , 1.0 ); // Set rain limits to 1.0 - which I am assuming is max (I could be very wrong)
 weather.GetFog().SetLimits( 0.0 , 0.25 );

 weather.GetOvercast().SetForecastChangeLimits( 0.0, 0.2 );
 weather.GetRain().SetForecastChangeLimits( 1.0, 1.0 ); // Force change to rain? - honestly a guess (not sure if this is max or not)
 weather.GetFog().SetForecastChangeLimits( 0.15, 0.45 );

 weather.GetOvercast().SetForecastTimeLimits( 1800 , 1800 );
 weather.GetRain().SetForecastTimeLimits( 86400 , 86400 ); // 24hrs in seconds (60*60*24) - Not sure if this is correct
 weather.GetFog().SetForecastTimeLimits( 1800 , 1800 );

 weather.GetOvercast().Set( Math.RandomFloatInclusive(0.0, 0.3), 0, 0);
 weather.GetRain().Set( Math.RandomFloatInclusive(1.0, 1.0), 0, 0); // Guessing effect here - honestly I have no idea
 weather.GetFog().Set( Math.RandomFloatInclusive(0.0, 0.1), 0, 0);
 
 weather.SetWindMaximumSpeed(15);
 weather.SetWindFunctionParams(0.1, 0.3, 50);
}

Again, I repeat... this is UNTESTED. I give no promise that it will work, but if it works for you - post back here to let everyone know. My experience was dropping all these to 0 to improve fps for players with low-end systems. I have no rain/fog/overcast on my server.

Edited by Aussie Cleetus

Share this post


Link to post
Share on other sites
10 hours ago, Aussie Cleetus said:

This disables the Rain completely.

Which file are you guys editing?  I have the same problem.

Share this post


Link to post
Share on other sites
22 minutes ago, THEGordonFreeman said:

Which file are you guys editing?  I have the same problem.

init.c

And dont just copy paste some random stuff like weather.GetRain().Set( Math.RandomFloatInclusive(1.0, 1.0), 0, 0) because Math.RandomFloatInclusive(1.0, 1.0) would mean to create a random float from 1.0 to 1.0 which makes zero sense.

 

Methods with docstring:

/*
		Sets limits of this phenomenon. (Intensity)

		Default values are:
			Min  = 0
			Max  = 1

		Min Function minimum (in range <0, 1>).
		Max Function maximum (in range <0, 1>).
*/

weather.GetRain().SetLimits(float min, float max);
/*
		Sets limits of change when forecast is computed.

		These limits govern how much the forecast value can change when it is computed by weather controller.

		Default values are:
			Min  = 0
			Max  = 1

		Min Forecast change minimum (in range <0, 1>).
		Max Forecast change maximum (in range <0, 1>).
*/

weather.GetRain().SetForecastChangeLimits( float min, float max );
/*
		Sets time range in which next forecast can be computed.

		Default values are:
			Min  = 300  (5 minutes)
			Max  = 3600 (1 hour)

		Min Minimal number of seconds.
		Max Maximal number of seconds.
*/

weather.GetRain().SetForecastTimeLimits( float min, float max );
/*
		Sets the forecast.
		forecast     Desired forecast value that should be met in given time.
		time         A time of the next change (how long it takes in seconds to interpolate to given value).
		minDuration  A minimal time in seconds the change will last.
*/

weather.GetRain().Set( float forecast, float time = 0, float minDuration = 0);

 

Edited by philippj

Share this post


Link to post
Share on other sites

My intention is to disable the rain completely for now.  It's always raining on our server...sick of it.  Once they get things fixed, we will just let the default go, but for now, it's kinda rediculous.

 

Share this post


Link to post
Share on other sites

This should disable rain

weather.GetRain().SetLimits(0.0, 0.0);
weather.GetRain().SetForecastChangeLimits(0.0, 0.0);

 

Share this post


Link to post
Share on other sites

thanks for correcting me, I will also correct my code with that information in hand.

I honestly did 0 research besides hacking the numbers down to 0. I see my error.

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  

×