[JASS] AddWeatherEffect not working

Status
Not open for further replies.

Chaosy

Tutorial Reviewer
Level 41
Joined
Jun 9, 2011
Messages
13,288
JASS:
		function NewDay()
		{
			string s = "";
			integer rng = GetRandomInt(1,100);
			day += 1;
			PlaySoundBJ(gg_snd_DaybreakRooster);
			
			BJDebugMsg("Before");
			if(bj_lastCreatedWeatherEffect != null)
			{
				RemoveWeatherEffect(bj_lastCreatedWeatherEffect);
			}
			BJDebugMsg("After");
			
			if(rng < mist)
			{
				AddWeatherEffect(GetPlayableMapRect(), 'FDwl');
				currentWeather = "|c00959697mist|r";
			}
			else if(rng < heavyRain)
			{
				AddWeatherEffect(GetPlayableMapRect(), 'RLhr');
				currentWeather = "|c001CE6B9heavy rain";
			}
			else if(rng < lightRain)
			{
				AddWeatherEffect(GetPlayableMapRect(), 'RLlr');
				currentWeather = "|c001CE6B9light rain";
			}
			else if(rng < sunny)
			{
				AddWeatherEffect(GetPlayableMapRect(), 'LRaa');
				currentWeather = "|c00FFFC01sunny";
			}
			else if(rng < cloudy)
			{
				currentWeather = "|c00959697cloudy";
			}
			s = "The sun rises once more. |c00FFFC01Day " + I2S(day) + " - " + currentWeather;
			DisplayTimedTextToPlayer(Player(0), 0, 0, 5, s);
		}

The weather refuse to work. The currentWeather message is displayed properly.
ebe4c5735a4da6772b28713c0600f07f.png


I know GetPlayableMapRect() is inefficient but changing it to bj_whatever did not solve the issue.
I used the BJ version of the weather function before but did not work either.
 
I think you need to "enable" your weather effect after you created it =)) Check out GUI weather action (its under environment section) for confirmation.
 
Status
Not open for further replies.
Back
Top