Popup Messages

Hi, all!

In a session, I want to display a popup message showing the time of day.
Can it be done? If so, where can I find relevant/useful tutorials ?

Thanks in advance.
 
There is a built in Rule that is used to create Popup Messages - the Message Popup Rule.

You can use it in 3 different ways to create on screen messages using the Trainz Minibrowser in a Session.


  1. A simple text message with an optional graphic and sound
  2. A more complex web page with multiple graphics (and sound) - this requires you to create a separate HTML asset which is described at https://online.ts2009.com/mediaWiki/index.php/How_to_Create_a_HTML_Asset
  3. A string table built into a config.txt file

All are described on the Trainz Wiki page at https://online.ts2009.com/mediaWiki/index.php/How_to_Use_Message_Popup_Rule

There is also a Wiki page showing sample applications at https://online.ts2009.com/mediaWiki/index.php/How_to_Use_Message_Popup_Rule_(Applications)

Adding the Time of Day into a message could be more difficult. There is no Minibrowser function that I know of that would do that so it may require some scripting skills, an area outside my expertise.
 
Last edited:
There is a built in Rule that is used to create Popup Messages - the Message Popup Rule.

You can use it in 3 different ways to create on screen messages using the Trainz Minibrowser in a Session.


  1. A simple text message with an optional graphic and sound
  2. A more complex web page with multiple graphics (and sound) - this requires you to create a separate HTML asset which is described at https://online.ts2009.com/mediaWiki/index.php/How_to_Create_a_HTML_Asset
  3. A string table built into a config.txt file

All are described on the Trainz Wiki page at https://online.ts2009.com/mediaWiki/index.php/How_to_Use_Message_Popup_Rule

There is also a Wiki page showing sample applications at https://online.ts2009.com/mediaWiki/index.php/How_to_Use_Message_Popup_Rule_(Applications)

Adding the Time of Day into a message could be more difficult. There is no Minibrowser function that I know of that would do that so it may require some scripting skills, an area outside my expertise.

Thanks, pware.
 
This can be done with scripting and the class World

float Now = World.GetGameTime();
Notes - The returned time is normalised to a value between 0.0 and 1.0
0.0 = midday
0.25 = 6 p.m.
0.5 = midnight
0.75 = 6 a.m.
1.0 = midday again
Use the Time Value constants to convert the normalised values to human readable times.

Found on this Wiki Page
 
Back
Top