Originally Posted By: PadMalcom
Great, thank you! Would it be okay if I add the function to our TUST library?

Sure, please add it to the TUST library.

Here's another script for day/night cycle:

Code:
var second_=0;
var minute_=0;
var hour_=12;
var time_speed_=0.5;
var day_=120; //april 30th

while(1)
{
	second_+=time_speed_*time_step;
	if(second_>=60)
	{
		minute_+=integer(second_/60);
		second_=fraction(second_/60);
		
		if(minute_>=60)
		{
			hour_+=integer(minute_/60);
			minute_=fraction(minute_/60);
			
			hour_%=24;
		}
	}
	
	set_sun_position(day_,hour_,minute_,second_,LOCATION_LATITUDE,LOCATION_TIME_SPRING_EQUINOX);
	
	wait(1);
}


Last edited by oliver2s; 04/30/13 10:39.