Day Night Cycle Script Command

Discuss anything related to Train Simulator from DoveTail that does not fit in one of the more specific categories.

Day Night Cycle Script Command

Postby newbouy » Sun Aug 03, 2014 7:48 pm

Hello everybody ,does anyone know of a LUA script command which detects the day night cycle in the game.Basically to detect when the game switches on the lights at night and then switches them off again in the morning.This time seems to vary with different times of the year like in real life.I know there is this get time of day call
Code: Select all
gTimeOfDay = SysCall("ScenarioManager:GetTimeOfDay");
which i have used to good effect but it would be nice if there was a Syscall just to detect when the lights go on and off.

Thanks for your help Newbouy
newbouy
Full Time Fireman
 
Posts: 52
Joined: Sat Apr 12, 2014 9:29 am
Has thanked: 3 times
Been thanked: 19 times

Re: Day Night Cycle Script Command

Postby AndiS » Sun Aug 03, 2014 8:55 pm

There is no such call, but there is one to get the season: ScenarioManager:GetSeason (0=spring, 1= summer, etc.)

Look at what this guy achieved:
http://forums.uktrainsim.com/viewtopic. ... 0&t=136967
He also did some studies on the time at which the day/night changes occur for various seasons.
AndiS
Top Link Driver!
 
Posts: 736
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 268 times
Been thanked: 308 times

Re: Day Night Cycle Script Command

Postby newbouy » Mon Aug 04, 2014 1:34 am

Thank you Andis for the quick response.What a pitty theres is no call to detect the day night cycle so i will have to continue using the GetTimeOfDay call.The link you provide looks very usefull all thou i havn`t managed to look at all the scripts yet i did see that there was the sun rise and fall times for all the 4 seasons which will save me alot of work trying to work them out.I was just wondering which type of blueprint you would recommend to use which allows you to add child objects and launch scripts.I am currently using the signal blueprint for a scenery asset which uses point lights and also needs to run a script.This seems to be working ok but just wondered if there was any other type of blueprint more suitable.

Thanks for your help Newbouy
newbouy
Full Time Fireman
 
Posts: 52
Joined: Sat Apr 12, 2014 9:29 am
Has thanked: 3 times
Been thanked: 19 times

Re: Day Night Cycle Script Command

Postby AndiS » Mon Aug 04, 2014 8:17 am

The blueprint is called scripted scenery.
AndiS
Top Link Driver!
 
Posts: 736
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 268 times
Been thanked: 308 times


Return to Train Simulator Mess Room

Who is online

Users browsing this forum: No registered users and 1 guest