You can't put a schedule directly in a package.
1 million and up are converted to scientific notation as soon as you do any math on them, and schedule won't accept them like that. I think that if you write the number directly, schedule will accept larger numbers than 1000000.
Schedule is a function that schedules a function to be called a certain number of ms in the future. It cannot be put in a package (I think), it can not define a block of code, if you want something to repeat every # ms, it must schedule itself every time it runs.
Red_Guy: You missed some indentation.
package DayAndNight
{
function Time4(%obj)
{
.................
renderBottomTexture = "0";
noRenderBans = "0";
};
schedule(240000, 0, "Time4", %obj);
}
};
I would write something like this:
function changeSky(%number)
{
switch(%number)
{
case 0:
... //Set a dawn sky
case 1:
... //Set a day sky
case 2:
... //Set a sunset sky
case 3:
... //Set a night sky
}
schedule(300000, 0, changeSky, (%number + 1) % 4);
}
changeSky(0);
If only one or two values differ between the skies, I would put that sets the sky after the switch, and it would use variables set within the switch(). Less code duplication that way.