How to Use Parent and Child Rules
m |
m (→Parent/Child Rule Example) |
||
(2 intermediate revisions by one user not shown) | |||
Line 125: | Line 125: | ||
<tr valign="top"> | <tr valign="top"> | ||
<td width=25>[[image:DotPoint1.JPG|link=]]</td> | <td width=25>[[image:DotPoint1.JPG|link=]]</td> | ||
− | <td>select (<span style="font-weight: 700; font-size: 15px; background-color: lightcyan;"> | + | <td>select (<span style="font-weight: 700; font-size: 15px; background-color: lightcyan;">Left Click</span>) the rule to be indented</td> |
</tr> | </tr> | ||
<tr valign="top"> | <tr valign="top"> | ||
Line 139: | Line 139: | ||
</table> | </table> | ||
==Parent/Child Rule Example== | ==Parent/Child Rule Example== | ||
+ | In the following example, a '''Trigger Check Rule''' is acting as the ''switch'' that decides whether or not its child rules will be executed. If the Trigger is activated, for example by a particular train passing over its track trigger, then its child rules will be executed. Otherwise the '''Trigger Check Rule''' will wait indefinitely until that event occurs, or the session is terminated. | ||
+ | |||
<table width=1000> | <table width=1000> | ||
<tr valign="top"> | <tr valign="top"> | ||
Line 785: | Line 787: | ||
<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> | ||
− | *'''<span class=" | + | *'''<span class="plain;s">[http://online.ts2009.com/mediaWiki/index.php/HowTo How to Guides]</span>''' |
*'''[[Driver Commands List]]''' | *'''[[Driver Commands List]]''' | ||
*'''[[Session Rule List with Parameters|Session Rules List (Alphabetical) with Parameters]]''' | *'''[[Session Rule List with Parameters|Session Rules List (Alphabetical) with Parameters]]''' | ||
Line 799: | Line 801: | ||
<td> | <td> | ||
<span style="font-size: 17px;">'''Related Links'''</span><br> | <span style="font-size: 17px;">'''Related Links'''</span><br> | ||
− | *'''[[How to Use Message Popup Rule| | + | *'''[[How to Use Message Popup Rule|How to Use the Message Popup Rule]]''' |
− | *'''[[How to Use Navigation Point Rules| | + | *'''[[How to Use Navigation Point Rules|How to Use Navigation Point Rules]]''' |
− | *'''[[How to Use Session Editor| | + | *'''[[How to Use Session Editor|How to Use the Session Editor]]''' |
+ | *'''[[Parent and Child Rules|Parent and Child Rules]]''' | ||
</td> | </td> | ||
</tr> | </tr> | ||
Line 809: | Line 812: | ||
</table> | </table> | ||
---- | ---- | ||
− | This page was created by Trainz user '''<span class=" | + | This page was created by Trainz user '''<span class="plain;s">[http://online.ts2009.com/mediaWiki/index.php/User:Pware pware]</span>''' in May 2018 and was last updated as shown below. |
---- | ---- | ||
[[Category:How-to guides]][[Category:Rules]] | [[Category:How-to guides]][[Category:Rules]] |
Latest revision as of 09:35, 1 August 2024
The information in this Wiki Page applies to TANE, TRS19, Trainz Plus and TRS22.
|
|
[edit] 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 |
|
[edit] Parent/Child Rule Example
In the following example, a Trigger Check Rule is acting as the switch that decides whether or not its child rules will be executed. If the Trigger is activated, for example by a particular train passing over its track trigger, then its child rules will be executed. Otherwise the Trigger Check Rule will wait indefinitely until that event occurs, or the session is terminated.
|
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 |
[edit] 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). |
[edit] Ordered Lists
Details for this rule 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 |
|
|
Setting the Options
The rule settings allow you to control how many times an Ordered List will run.
|
[edit] Simultaneous Lists
Details for this rule can be found at Simultaneous List Rule | |
Simultaneous Lists are shown with equality (=) icons on each Child Rule which indicates that they will all be executed at the same time |
|
Setting the Options
The rule settings allow you to control how a Simultaneous List will be terminated.
|
|
|
[edit] Other Types of Lists
[edit] Progressive Lists
Details for this rule can be found at Progressive List Rule | |
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 |
|
Setting the Options
The rule settings allow you to control what happens after the last child rule in a Progressive List has been completed.
|
|
[edit] Random Lists
Details for this rule can be found at Random List Rule | |
Random Lists are shown with "dot" icons on each Child Rule which indicates that ONE of them will be selected at random |
|
[edit] Reset Lists
Details for this rule can be found at Reset List Rule | |
Reset Lists are shown with equality (=) icons on each Child Rule which indicates that they will all be executed at the same time |
|
[edit] Trainz Wiki
|
|
This page was created by Trainz user pware in May 2018 and was last updated as shown below.