How to Use Parent and Child Rules
m (→Trainz Wiki) |
|||
(4 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
The information in this Wiki Page applies to '''TANE''', '''TRS19''', '''Trainz Plus''' and '''TRS22'''. | The information in this Wiki Page applies to '''TANE''', '''TRS19''', '''Trainz Plus''' and '''TRS22'''. | ||
− | + | <table width=1000> | |
+ | <tr valign="top"> | ||
+ | <td width=300> | ||
__TOC__ | __TOC__ | ||
+ | </td> | ||
+ | <td> | ||
+ | <table bgcolor="lightcyan" cellpadding=2> | ||
+ | <tr valign="top"> | ||
+ | <td width=10>[[image:BlueDot10x10.png|link=]]</td> | ||
+ | <td>Session Rules are the "programming tools" for constructing interactive sessions</td> | ||
+ | </tr> | ||
+ | <tr valign="top"> | ||
+ | <td>[[image:BlueDot10x10.png|link=]]</td> | ||
+ | <td>'''Parent Rules''' are the decision makers amongst the Session Rules</td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
<table> <!-- BEGIN Nav Buttons Table --> | <table> <!-- BEGIN Nav Buttons Table --> | ||
<tr valign="top"> | <tr valign="top"> | ||
Line 121: | Line 139: | ||
</table> | </table> | ||
==Parent/Child Rule Example== | ==Parent/Child Rule Example== | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<table width=1000> | <table width=1000> | ||
<tr valign="top"> | <tr valign="top"> | ||
− | <td> | + | <td width=600>[[image:Message_Popup.jpg|600px|link=]]</td> |
− | <table> | + | <td> |
+ | <table bgcolor=#000000 cellpadding=2> | ||
<tr valign="top"> | <tr valign="top"> | ||
− | < | + | <td> |
− | + | <table bgcolor=#ffffff cellpadding=2> | |
− | <table> | + | |
<tr valign="top"> | <tr valign="top"> | ||
<td width=10>[[image:DotPoint.JPG|10px|link=]]</td> | <td width=10>[[image:DotPoint.JPG|10px|link=]]</td> | ||
− | <td> | + | <td>the cause of the trigger event is set in the properties of the '''Trigger Check Rule''' </td> |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
</tr> | </tr> | ||
<tr valign="top"> | <tr valign="top"> | ||
<td>[[image:DotPoint.JPG|10px|link=]]</td> | <td>[[image:DotPoint.JPG|10px|link=]]</td> | ||
− | <td> | + | <td>the message shown is set in the properties of the '''Message Popup Rule''' </td> |
− | < | + | </tr> |
<tr valign="top"> | <tr valign="top"> | ||
<td>[[image:DotPoint.JPG|10px|link=]]</td> | <td>[[image:DotPoint.JPG|10px|link=]]</td> | ||
− | <td> | + | <td>the duration of the wait is set in the properties of the '''Wait Rule''' </td> |
</tr> | </tr> | ||
</table> | </table> | ||
Line 158: | Line 166: | ||
</tr> | </tr> | ||
</table> | </table> | ||
− | </td> | + | |
+ | <table width=1000> | ||
+ | <tr valign="top"> | ||
+ | <td>In the screenshot above, the | ||
+ | <table> | ||
+ | <tr valign="top"> | ||
+ | <td>'''Line''' <span style="font-weight: 700; font-size: 15px; color: white; background-color: black;"> 1 </span>''': Trigger Check Rule''' is a Parent Rule. It has rules indented below it which are its Child Rules:-</td> | ||
+ | </tr> | ||
+ | <tr valign="top"> | ||
+ | <td> | ||
+ | :'''Line''' <span style="font-weight: 700; font-size: 15px; color: white; background-color: black;"> 2 </span>''': Simultaneous List Rule''' is indented under the '''Trigger Check Rule''' so it is a Child of that rule. It is also a Parent Rule and it has its own Child Rules indented below it:-</td> | ||
+ | </tr> | ||
+ | <tr valign="top"> | ||
+ | <td> | ||
+ | ::'''Line''' <span style="font-weight: 700; font-size: 15px; color: white; background-color: black;"> 3 </span>''': Message Popup Rule''' is indented under the '''Simultaneous List Rule''' so it is a Child of that rule</td> | ||
+ | </tr> | ||
+ | <tr valign="top"> | ||
+ | <td> | ||
+ | ::'''Line''' <span style="font-weight: 700; font-size: 15px; color: white; background-color: black;"> 4 </span>''': 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</td> | ||
+ | </tr> | ||
+ | <tr valign="top"> | ||
+ | <td> | ||
+ | :::'''Line''' <span style="font-weight: 700; font-size: 15px; color: white; background-color: black;"> 5 </span>''': Close Message Popup Rule''' is indented under the '''Wait Rule''' so it is a Child of that rule</td> | ||
</tr> | </tr> | ||
</table> | </table> | ||
Line 738: | Line 768: | ||
</tr> | </tr> | ||
</table> <!-- END Nav Buttons Table --> | </table> <!-- END Nav Buttons Table --> | ||
− | + | <br> | |
− | + | ||
− | < | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
<table> <!-- BEGIN Nav Buttons Table --> | <table> <!-- BEGIN Nav Buttons Table --> | ||
<tr valign="top"> | <tr valign="top"> | ||
Line 758: | Line 776: | ||
---- | ---- | ||
---- | ---- | ||
− | |||
='''Trainz Wiki'''= | ='''Trainz Wiki'''= | ||
− | <table | + | <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 772: | Line 792: | ||
</tr> | </tr> | ||
</table> | </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|How to Use the Message Popup Rule]]''' | ||
+ | *'''[[How to Use Navigation Point Rules|How to Use Navigation Point Rules]]''' | ||
+ | *'''[[How to Use Session Editor|How to Use the Session Editor]]''' | ||
+ | *'''[[Parent and Child Rules|Parent and Child Rules]]''' | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> |
Latest revision as of 22:15, 23 November 2023
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 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
|
|