How to Use Message Popup Rule (Applications)

From TrainzOnline
Revision as of 15:05, 4 October 2023 by Pware (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
          Next Down Bottom
The information in this Wiki Page applies to TANE, TRS19, Trainz Plus and TRS22. It gives practical examples of how to use the Message Popup Rule in Sessions to create messages that appear after an event and automatically close after another event.

Contents

LinkWiki.PNG

For information of how to configure the Message Popup Rule in Trainz, see the Trainz Wiki Page at:-


NotePad.PNG Notes:

DotPoint.JPG The WikiLink.PNG Message Popup Rule is a Trainz Session Rule that creates onscreen messages for users in Driver Mode
DotPoint.JPG The WikiLink.PNG Close Message Popup Rule is a Trainz Session Rule that closes onscreen messages for users in Driver Mode


Application 1: Timed Message

    Top   Next Down Bottom
Magnifier.png The Scenario:
A Message Popup is activated by a track trigger event and is automatically closed by a timed event


RulesWiki.PNG Rules Used:
DotPoint.JPG Trigger Check Rule to trigger the message event
DotPoint.JPG Simultaneous List Rule to force all child rules to be executed at the same time
DotPoint.JPG Message Popup Rule to open a message window on the screen
DotPoint.JPG Wait Rule to wait a set time interval
DotPoint.JPG Close Message Popup Rule to close the message window


Screenshot.PNG Session Editor Screenshot:
Message Popup.jpg


Explanation.PNG Description:
Line  1 : Trigger Check The event is triggered when a consist passes over a track trigger but any event could be used, such as a Navigation Point, a TimeCheck, a Wait On ... or Wait For ..., etc. As long as the following rules are child rules of the trigger event. This executes the following lines:-
Line  2 : Simultaneous List This forces all the following child rules to be executed at the same time. Events such as the Trigger Check that execute their child rules in order would not work in this example because everything else would be forced to wait until the Message Popup has been closed. Using the Simultaneous List Rule avoids this problem. Events that execute their child rules simultaneously would not need the Simultaneous List Rule (see next example). This executes the following lines:-
Line  3 : Message Popup This places the message window on the screen and waits for it to be closed either manually (by the user) or by another rule
Line  4 : Wait This forces a wait for a set time period, in this case 20 seconds but any time interval can be set. At the end of that period the Wait Rule will execute its own set of child rules. This executes the following line:-
Line  5 : Close Message Popup The message window is closed


Application 2: Navigation Point/Train Stopped Event

    Top Next Up Next Down Bottom
Magnifier.png The Scenario:
A Message Popup is activated by a navigation event and is automatically closed by a train stopped event


Conditions.PNG Preconditions:
DotPoint.JPG Navigation Display Rule to create the navigation point set


RulesWiki.PNG Rules Used:
DotPoint.JPG Navigation Display Rule to create the navigation point set (in Preconditions above)
DotPoint.JPG Wait on Navigation Point Rule to trigger the message event
DotPoint.JPG Message Popup Rule to open a message window on the screen
DotPoint.JPG Wait on Train Stop/Start Rule to trigger an event when the consist stops moving
DotPoint.JPG Close Message Popup Rule to close the message window


Screenshot.PNG Session Editor Screenshot:
Message Popup2.JPG


Explanation.PNG Description:
Line  1 : Wait on Navigation Point The event is triggered when a consist reaches a preset navigation point. This rule executes all its child rules simultaneously so no Simultaneous List Rule is required in this example. This executes the following lines:-
Line  2 : Message Popup This places the message window on the screen and waits for it to be closed either manually (by the user) or by another rule
Line  3 : Wait on Train Stop/Start When the consist comes to a stop then it will execute its own set of child rules. This executes the following line:-
Line  4 : Close Message Popup The message window is closed
In this example, the Close Message Popups Rule could be replaced by lines 2, 3, 4 and 5 from the Timed Message example shown above to produce a new message when the train stops moving and that message would be closed after a set time interval.


LinkWiki.PNG

Information of setting and using Navigation Points can be found on the Trainz Wiki Page at:-

  Top Next Up    


Trainz Wiki

TrainzWiki.png

More Tutorials and Guides to Using Trainz


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


Personal tools