FANDOM


Glitch

I've done some stuff so far and it works, this just happened though. It happened because I called for the GlobalPer("weather") to be printed, before it was assigned...

Clearing
Talk to the 'Time' NPC to get the time.
Alternatively you can Use a watch
NPCs: Time,Weather
Exits: Forest

[ 215125: Talk to Weather ]
It is 0 outside currently
It is 0 outside currently
It is 0 outside currently

It is meant to say it is: sunny or raining or clear or cloudy, but because it wasn't assigned a value it returned 0. So it is currently 0 outside with a chance of 0 . xD


Update: 18:20 8 Jan 2012

You can smash yourself against my code over here.

There are some scripting errors in the Time NPC, but they don't effect it's workings, It still works fine.



Update 14:50 9 Jan 2012

Here is the source code for a Tropical area's weather patterns.

function OnEnter()
{
if (GlobalPer("time_hr") == 6)
{
ClimateCheck();
}
else if (GlobalPer("time_hr") == 12)
{
ClimateCheck();
}
else if (GlobalPer("time_hr") == 18)
{
ClimateCheck();
}
else if (GlobalPer("time_hr") == 0)
{
ClimateCheck();
}
}

function ClimateCheck()
{
if(GlobalPer("climate") == 1)
{
SeasonCheckTemprate();
}
if (GlobalPer("climate") == 2)
{
SeasonCheckTropical();
}
if (GlobalPer("climate") == 3)
{
}
if (GlobalPer("climate") == 4)
{
}
if (GlobalPer("climate") == 5)
{
}
}


function SeasonCheckTemprate()
{
if (GlobalPer("time_season") == 1)
{
WeatherChangeSummerTemprate();
}
if (GlobalPer("time_season") == 2)
{
WeatherChangeAutumnTemprate();
}
if (GlobalPer("time_season") == 3)
{
WeatherChangeWinterTemprate();
}
if (GlobalPer("time_season") == 4)
{
WeatherChangeSpringTemprate();
}
}

function SeasonCheckTropical()
{
if (GlobalPer("time_season") == 1)
{
WeatherChangeSummerTropical();
}
if (GlobalPer("time_season") == 2)
{
WeatherChangeAutumnTropical();
}
if (GlobalPer("time_season") == 3)
{
WeatherChangeWinterTropical();
}
if (GlobalPer("time_season") == 4)
{
WeatherChangeSpringTropical();
}
}

//Tropical Areas rain ALOT, almost always :).

function WeatherChangeSummerTropical()
{
//this is Summer for a default Tropical climate
i = Rnd(1,4);
// i is probability of weather changing (25%)
w = Rnd(1,6);
// w is what the weather will be, rainy, sunny, clear, or cloudy.
if (i = 3)
{
if (w = 1)
{
//cloudy
GlobalPer("weather") = "cloudy";
}
else if (w = 2)
{
//sunny
GlobalPer("weather") = "raining";
}
else if (w = 3)
{
//sunny
GlobalPer("weather") = "raining";
}
else if (w = 4)
{
//clear
GlobalPer("weather") = "sunny";
}
else if (w = 5)
{
//clear
GlobalPer("weather") = "raining";
}
else if (w = 6)
{
//Rainy
GlobalPer("weather") = "raining";
}
}
}

function WeatherChangeAutumnTropical()
{
//this is Autumn for a default Temprate Climate
i = Rnd(1,4);
// i is probability of weather changing (25%)
w = Rnd(1,6);
// w is what the weather will be, rainy, sunny, clear, or cloudy.
if (i = 3)
{
if (w = 1)
{
//cloudy
GlobalPer("weather") = "raining";
}
else if (w = 2)
{
GlobalPer("weather") = "sunny";
}
else if (w = 3)
{
GlobalPer("weather") = "raining";
}
else if (w = 4)
{
GlobalPer("weather") = "raining";
}
else if (w = 5)
{
GlobalPer("weather") = "sunny";
}
else if (w = 6)
{
GlobalPer("weather") = "raining";
}
}
}

function WeatherChangeWinterTropical()
{
//this is Winter for a default Tropical Climate
i = Rnd(1,4);
// i is probability of weather changing (25%)
w = Rnd(1,6);
// w is what the weather will be, rainy, sunny, clear, or cloudy.
if (i = 3)
{
if (w = 1)
{
GlobalPer("weather") = "raining";
}
else if (w = 2)
{
GlobalPer("weather") = "cloudy";
}
else if (w = 3)
{
GlobalPer("weather") = "raining";
}
else if (w = 4)
{
GlobalPer("weather") = "raining";
}
else if (w = 5)
{
GlobalPer("weather") = "sunny";
}
else if (w = 6)
{
GlobalPer("weather") = "raining";
}
}
}

function WeatherChangeSpringTropical()
{
//this is Spring for a default Tropical Climate
i = Rnd(1,4);
// i is probability of weather changing (25%)
w = Rnd(1,6);
// w is what the weather will be, rainy, sunny, clear, or cloudy.
if (i = 3)
{
if (w = 1)
{
GlobalPer("weather") = "sunny";
}
else if (w = 2)
{
GlobalPer("weather") = "raining";
}
else if (w = 3)
{
GlobalPer("weather") = "raining";
}
else if (w = 4)
{
GlobalPer("weather") = "raining";
}
else if (w = 5)
{
GlobalPer("weather") = "raining";
}
else if (w = 6)
{
GlobalPer("weather") = "cloudy";
}
}
}

//Temprate is moderate, like SA, some rain, some sun, seasonal rain though.
function WeatherChangeSummerTemprate()
{
//this is Summer for a default Temprate Climate
i = Rnd(1,4);
// i is probability of weather changing (25%)
w = Rnd(1,6);
// w is what the weather will be, rainy, sunny, clear, or cloudy.
if (i = 3)
{
if (w = 1)
{
//cloudy
GlobalPer("weather") = "cloudy";
}
else if (w = 2)
{
//sunny
GlobalPer("weather") = "sunny";
}
else if (w = 3)
{
//sunny
GlobalPer("weather") = "sunny";
}
else if (w = 4)
{
//clear
GlobalPer("weather") = "sunny";
}
else if (w = 5)
{
//clear
GlobalPer("weather") = "clear";
}
else if (w = 6)
{
//Rainy
GlobalPer("weather") = "raining";
}
}
}

function WeatherChangeAutumnTemprate()
{
//this is Autumn for a default Temprate Climate
i = Rnd(1,4);
// i is probability of weather changing (25%)
w = Rnd(1,6);
// w is what the weather will be, rainy, sunny, clear, or cloudy.
if (i = 3)
{
if (w = 1)
{
//cloudy
GlobalPer("weather") = "cloudy";
}
else if (w = 2)
{
//sunny
GlobalPer("weather") = "sunny";
}
else if (w = 3)
{
//sunny
GlobalPer("weather") = "clear";
}
else if (w = 4)
{
//clear
GlobalPer("weather") = "clear";
}
else if (w = 5)
{
//clear
GlobalPer("weather") = "clear";
}
else if (w = 6)
{
//Rainy
GlobalPer("weather") = "raining";
}
}
}

function WeatherChangeWinterTemprate()
{
//this is Winter for a default Temprate Climate
i = Rnd(1,4);
// i is probability of weather changing (25%)
w = Rnd(1,6);
// w is what the weather will be, rainy, sunny, clear, or cloudy.
if (i = 3)
{
if (w = 1)
{
//cloudy
GlobalPer("weather") = "cloudy";
}
else if (w = 2)
{
//sunny
GlobalPer("weather") = "cloudy";
}
else if (w = 3)
{
//sunny
GlobalPer("weather") = "raining";
}
else if (w = 4)
{
//clear
GlobalPer("weather") = "raining";
}
else if (w = 5)
{
//clear
GlobalPer("weather") = "clear";
}
else if (w = 6)
{
//Rainy
GlobalPer("weather") = "raining";
}
}
}

function WeatherChangeSpringTemprate()
{
//this is Spring for a default Temprate Climate
i = Rnd(1,4);
// i is probability of weather changing (25%)
w = Rnd(1,6);
// w is what the weather will be, rainy, sunny, clear, or cloudy.
if (i = 3)
{
if (w = 1)
{
//sunny
GlobalPer("weather") = "sunny";
}
else if (w = 2)
{
//rainy
GlobalPer("weather") = "raining";
}
else if (w = 3)
{
//rainy
GlobalPer("weather") = "raining";
}
else if (w = 4)
{
//sunny
GlobalPer("weather") = "sunny";
}
else if (w = 5)
{
//clear
GlobalPer("weather") = "clear";
}
else if (w = 6)
{
//cloudy
GlobalPer("weather") = "cloudy";
}
}
}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.