Day of the week in session

spelg17

New member
Hello, how can i get the day of the week in my session rules ? Is there a variable "day of the week" that I can check with the "check variable" rule ? Thank you !
 
You can set a date in a Session using the Environment Tool, but this is mainly used for setting the season of the year. I am not aware of any "day of the week" function in Trainz.

The simplest thing you can do is add a popup message window stating something like "Today is Monday", but beyond that .....
 
Thank you for the answer, but I'd like to use the day of the week to change something in the session. IF it's monday THEN...
The game know the day of the week, but how use it in a session...
 
Once the calendar has been set in the Environmental Tools it remains set to fix the season of the year - some users want it to be always winter, or always summer regardless of the actual season. If the date is not set then it defaults to today's date (so I presume it must be accessing the system calendar).

Likewise the clock in the game does not take its time from the Windows/Mac system clock and is set by the Session rules so that you can simulate any time of the day or night. If the time is not set then it defaults to 10:00am.

I suppose that it might be possible to write a script that would access the system calendar to calculate the day of the week but scripting is beyond my abilities. If it was simple I suspect that someone would have done it by now.
 
Good job Spelg17
see you make use of a pguy library, maybe he can help you further
does it do what you expect, or does it need other functionality?
 
Thank you for the answer G.M.
The script does the job, but i'm new in scripting and i don't know if the script respect all the rules.
Well, pguy is a legend, i don't know if i can ask him the question directly for a tiny script ! He is in this forum ?
 
Yes. Pguy does read these forums. If the script is his, I don't know a reason why he would not help, even if it is a "tiny issue.
 
Back
Top