How to Use Message Popup Rule: Difference between revisions

From TrainzOnline
Jump to navigationJump to search
Pware (talk | contribs)
Pware (talk | contribs)
mNo edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
The information in this Wiki Page applies to '''TANE''', '''TRS19''', '''Trainz Plus''' and '''TRS22'''. This page describes how to configure the '''Message Popup Rule'''.
<table width=1000 bgcolor=#000000 cellpadding=2>
 
<table cellpadding=2 bgcolor="Aquamarine">
<tr valign="top">
<tr valign="top">
<td>[[image:LinkWiki.PNG|link=]]</td>
<td>
<td>
For examples of how to use this rule in Sessions see the '''Trainz Wiki Page''' at:-<br>
<table width=996 bgcolor=#ffffff cellpadding=2>
* '''[[How to Use Message Popup Rule (Applications)]]'''
<tr valign="middle">
<td width=35>[[image:Information.png|35px|link=]]</td>
<td><span style="font-size: 15px;">The information in this Wiki Page applies to using the '''Message Popup Rule''' to display '''Session''' information and user instructions in '''T:ANE''', '''TRS19''', '''TRS22''' and '''Trainz Plus'''.</span></td>
</tr>
</table>
</td>
</td>
</tr>
</tr>
</table>
</table>
<br>
<br>
<table>
<table width=1000>
<tr valign="top">
<tr valign="top">
<td>
<td width=300>
__TOC__
__TOC__
</td>
</td>
<td align="center"><span style="font-weight: 700; font-size: 17px; color: white; background-color: black;">&#160;Workflow Diagram&#160;</span><br>
<td align="center"><span style="font-weight: 700; font-size: 17px; color: white; background-color: black;">&#160;Workflow Diagram&#160;</span><br>
[[image:MessagePopupWorkflow.png|link=|alt=Workflow diagram]]</td>
[[image:MessagePopupWorkflow.png|link=|alt=Workflow diagram]]</td>
<td>
<table cellpadding=2 bgcolor="Aquamarine">
<tr valign="top">
<td>[[image:LinkWiki.PNG|link=]]</td>
<td>
For more information on creating a '''HTML Asset''' see the '''Trainz Wiki Page''' at:-<br>
* '''[[How to Create a HTML Asset]]'''</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</table>
Line 305: Line 316:
</tr>
</tr>
<tr valign="top">
<tr valign="top">
<td>'''Message location:''' '''<span style="text-decoration: underline;">Top left</span>''' of the screen has been chosen as the location for the message window. Other positions are '''Top right''', '''Bottom left''' and '''Bottom right'''</td>
<td>[[image:BlackDot10x10.png|link=]] '''Message location:''' '''<span style="text-decoration: underline;">Top left</span>''' of the screen has been chosen as the location for the message window. Other positions are '''Top right''', '''Bottom left''' and '''Bottom right'''</td>
</tr>
</tr>
<tr valign="top">
<tr valign="top">
<td>'''HTML Asset:''' '''<span style="text-decoration: underline;">General Purpose Session HTML</span>''' one of the HTML assets installed with '''Trainz'''</td>
<td>[[image:BlackDot10x10.png|link=]] '''HTML Asset:''' '''<span style="text-decoration: underline;">General Purpose Session HTML</span>''' one of the HTML assets installed with '''Trainz'''</td>
</tr>
</tr>
<tr valign="top">
<tr valign="top">
<td>'''HTML Page:''' '''<span style="text-decoration: underline;">right_away.html</span>''' which is a HTML file inside the '''<span style="text-decoration: underline;">General Purpose Session HTML</span>''' asset</td>
<td>[[image:BlackDot10x10.png|link=]] '''HTML Page:''' '''<span style="text-decoration: underline;">right_away.html</span>''' which is a HTML file inside the '''<span style="text-decoration: underline;">General Purpose Session HTML</span>''' asset</td>
</tr>
</tr>
<tr valign="top">
<tr valign="top">
<td>'''HTML Wave:''' '''<span style="text-decoration: underline;">General Purpose Session HTML</span>''' HTML asset contains the ''optional'' sound file to be played</td>
<td>[[image:BlackDot10x10.png|link=]] '''HTML Wave:''' '''<span style="text-decoration: underline;">General Purpose Session HTML</span>''' HTML asset contains the ''optional'' sound file to be played</td>
</tr>
</tr>
<tr valign="top">
<tr valign="top">
<td>'''Wav Name:''' '''<span style="text-decoration: underline;">all-aboard.wav</span>''' is the ''optional'' sound file to be played</td>
<td>[[image:BlackDot10x10.png|link=]] '''Wav Name:''' '''<span style="text-decoration: underline;">all-aboard.wav</span>''' is the ''optional'' sound file to be played</td>
</tr>
</tr>
<tr valign="top">
<tr valign="top">
Line 394: Line 405:
</tr>
</tr>
<tr valign="top">
<tr valign="top">
<td>'''Message location:''' '''<span style="text-decoration: underline;">Top left</span>''' of the screen has been chosen as the location for the message window. Other positions are '''Top right''', '''Bottom left''' and '''Bottom right'''</td>
<td>[[image:BlackDot10x10.png|link=]] '''Message location:''' '''<span style="text-decoration: underline;">Top left</span>''' of the screen has been chosen as the location for the message window. Other positions are '''Top right''', '''Bottom left''' and '''Bottom right'''</td>
</tr>
</tr>
<tr valign="top">
<tr valign="top">
<td>'''HTML Asset:''' '''<span style="text-decoration: underline;">General Purpose Session HTML</span>''' one of the HTML assets installed with '''Trainz'''</td>
<td>[[image:BlackDot10x10.png|link=]] '''HTML Asset:''' '''<span style="text-decoration: underline;">General Purpose Session HTML</span>''' one of the HTML assets installed with '''Trainz'''</td>
</tr>
</tr>
<tr valign="top">
<tr valign="top">
<td>'''String Table Token:''' '''<span style="text-decoration: underline;">html_warning_late</span>''' the string table '''token''' in the config.txt file of the '''<span style="text-decoration: underline;">General Purpose Session HTML</span>''' asset contains the message to be displayed</td>
<td>[[image:BlackDot10x10.png|link=]] '''String Table Token:''' '''<span style="text-decoration: underline;">html_warning_late</span>''' the string table '''token''' in the config.txt file of the '''<span style="text-decoration: underline;">General Purpose Session HTML</span>''' asset contains the message to be displayed</td>
</tr>
</tr>
<tr valign="top">
<tr valign="top">
<td>'''HTML Wave:''' '''<span style="text-decoration: underline;">General Purpose Session HTML</span>''' HTML asset contains the ''optional'' sound file to be played</td>
<td>[[image:BlackDot10x10.png|link=]] '''HTML Wave:''' '''<span style="text-decoration: underline;">General Purpose Session HTML</span>''' HTML asset contains the ''optional'' sound file to be played</td>
</tr>
</tr>
<tr valign="top">
<tr valign="top">
<td>'''Wav Name:''' '''<span style="text-decoration: underline;">all-aboard.wav</span>''' is the ''optional'' sound file to be played</td>
<td>[[image:BlackDot10x10.png|link=]] '''Wav Name:''' '''<span style="text-decoration: underline;">all-aboard.wav</span>''' is the ''optional'' sound file to be played</td>
</tr>
</tr>
<tr valign="top">
<tr valign="top">
Line 426: Line 437:
...which will produce the message "'''You are running late!'''" from the '''Message Popup Rule''' settings shown above.
...which will produce the message "'''You are running late!'''" from the '''Message Popup Rule''' settings shown above.
<br>
<br>
<table cellpadding=2 bgcolor="Aquamarine">
<tr valign="top">
<td>[[image:LinkWiki.PNG|link=]]</td>
<td>
For more information, see the '''Trainz Wiki Page''' at:-<br>
* '''[[How to Create a HTML Asset]]'''</td>
</tr>
</table>
<table> <!-- BEGIN Nav Buttons Table -->
<table> <!-- BEGIN Nav Buttons Table -->
<tr valign="top">
<tr valign="top">
Line 446: Line 448:


='''Alternatives to the Message Popup Rule'''=
='''Alternatives to the Message Popup Rule'''=
<table cellpadding=2 bgcolor=#ffffff>
<table width=1000 cellpadding=2 bgcolor=#ffffff>
<tr valign="top">
<tr valign="top">
<td width="58">[[image:RulesWiki.PNG|link=]]</td>
<td width=60>[[image:RulesWiki.PNG|link=]]</td>
<td width="640">
<td>There are other HTML message window rules that are alternatives to the '''Message Popup''' rule. A few possibilities are:-
There are other HTML message window rules that are alternatives to the '''Message Popup''' rule. A few possibilities are:-</td>
*'''[[Session_Rule_List_with_Parameters#Display_HTML_Pages_Rule|Display HTML Pages Rule]]'''
*'''[[Session_Rule_List_with_Parameters#Timed_Limited_Display_HTML_Rule_(SP2_and_later)|Timed Limited Display HTML Rule (SP2 and later)]]'''</td>
</tr>
</tr>
</table>
</table>
*'''[[Session_Rule_List_with_Parameters#Display_HTML_Pages_Rule|Display HTML Pages Rule]]'''
*'''[[Session_Rule_List_with_Parameters#Timed_Limited_Display_HTML_Rule_(SP2_and_later)|Timed Limited Display HTML Rule (SP2 and later)]]'''
<br>
<br>
='''Related Links'''=
<table cellpadding=2 bgcolor=#ffffff>
<tr valign="top">
<td>[[image:LinkWiki.PNG|link=]]</td>
<td>
*'''[[How to Create a HTML Asset]]'''
*'''[[How to Create a Message Popup Icon]]'''
*'''[[How to Use Session Editor|Using the Session Editor]]'''
</td>
</tr>
</table>
<table> <!-- BEGIN Nav Buttons Table -->
<table> <!-- BEGIN Nav Buttons Table -->
<tr valign="top">
<tr valign="top">
Line 480: Line 468:
----
----
----
----
='''Trainz Wiki'''=
='''Trainz Wiki'''=
<table cellpadding=2 bgcolor=#ffffff>
<table width=1000>
<tr valign="top">
<tr valign="top">
<td>[[image:TrainzWiki.png|link=]]</td>
<td>
<table width=500 cellpadding=2 bgcolor=#ffffff>
<tr valign="top">
<td width=80>[[image:TrainzWiki.png|link=]]</td>
<td>
<td>
<span style="font-size: 17px;">'''More Tutorials and Guides to Using Trainz'''</span><br>
<span style="font-size: 17px;">'''More Tutorials and Guides to Using Trainz'''</span><br>
Line 491: Line 481:
*'''[[Session Rule List with Parameters|Session Rules List (Alphabetical) with Parameters]]'''
*'''[[Session Rule List with Parameters|Session Rules List (Alphabetical) with Parameters]]'''
*'''[[Session Rules By Categories With Properties|Session Rules List (Categories) With Parameters]]'''
*'''[[Session Rules By Categories With Properties|Session Rules List (Categories) With Parameters]]'''
</td>
</tr>
</table>
</td>
<td>
<table width=500 cellpadding=4 bgcolor="aquamarine">
<tr valign="top">
<td width=50>[[image:LinkWiki.PNG|link=]]</td>
<td>
<span style="font-size: 17px;">'''Related Links'''</span><br>
* '''[[How to Use Message Popup Rule (Applications)]]'''
* '''[[How to Use Session Editor|Session Editor]]'''
* '''[[How to Create a HTML Asset]]'''
* '''[[How to Create a Message Popup Icon]]'''</td>
</tr>
</table>
</td>
</td>
</tr>
</tr>

Latest revision as of 05:34, 4 July 2026

Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 The information in this Wiki Page applies to using the Message Popup Rule to display Session information and user instructions in T:ANE, TRS19, TRS22 and Trainz Plus.


 Workflow Diagram 
Workflow diagram

For more information on creating a HTML Asset see the Trainz Wiki Page at:-

  Top   Next Down Bottom

Add a Message Popup Rule

The Message Popup Rule is a Trainz Session Rule that creates onscreen messages for users in Driver Mode.


The Message Popup Rule is added to a Session and configured using the Session Editor in Surveyor. The rule will open a browser window on the screen in Driver Mode that will remain on the screen until it is closed by the user or by another rule.


There are three ways the message window can be created:-
Options: Choose one of:-
with a Custom Message - the quickest and easiest method, OR
with a HTML (Web) Page - the most complicated method but it often gives the best results, OR
with a String Table Message


  Top Next Up Next Down Bottom

Using a Custom Message

The settings shown in this example will direct Trainz to load the message from text entered in the Custom Message box.

Notes:

Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 No knowledge of HTML is required for this option
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 You can select and display an optional icon with the message
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 You are no longer limited in the number of lines of text you can add. Although the popup window will only show 7 lines, a vertical scroll bar will appear for longer messages
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 Text only can be entered (box cannot be left blank). Some HTML markup is acceptable, for example italic and bold tags


For more information, see the Trainz Wiki Page at:-



Settings: Shown in the example above:-

Custom text

Pause game while message is displayed - game play will not be paused
Close previous message popup windows - this is usually a good idea unless you want multiple message windows open
Message location: Top left of the screen has been chosen as the location for the message window. Other positions are Top right, Bottom left and Bottom right
Custom Message - the message entered into the text box will be displayed
Icon - the selected optional icon will be displayed
No optional sound has been added


The custom message popup created by the example shown above


To find additional graphic icons that can be added to the Message Popup window, use Content Manager and set a Custom Filter to search for:-
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 Category select Texture- Not Environmental
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 Name type icon
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 On Download Station select True
Not all those shown will be suitable. Double Left Click on a possible icon to display its details before downloading


For information on how to create your own Message Popup Icons, see the Trainz Wiki Page at:-

  Top Next Up Next Down Bottom

Using a HTML Page

The settings shown in this example will direct Trainz to load the message from a HTML file in a HTML asset.

Notes:

Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 Knowledge of HTML, as used by Trainz, will probably be required for this option
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 The HTML page (with filename extension ".html") must be in a Trainz asset of type HTML
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 Graphics and a limited set of HTML effects are possible
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 The sound file settings HTML Wave and Wave Name are optional
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 If a sound file is to be played when the message is displayed then it must be of type WAV (with filename extension ".wav") and must be in a Trainz asset of type HTML. It does not have to be in the same HTML asset as the HTML page


For more information, see the Trainz Wiki Page at:-



Settings: Shown in the example above:-
A pre-defined HTML page (advanced)
Pause game while message is displayed - this will halt the game play until the window is closed. This may be needed if you have a long introductory HTML information page, otherwise leave unchecked
Close previous message popup windows - this is usually a good idea unless you want multiple message windows open
Message location: Top left of the screen has been chosen as the location for the message window. Other positions are Top right, Bottom left and Bottom right
HTML Asset: General Purpose Session HTML one of the HTML assets installed with Trainz
HTML Page: right_away.html which is a HTML file inside the General Purpose Session HTML asset
HTML Wave: General Purpose Session HTML HTML asset contains the optional sound file to be played
Wav Name: all-aboard.wav is the optional sound file to be played
Autoplay Wav - the sound will be played when the page is displayed

  Top Next Up Next Down Bottom

Using a String-Table Message

The settings shown in this example will direct Trainz to load the message from text stored in the config.txt string table of a specified HTML asset.

Notes:

Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 The config.txt file of the HTML asset must have a string-table container which holds all the text messages to be displayed
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 The string-table token is the "tag" which identifies the message text in the config.txt file



Settings: Shown in the example above:-
A pre-defined string-table entry from a HTML asset (advanced)
Pause game while message is displayed - game play will not be paused
Close previous message popup windows - this is usually a good idea unless you want multiple message windows open
Message location: Top left of the screen has been chosen as the location for the message window. Other positions are Top right, Bottom left and Bottom right
HTML Asset: General Purpose Session HTML one of the HTML assets installed with Trainz
String Table Token: html_warning_late the string table token in the config.txt file of the General Purpose Session HTML asset contains the message to be displayed
HTML Wave: General Purpose Session HTML HTML asset contains the optional sound file to be played
Wav Name: all-aboard.wav is the optional sound file to be played
Autoplay Wav - the sound will be played when the page is displayed

For example, the config.txt file of the asset General Purpose Session HTML contains the following:-

string-table
    {
        html_warning_late       "You are running late!"
    }

...which will produce the message "You are running late!" from the Message Popup Rule settings shown above.

  Top Next Up   Bottom

Alternatives to the Message Popup Rule

There are other HTML message window rules that are alternatives to the Message Popup rule. A few possibilities are:-


  Top Next Up    


Trainz Wiki

More Tutorials and Guides to Using Trainz

Related Links


This page was created by Trainz user pware in April 2018 and was last updated as shown below.