Time of Day For Script?

boleyd

Well-known member
I can't find a way to get time-of-day in TRS19. I would like to program the actions of a train based upon the time-of-day. A script seems to be a good method. ????
 
I don't know anything about scripting but you could achieve the effect you want by using the TimeCheck Rule to provide a schedule to a driver at a set time of day.
 
Code:
  //! Gets the current game time.
  //
  // Returns:
  //     Returns the current in-game time as a normalize value in the range of [0.0 - 1.0] where
  //     0.0 is midday, 0.5 is midnight and 1.0 is back to midday.
  //
  // See Also:
  //     \ref timeSecs "Time Values"
  //
  public native float GetGameTime(void);
 
Code:
  //! Gets the current game time.
  //
  // Returns:
  //     Returns the current in-game time as a normalize value in the range of [0.0 - 1.0] where
  //     0.0 is midday, 0.5 is midnight and 1.0 is back to midday.
  //
  // See Also:
  //     \ref timeSecs "Time Values"
  //
  public native float GetGameTime(void);

looked at the scripting section of the Wiki and found that I was far behind. They have that thing close to a compiler. Terminology, relationships and overall process is more complicated but as software people like to say - More Powerful.
 
Back
Top