Chaosy
Tutorial Reviewer
- Joined
- Jun 9, 2011
- Messages
- 13,239
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.

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.