FANDOM


How this works

The code Checks for the time on entering a new location, then if the time is a multiple of 6 (6,12,18, or 24) it checks the climatic location, it then checks the season. Then it checks whether or not to change the weather, if the return value is true, then a number from 1 to 6 is selected, different weather situations are assigned to each number.

All the script in this is Included in every location, although depending on what the location's climate is, some things may be ommittted.

Time Check

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();
}
}

Climate Check

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

Season Check

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();
}
}

Climate - Tropical

//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";
}
}
}

Climate - Temprate

//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";
}
}
}

Climate - Tundra

Pending

Climate - Desert

Pending

Climate - Oceanic

Pending

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.