How to Use Parent and Child Rules
m (→What Are Parent and Child Rules?) |
m (→Simultaneous Lists) |
||
Line 197: | Line 197: | ||
</table> | </table> | ||
− | <table> | + | <table width=1000> |
− | <tr> | + | <tr valign="top"> |
− | <td>[[file:SimultaneousListRule.JPG|link=]]</td> | + | <td width=640>[[file:SimultaneousListRule.JPG|link=]]</td> |
− | <td> | + | <td with=360> |
− | <table cellpadding= | + | <table cellpadding=2 bgcolor=#eeeeee> |
− | <tr> | + | <tr valign="top"> |
<td colspan="2"> | <td colspan="2"> | ||
----</td> | ----</td> | ||
Line 213: | Line 213: | ||
*any one of the Child Rules has been completed</td> | *any one of the Child Rules has been completed</td> | ||
</tr> | </tr> | ||
− | <tr> | + | <tr valign="top"> |
<td colspan="2"> | <td colspan="2"> | ||
----</td> | ----</td> | ||
− | |||
− | |||
</tr> | </tr> | ||
</table> | </table> | ||
− | + | <table bgcolor="black" width=360> | |
− | <table | + | |
<tr valign="top"> | <tr valign="top"> | ||
− | <td>[[ | + | <td> |
− | <td>While all child rules in a '''Simultaneous List''' will start at the same time, some will take longer to complete than others.</td> | + | <table bgcolor=#ffffb0 width=356> |
+ | <tr valign="top"> | ||
+ | <td>[[image:NotePad.PNG|link=]]</td> | ||
+ | <td><span style="font-size: 17px; font-weight: 700;">Notes:'''</span><br> | ||
+ | ---- | ||
+ | While all child rules in a '''Simultaneous List''' will start at the same time, some will take longer to complete than others. | ||
+ | </td> | ||
</tr> | </tr> | ||
</table> | </table> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | <br> | ||
<table> <!-- BEGIN Nav Buttons Table --> | <table> <!-- BEGIN Nav Buttons Table --> |
Revision as of 16:54, 28 February 2022
The information in this Wiki Page applies to TANE, TRS19 and Trainz Plus.
Contents |
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. |
|
Parent/Child Rule Example
In the screenshot above, the
- Trigger Check Rule is a Parent Rule. It has rules indented below it.
- Simultaneous List Rule is indented under the Trigger Check Rule so it is a Child of that rule. It is also a Parent Rule as it has rules indented below it
- Message Popup Rule is indented under the Simultaneous List Rule so it is a Child of that rule.
- Wait Rule is indented under the Simultaneous List Rule so it is a Child of that rule. It is also a Parent Rule as it has rules indented below it
- Close Message Popup Rule is indented under the Wait Rule so it is a Child of that rule.
- Simultaneous List Rule is indented under the Trigger Check Rule so it is a Child of that rule. It is also a Parent Rule as it has rules indented below it
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 Message Popup Rule is executed. At the same time ...
- The Wait Rule is executed. This is set to force a 20 second wait, after which its Child Rule ...
- 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 that 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.
- The Close Message Popup Rule is executed. This closes the Message window created by the Message Popup Rule.
- The Simultaneous List Rule, a Parent Rule, is then executed. It executes all its Child Rules immediately and simultaneously.
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
Rule details can be found at Ordered List Rule
Ordered Lists are shown with numbered icons on each Child Rule which indicates the order in which they will be executed. |
|
Each Child Rule in the sequence must be completed before the next Child Rule can be executed. |
Notes:
|
Simultaneous Lists
Rule details can be found at Simultaneous List Rule
Simultaneous Lists are shown with equality ("=") icons on each Child Rule which indicates that they will be executed at the same time. |
|
Other Types of Lists
Progressive Lists
Rule details can be found at Progressive List Rule
On the first run of a Progressive List, only the first Child Rule is executed. On the second run, the second Child Rule is executed, on the third run the third Child Rule is executed, etc. |
|
Random Lists
Rule details can be found at Random List Rule
A Random List will run ONLY ONCE and will randomly select a single Child Rule to execute. |
Reset Lists
Rule details can be found at Reset List Rule
A Reset List will execute continuously, it will never terminate. Each time through the list all the Child Rules will be reset and executed again. |
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.