How to Use Parent and Child Rules: Difference between revisions
mNo edit summary |
mNo edit summary |
||
| Line 139: | Line 139: | ||
</table> | </table> | ||
==Parent/Child Rule Example== | ==Parent/Child Rule Example== | ||
<table> | <table width=1000> | ||
<tr> | <tr valign="top"> | ||
<td>[[image:Message_Popup.jpg|link=]]</td> | <td width=600>[[image:Message_Popup.jpg|600px|link=]]</td> | ||
<td> | |||
<table bgcolor=#000000 cellpadding=2> | |||
<tr valign="top"> | |||
<td> | |||
<table bgcolor=#ffffff cellpadding=2> | |||
<tr valign="top"> | |||
<td width=10>[[image:DotPoint.JPG|10px|link=]]</td> | |||
<td>the cause of the trigger event is set in the properties of the '''Trigger Check Rule''' </td> | |||
</tr> | |||
<tr valign="top"> | |||
<td>[[image:DotPoint.JPG|10px|link=]]</td> | |||
<td>the message shown is set in the properties of the '''Message Popup Rule''' </td> | |||
</tr> | |||
<tr valign="top"> | |||
<td>[[image:DotPoint.JPG|10px|link=]]</td> | |||
<td>the duration of the wait is set in the properties of the '''Wait Rule''' </td> | |||
</tr> | |||
</table> | |||
</td> | |||
</tr> | |||
</table> | |||
</td> | |||
</tr> | </tr> | ||
</table> | </table> | ||
Revision as of 01:17, 30 September 2023
The information in this Wiki Page applies to TANE, TRS19, Trainz Plus and TRS22.
|
What Are Parent and Child Rules?
| Rules that act as Parent Rules can have one or more sub-rules or Child Rules under them | |
| Rules are edited and managed by the Session Editor in Surveyor |
|
More information on the Session Editor can be found on the Trainz Wiki Page at:- |
| Most Parent Rules are used as "decision makers" in Trainz Sessions. They decide if or when other rules, the Child Rules, will be executed. Some Parent Rules control how those Child Rules are executed. |
|
||||||||||
| Session rules can be arranged in a hierarchical fashion, in a series of levels as shown in the example on the left. A Parent Rule can be used to group together a set of rules at a lower level in the hierarchy. The rules that are grouped together under a Parent Rule are the Child Rules. Child Rules can also be Parent Rules that group together other rules at an even lower level. This creates multiple levels in the hierarchy. The Parent Rule at the head of each level in the hierarchy acts as a switch that directs the Trainz session to either ignore (skip over) or obey (execute) the Child Rules under its control. |
| Rules that act as Child Rules are indented under a Parent Rule |
| Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 |
|
|||||||
Parent/Child Rule Example
| Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 |
|
In the screenshot above, the
|
| Sequence of Events | ||||||||
| When the consist identified in the Trigger Check Rule, a Parent Rule, reaches the set trigger, the Trigger Event is activated and its Child Rules are executed | ||||||||
| The Simultaneous List Rule, a Parent Rule, is then executed. It executes all its Child Rules immediately and simultaneously | ||||||||
|
||||||||
| The Close Message Popup Rule is executed. This closes the Message window created by the Message Popup Rule | ||||||||
| Since the Close Message Popup Rule is the last child rule under the Wait Rule, when it has completed its task (closing the message popup) it will terminate the Wait Parent Rule | ||||||||
| Since it is also the last child rule under the Simultaneous List Rule it will terminate that Parent Rule | ||||||||
| Finally, since it is the last child rule under the Trigger Check Rule, it also terminates that Parent Rule | ||||||||
Ordered Lists vs Simultaneous Lists
| The majority of sibling Child Rules, rules that are at the same indent level under a Parent Rule, will be executed in order (an Ordered List) or simultaneously (a Simultaneous List). |
Ordered Lists
| Details for this rule can be found at |
|
| Ordered Lists are shown with numbered icons on each Child Rule which indicates the order in which they will be executed |
| Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 |
|
|
Setting the Options
The rule settings allow you to control how many times an Ordered List will run.
|
Simultaneous Lists
| Details for this rule can be found at |
|
| Simultaneous Lists are shown with equality (=) icons on each Child Rule which indicates that they will all be executed at the same time |
| Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 |
|
Setting the Options
The rule settings allow you to control how a Simultaneous List will be terminated.
|
|
||||||||||||||||||||
|
Other Types of Lists
Progressive Lists
| Details for this rule can be found at |
|
| Progressive Lists are shown with numbered icons on each Child Rule which indicates the progressive order in which they will be executed on each cycle of the list |
| Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 |
|
Setting the Options
The rule settings allow you to control what happens after the last child rule in a Progressive List has been completed.
|
|
||||||||||||||||||||
Random Lists
| Details for this rule can be found at |
|
| Random Lists are shown with "dot" icons on each Child Rule which indicates that ONE of them will be selected at random |
| Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 |
|
Reset Lists
| Details for this rule can be found at |
|
| Reset Lists are shown with equality (=) icons on each Child Rule which indicates that they will all be executed at the same time |
| Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 |
|
Related Links
Trainz Wiki
![]() |
More Tutorials and Guides to Using Trainz |
This page was created by Trainz user pware in May 2018 and was last updated as shown below.




