How to Use Parent and Child Rules: Difference between revisions

From TrainzOnline
Jump to navigationJump to search
Pware (talk | contribs)
Pware (talk | contribs)
mNo edit summary
 
(98 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=='''Parent and Child Rules'''==
<table width=1000 bgcolor=#000000 cellpadding=2>
<tr valign="top">
<td>
<table width=996 bgcolor=#ffffff cellpadding=2>
<tr valign="middle">
<td width=35>[[image:Information.png|35px|link=]]</td>
<td><span style="font-size: 15px;">The information in this Wiki Page describes how '''Parent''' and '''Child''' rules are used in the '''Session Editor''' for '''TANE''', '''TRS19''', '''TRS22''' and '''Trainz Plus'''.</span></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<table width=1000>
<tr valign="top">
<td width=300>
__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>


==='''Parent Rules:'''===
<table> <!-- BEGIN Nav Buttons Table -->
<tr valign="top">
<td width=729><span id="stepWhat"></span>&nbsp;</td>
<td width=46>[[image:BackToTop.png|link=#top|alt=Top|Top]]</td>
<td width=75>&nbsp;</td>
<td width=75>[[image:NextDown.png|link=#stepOrdered|alt=Next Down|Next Down]]</td>
<td width=75>[[image:BackToBottom.png|link=#bottom|alt=Bottom|Bottom]]</td>
</tr>
</table> <!-- END Nav Buttons Table -->
='''What Are Parent and Child Rules?'''=


*Rules that act as '''Parent Rules''' can have one or more sub-rules or '''Child Rules''' indented under them.
<table width=1000 bgcolor="lightcyan" cellpadding=2>
*Only certain rules can be Parent Rules. See the Trainz Wiki page '''[[Parent Rule List]]''' for details.
<tr valign="top">
<td width=10>[[image:BlueDot10x10.png|link=]]</td>
<td>Rules that act as '''Parent Rules''' can have one or more sub-rules or '''Child Rules''' under them</td>
</tr>
<tr valign="top">
<td>[[image:BlueDot10x10.png|link=]]</td>
<td>'''Rules''' are edited and managed by the '''Session Editor''' in Surveyor</td>
</tr>
</table>
<br>
<table cellpadding=4 bgcolor="Aquamarine">
<tr valign="top">
<td>[[image:LinkWiki.PNG|link=]]</td>
<td>
More information on the '''Session Editor''' can be found on the '''Trainz Wiki Page''' at:-<br>
*'''[[How to Use Session Editor|Using the Session Editor]]'''
</td>
</tr>
</table>
<br>
<table width=1000>
<tr valign="top">
<td>
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.</td>
</tr>
</table>


==='''Child Rules:'''===
<table width=1000 bgcolor=#000000 cellpadding=2>
 
<tr valign="top">
*Rules that act as '''Child Rules''' are indented under a Parent Rule.  
<td>
*To '''indent''' a rule, highlight (select) it and click the '''Right Arrow ''Indent''''' tool at the bottom of the Session Editor.
<table bgcolor=#ffffb0 cellpadding=2>
<tr valign="top">
<td width=25>[[image:NotePad.PNG|link=]]</td>
<td><span style="font-size: 17px;">'''Notes:'''</span>
----
</td>
</tr>
<tr valign="top">
<td colspan=2>
<table>
<table>
<tr>
<tr valign="top">
<td valign="top">[[file:SessionRuleIndent.JPG|480px]]</td>
<td width=10>[[image:DotPoint.JPG|10px|link=]]</td>
<td valign="top">[[file:SessionRuleIndented.JPG|480px]]</td>
<td>Only certain rules can be '''Parent Rules'''. See the Trainz Wiki page [[image:WikiLink.PNG|link=]] '''[[Parent Rule List|List of Parent Rules]]''' for details</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint.JPG|10px|link=]]</td>
<td>Most '''Parent Rules''' will either wait for a specific event or perform a test or a comparison. They will execute their '''Child Rules''' when the event occurs or the test/comparison is '''true'''</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint.JPG|10px|link=]]</td>
<td>Any rule can be a '''Child Rule''' including other '''Parent Rules'''</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</table>
*Any rule can be a Child Rule.
</td>
*Child Rules are only executed if the Parent Rule returns a ''True'' result from the condition or test it is examining.
 
==='''Example:'''===
<table>
<tr>
<td>[[file:Message_Popup.jpg]]</td>
</tr>
</tr>
</table>
</table>
<br>
<table width=1000>
<tr valign="top">
<td width=325>[[image:Parent_Child.PNG|link=]]</td>
<td>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'''.<br><br>


In the screenshot above, the
'''Child Rules''' can also be '''Parent Rules''' that group together other rules at an even lower level. This creates multiple levels in the hierarchy.<br><br>
*'''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.  


You can think of this as a family tree.
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.<br>


<table border=1>
</td>
<tr>
</tr>
<td valign="top">'''Trigger Check Rule'''</td>
</table>
<br>
<table width=1000 bgcolor="lightcyan" cellpadding=2>
<tr valign="top">
<td width=10>[[image:BlueDot10x10.png|link=]]</td>
<td>Rules that act as '''Child Rules''' are indented under a '''Parent Rule'''</td>
</tr>
</table>
<br>
<table width=1000>
<tr valign="top">
<td width=480>[[image:SessionRuleIndent.JPG|480px]]</td>
<td>
<table bgcolor=#000000 cellpadding=2>
<tr valign="top">
<td>
<td>
*Parent of '''Simultaneous List Rule'''
<table bgcolor=#ffffff cellpadding=2>
*Grand Parent of '''Message Popup Rule'''
<tr valign="top">
*Grand Parent of '''Wait Rule'''
<td colspan=2><span style="font-weight: 700; font-size: 15px;">Steps: To Indent a Rule:-</span></td>
*Great Grand Parent of '''Close Message Popup Rule'''
</tr>
<tr valign="top">
<td width=25>[[image:DotPoint1.JPG|link=]]</td>
<td>select (<span style="font-weight: 700; font-size: 15px; background-color: lightcyan;">Left Click</span>) the rule to be indented</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint2.JPG|link=]]</td>
<td><span style="font-weight: 700; font-size: 15px; background-color: lightcyan;">Left Click</span> the '''Right Arrow ''Indent''''' tool at the bottom of the '''Session Editor'''</td>
</tr>
</table>
</td>
</td>
</tr>
</tr>
<tr>
</table>
<td valign="top">'''Simultaneous Check Rule'''</td>
[[image:SessionRuleIndented.JPG|480px]]</td>
</tr>
</table>
==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 the 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>
<tr valign="top">
<td width=600>[[image:Message_Popup.jpg|600px|link=]]</td>
<td>
<table bgcolor=#000000 cellpadding=2>
<tr valign="top">
<td>
<td>
*Child of '''Trigger Check Rule'''
<table bgcolor=#ffffff cellpadding=2>
*Parent of''' Message Popup Rule'''
<tr valign="top">
*Parent of '''Wait Rule'''
<td width=10>[[image:DotPoint.JPG|10px|link=]]</td>
*Grand Parent of '''Close Message Popup Rule'''
<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>
</td>
</tr>
</tr>
<tr>
</table>
<td valign="top">'''Message Popup Rule'''</td>
</td>
</tr>
</table>
 
<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;">&#160;1&#160;</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;">&#160;2&#160;</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;">&#160;3&#160;</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;">&#160;4&#160;</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>
<td>
*Grand Child of '''Trigger Check Rule'''
:::'''Line''' <span style="font-weight: 700; font-size: 15px; color: white; background-color: black;">&#160;5&#160;</span>''': Close Message Popup Rule''' is indented under the '''Wait Rule''' so it is a Child of that rule</td>
*Child of '''Simultaneous List Rule'''
</tr>
*Sibling of '''Wait Rule'''
</table>
</td>
</td>
</tr>
</tr>
<tr>
</table>
<td valign="top">'''Wait Rule'''</td>
<br>
<table width=1000>
<tr valign="top">
<td colspan=2><span style="font-size: 17px;">'''Sequence of Events'''</span></td>
</tr>
<tr valign="top">
<td width=25>[[image:DotPoint1.JPG|link=]]</td>
<td>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</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint2.JPG|link=]]</td>
<td>The '''Simultaneous List Rule''', a Parent Rule, is then executed. It executes all its Child Rules immediately and simultaneously</td>
</tr>
<tr valign="top">
<td colspan=2>
<table bgcolor=#000000 cellpadding=2>
<tr valign="top">
<td>
<td>
*Grand Child of '''Trigger Check Rule'''
<table bgcolor=#ffffff cellpadding=2>
*Child of '''Simultaneous List Rule'''
<tr valign="top">
*Sibling of '''Message Popup Rule'''
<td colspan=2>'''Simultaneously...'''</td>
*Parent of '''Close Message Popup Rule'''
</tr>
<tr valign="top">
<td>[[image:DotPoint3.JPG|link=]]</td>
<td>The '''Message Popup Rule''' is executed</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint3.JPG|link=]]</td>
<td>The '''Wait Rule''' is executed. This is set to force a 20 second wait, then ...</td>
</tr>
</table>
</td>
</td>
</tr>
</tr>
<tr>
</table>
<td valign="top">'''Close Message Popup Rule'''</td>
<td>
*Great Grand Child of '''Trigger Check Rule'''
*Grand Child of '''Simultaneous Rule'''
*Child of '''Wait Rule'''
</td>
</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint4.JPG|link=]]</td>
<td>The '''Close Message Popup Rule''' is executed. This closes the Message window created by the '''Message Popup Rule'''</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint5.JPG|link=]]</td>
<td>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</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint6.JPG|link=]]</td>
<td>Since it is also the last child rule under the '''Simultaneous List Rule''' it will terminate that Parent Rule</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint7.JPG|link=]]</td>
<td>Finally, since it is the last child rule under the '''Trigger Check Rule''', it also terminates that Parent Rule</td>
</tr>
</tr>
</table>
</table>
<br>
<table> <!-- BEGIN Nav Buttons Table -->
<tr valign="top">
<td width=729><span id="stepOrdered"></span>&nbsp;</td>
<td width=46>[[image:BackToTop.png|link=#top|alt=Top|Top]]</td>
<td width=75>[[image:NextUp.png|link=#stepWhat|alt=Next Up|Top]]</td>
<td width=75>[[image:NextDown.png|link=#stepOthers|alt=Next Down|Next Down]]</td>
<td width=75>[[image:BackToBottom.png|link=#bottom|alt=Bottom|Bottom]]</td>
</tr>
</table> <!-- END Nav Buttons Table -->


==='''Sequence of Events:'''===
='''Ordered Lists vs Simultaneous Lists'''=


*When the consist identified in the '''Trigger Check Rule''' reaches the set trigger, then the Trigger Event is activated and its child rules are executed.
<table width=1000>
**The '''Simultaneous List Rule''' (which has no conditional test) is then executed. It executes all its child rules simultaneously.
<tr valign="top">
***The '''Message Popup Rule''' is executed. This waits until its message window is closed. At the same time ...
<td>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''').</td>
***The '''Wait Rule''' is executed. This is set to force a 20 second wait, after which ...
</tr>
****The '''Close Message Popup Rule''' is executed. This closes the Message window created by the '''Message Popup Rule'''. Since it is the last rule under the '''Simultaneous List Rule''' it terminates that rule. Since it is the last rule under the '''Trigger Check Rule''', it also terminates that rule.
</table>


=='''Ordered Lists vs Simultaneous Lists'''==
==Ordered Lists==
 
<table width=1000 bgcolor="lightcyan" cellpadding=2>
<tr valign="top">
<td width=10>[[image:BlueDot10x10.png|link=]]</td>
<td>Details for this rule can be found at [[image:WikiLink.PNG|link=]] '''[[Session_Rule_List_with_Parameters#Ordered_List_Rule|Ordered List Rule]]'''</td>
</tr>
<tr valign="top">
<td width=10>[[image:BlueDot10x10.png|link=]]</td>
<td>'''Ordered Lists''' are shown with '''numbered icons''' on each '''Child Rule''' which indicates the order in which they will be executed</td>
</tr>
</table>
<br>
<table width=1000>
<tr align="top">
<td width=500>[[image:OrderedListRule.JPG|500px|link=]]</td>
<td>
<table bgcolor=#000000 cellpadding=2>
<tr valign="top">
<td>
<table bgcolor=#ffffb0 cellpadding=2>
<tr valign="top">
<td width=25>[[image:NotePad.PNG|link=]]</td>
<td><span style="font-size: 17px;">'''Notes:'''</span><br>
----
</td>
</tr>
<tr valign="top">
<td width=10>[[image:DotPoint.JPG|10px|link=]]</td>
<td>an '''Ordered List''' can be set to repeat a set number of times</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint.JPG|10px|link=]]</td>
<td>each '''Child Rule''' in the sequence must be completed before the next '''Child Rule''' can be executed</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint.JPG|10px|link=]]</td>
<td>an '''Ordered List''' is completed when the '''last''' Child Rule is completed</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<table width=1000 bgcolor=#000000 cellpadding=2>
<tr valign="top">
<td>
<table bgcolor=#ffffe0 cellpadding=2>
<tr valign="top">
<td>[[image:PencilTips.PNG|link=]]</td>
<td>Because some rules will wait for an event (such as a mouse click, a set time or a time period, a trigger, etc) before they are completed, it is possible for the Ordered List to ''hang'' indefinitely waiting for the event to occur. This will stop that particular Child Rule from being completed and any following Child Rules from being started. So, if possible, place Child Rules that are event dependent at the end of an ordered list.</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<span style="font-weight: 700; font-size: 17px; color: white; background-color: black;">&#160;Setting the Options&#160;</span><br>


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''').
The rule settings allow you to control how many times an '''Ordered List''' will run.<br>


==='''Ordered Lists: [[Session_Rule_List_with_Parameters#Ordered_List_Rule|Ordered List Rule]]'''===
<table width=1000>
----
<tr valign="top">
<td width=550>
<table width=550 bgcolor=#000000 cellpadding=2>
<tr valign="top">
<td>
<table bgcolor=#ffffff cellpadding=2>
<tr valign="top">
<td colspan=2><span style="font-weight: 700; font-size: 15px;">Steps: To Set the Repeat Options for an Ordered List:-</span></td>
</tr>
<tr valign="top">
<td width=25>[[image:DotPoint1.JPG|link=]]</td>
<td>select (<span style="font-weight: 700; font-size: 15px; background-color: lightcyan;">Left Click</span> on) the '''Ordered List''' in the '''Session Editor'''</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint2.JPG|link=]]</td>
<td>select (<span style="font-weight: 700; font-size: 15px; background-color: lightcyan;">Left Click</span> on) the <span style="font-weight: 700; font-size: 15px; color: white; background-color: black;">&#160;Edit&#160;</span> button at the bottom of the '''Session Editor''' to open the '''Ordered List''' properties window</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint3.JPG|link=]]</td>
<td>Select an '''Option Button''':-
<table>
<table>
<tr>
<tr valign="top">
<td>[[file:DotPoint.JPG]]</td>
<td width=10>[[image:BlueDot10x10.png|link=]]</td>
<td>'''Ordered Lists are shown with numbered icons on each Child Rule which indicates the order in which they will be executed.'''</td>
<td><span style="font-weight: 700; font-size: 15px; background-color: lightgrey;">This process will repeat <u>1</u> time(s)</span></td>
</tr>
<tr valign="top">
<td>[[image:BlueDot10x10.png|link=]]</td>
<td><span style="font-weight: 700; font-size: 15px; background-color: lightgrey;">This process will repeat forever</span></td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint4.JPG|link=]]</td>
<td>to change the number of repeats to any required number <span style="font-weight: 700; font-size: 15px; background-color: lightcyan;">Left Click</span> on the '''<u>1</u>''' and enter a new value. Click the [[image:Tick.PNG|Link=]] to accept the change</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint5.JPG|link=]]</td>
<td>to accept the new rule settings <span style="font-weight: 700; font-size: 15px; background-color: lightcyan;">Left Click</span> on the [[image:Tick.PNG|Link=]] or the <span style="font-weight: 700; font-size: 15px; color: white; background-color: black;">&#160;Save Changes&#160;</span> button (depending on your version of '''Trainz''') in the rule properties window</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td>
<table width=450>
<tr valign="top">
<td>[[image:RuleRepeatsSetting.png|link=]]<br><br>
[[image:RuleRepeatsEntry.png|link=]]</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</table>
<br>
<table bgcolor=#000000 cellpadding=2>
<tr valign="top">
<td>
<table bgcolor=#ffffb0 cellpadding=2>
<tr valign="top">
<td width=25>[[image:NotePad.PNG|link=]]</td>
<td><span style="font-size: 17px;">'''Notes:'''</span><br>
----
----
</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint.JPG|10px|link=]]</td>
<td>the '''minimum''' number is '''1''' which means that the '''Ordered List''' will execute '''once only'''</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint.JPG|10px|link=]]</td>
<td>the "repeat forever" option will force the list to restart again endlessly</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
==Simultaneous Lists==


<table>
<table width=1000 bgcolor="lightcyan" cellpadding=2>
<tr>
<tr valign="top">
<td>[[file:OrderedListRule.JPG]]</td>
<td width=10>[[image:BlueDot10x10.png|link=]]</td>
<td>Details for this rule can be found at [[image:WikiLink.PNG|link=]] '''[[Session_Rule_List_with_Parameters#Simultaneous_List_Rule|Simultaneous List Rule]]'''</td>
</tr>
<tr valign="top">
<td width=10>[[image:BlueDot10x10.png|link=]]</td>
<td>'''Simultaneous Lists''' are shown with '''equality (<span style="font-size: 15px;">=</span>) icons''' on each '''Child Rule''' which indicates that they will all be executed at the same time</td>
</tr>
</tr>
</table>
</table>
 
<br>
<table width=1000>
<tr valign="top">
<td width=500>[[image:SimultaneousListRule.JPG|500px|link=]]</td>
<td width=500>
<table width=500 bgcolor=#000000 cellpadding=2>
<tr valign="top">
<td>
<table bgcolor=#ffffb0 cellpadding=2>
<tr valign="top">
<td width=25>[[image:NotePad.PNG|link=]]</td>
<td><span style="font-size: 17px;">'''Notes:'''</span><br>
----
----
<table>
</td>
<tr>
</tr>
<td>[[file:DotPoint.JPG]]</td>
<tr valign="top">
<td>'''Each Child Rule in the sequence must be completed before the next Child Rule can be executed.'''</td>
<td>[[image:DotPoint.JPG|10px|link=]]</td>
<td>a '''Simultaneous List''' can be set to complete when all the '''Child Rules''' have been completed, or when any one of the '''Child Rules''' has been completed</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint.JPG|10px|link=]]</td>
<td>while all '''Child Rules''' in a '''Simultaneous List''' will start at the same time, some will take longer to complete than others and some may wait for a particular event before they can complete</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</table>
----
<br>
*Because some rules will wait for an event (such as a mouse click, timer, consist trigger, load trigger, etc) before they are completed, it is possible for the Ordered List to ''hang'' indefinitely waiting for the event.
<span style="font-weight: 700; font-size: 17px; color: white; background-color: black;">&#160;Setting the Options&#160;</span><br>
*An Ordered List is completed when the last Child Rule is completed.
 
*If possible, place Child Rules that are event dependent at the end of an ordered list.
The rule settings allow you to control how a '''Simultaneous List''' will be terminated.<br>


==='''Simultaneous Lists: [[Session_Rule_List_with_Parameters#Simultaneous_List_Rule|Simultaneous List Rule]]'''===
<table width=1000>
----
<tr valign="top">
<td width=550>
<table width=550 bgcolor=#000000 cellpadding=2>
<tr valign="top">
<td>
<table bgcolor=#ffffff cellpadding=2>
<tr valign="top">
<td colspan=2><span style="font-weight: 700; font-size: 15px;">Steps: To Set the Completion Options for a Simultaneous List:-</span></td>
</tr>
<tr valign="top">
<td width=25>[[image:DotPoint1.JPG|link=]]</td>
<td>select (<span style="font-weight: 700; font-size: 15px; background-color: lightcyan;">Left Click</span> on) the '''Simultaneous List''' in the '''Session Editor'''</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint2.JPG|link=]]</td>
<td>select (<span style="font-weight: 700; font-size: 15px; background-color: lightcyan;">Left Click</span> on) the <span style="font-weight: 700; font-size: 15px; color: white; background-color: black;">&#160;Edit&#160;</span> button at the bottom of the '''Session Editor''' to open the '''Simultaneous List''' properties window</td>
</tr>
<tr valign="top">
<td colspan=2>Depending on your version of '''Trainz''' 2 or 3 options are presented by cycling ("clicking") through the underlined text.</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint3.JPG|link=]]</td>
<td>Select an option:-
<table>
<table>
<tr>
<tr valign="top">
<td>[[file:DotPoint.JPG]]</td>
<td width=10>[[image:BlueDot10x10.png|link=]]</td>
<td>'''Simultaneous Lists are shown with equality ("=") icons on each Child Rule which indicates that they will be executed at the same time.'''</td>
<td><span style="font-weight: 700; font-size: 15px; background-color: lightgrey;"><u>all child rules have reached a completed state</u></span></td>
</tr>
<tr valign="top">
<td>[[image:BlueDot10x10.png|link=]]</td>
<td><span style="font-weight: 700; font-size: 15px; background-color: lightgrey;"><u>all child rules have reached a 'was completed' state</u></span></td>
</tr>
<tr valign="top">
<td>[[image:BlueDot10x10.png|link=]]</td>
<td><span style="font-weight: 700; font-size: 15px; background-color: lightgrey;"><u>one of the child rules has completed</u></span></td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint4.JPG|link=]]</td>
<td>to accept the new rule settings <span style="font-weight: 700; font-size: 15px; background-color: lightcyan;">Left Click</span> on the [[image:Tick.PNG|Link=]] or the <span style="font-weight: 700; font-size: 15px; color: white; background-color: black;">&#160;Save Changes&#160;</span> button (depending on your version of '''Trainz''') in the rule properties window</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td>
<table width=450>
<tr valign="top">
<td>[[image:RuleAllCompletedSetting.png|link=]]<br><br>
[[image:RuleWasCompletedSetting.png|link=]]<br><br>
[[image:RuleOneCompletedSetting.png|link=]]</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</table>
<br>
<table width=1000 bgcolor=#000000 cellpadding=2>
<tr valign="top">
<td>
<table bgcolor=#ffffb0 cellpadding=2>
<tr valign="top">
<td width=25>[[image:NotePad.PNG|link=]]</td>
<td><span style="font-size: 17px;">'''Notes:'''</span><br>
----
----
 
</td>
<table>
</tr>
<tr>
<tr valign="top">
<td>[[file:SimultaneousListRule.JPG]]</td>
<td width=10>[[image:DotPoint.JPG|10px|link=]]</td>
<td>the first option, "'''all child rules have reached a completed state'''", means that the '''Simultaneous List''' will wait until ALL child rules have been completed before terminating. Some child rules may wait for an event, such as a trigger or a set time, before they terminate</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint.JPG|10px|link=]]</td>
<td>the second option, "'''all child rules have reached a 'was completed' state'''", is needed for the '''UDS''' feature in '''TRS19 Platinium''' and later versions that allows you to switch between '''Driver''' and '''Surveyor'''. If you make the switch back to Driver when some rules have been completed but others have not, then the completed child rules will not be restarted and the '''Simultaneous Rule''' will wait until all the child rules reach the '''was completed''' state before it terminates</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint.JPG|10px|link=]]</td>
<td>the third option, "'''one of the child rules has completed'''" will terminate the '''Simultaneous Rule''', and any child rules that have not yet completed, as soon as one child rule completes</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</table>
<br>
<table> <!-- BEGIN Nav Buttons Table -->
<tr valign="top">
<td width=729><span id="stepOthers"></span>&nbsp;</td>
<td width=46>[[image:BackToTop.png|link=#top|alt=Top|Top]]</td>
<td width=75>[[image:NextUp.png|link=#stepOrdered|alt=Next Up|Top]]</td>
<td width=75>[[image:NextDown.png|link=#stepRelated|alt=Next Down|Next Down]]</td>
<td width=75>[[image:BackToBottom.png|link=#bottom|alt=Bottom|Bottom]]</td>
</tr>
</table> <!-- END Nav Buttons Table -->


*A Simultaneous List can be set to complete when:-
='''Other Types of Lists'''=
**all the Child Rules are completed, OR
**any one of the Child Rules has been completed.


==''' Other Types of Lists'''==
==Progressive Lists==
 
==='''Progressive Lists: [[Session_Rule_List_with_Parameters#Progressive_List_Rule|Progressive List Rule]]'''===


<table width=1000 bgcolor="lightcyan" cellpadding=2>
<tr valign="top">
<td width=10>[[image:BlueDot10x10.png|link=]]</td>
<td>Details for this rule can be found at [[image:WikiLink.PNG|link=]] '''[[Session_Rule_List_with_Parameters#Progressive_List_Rule|Progressive List Rule]]'''</td>
</tr>
<tr valign="top">
<td width=10>[[image:BlueDot10x10.png|link=]]</td>
<td>'''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</td>
</tr>
</table>
<br>
<table width=1000>
<tr>
<td width=500>[[image:ProgressiveListRules.JPG|500px|link=]]</td>
<td width=500>
<table width=500 bgcolor=#000000 cellpadding=2>
<tr valign="top">
<td>
<table bgcolor=#ffffb0 cellpadding=2>
<tr valign="top">
<td width=25>[[image:NotePad.PNG|link=]]</td>
<td><span style="font-size: 17px;">'''Notes:'''</span><br>
----
----
<table>
</td>
<tr>
</tr>
<td>[[file:DotPoint.JPG]]</td>
<tr valign="top">
<td>'''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.'''</td>
<td>[[image:DotPoint.JPG|10px|link=]]</td>
<td>a '''Progressive List''' executes only a single child rule each time it runs</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint.JPG|10px|link=]]</td>
<td>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. Until all the child rules have been executed</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</table>
----
</td>
 
<table>
<tr>
<td>[[file:ProgressiveListRules.JPG]]</td>
</tr>
</tr>
</table>
</table>
<br>
<span style="font-weight: 700; font-size: 17px; color: white; background-color: black;">&#160;Setting the Options&#160;</span><br>


==='''Random Lists: [[Session_Rule_List_with_Parameters#Random_List_Rule|Random List Rule]]'''===
The rule settings allow you to control what happens after the last child rule in a '''Progressive List''' has been completed.<br>


----
<table width=1000>
<tr valign="top">
<td width=550>
<table width=550 bgcolor=#000000 cellpadding=2>
<tr valign="top">
<td>
<table bgcolor=#ffffff cellpadding=2>
<tr valign="top">
<td colspan=2><span style="font-weight: 700; font-size: 15px;">Steps: To Set the Completion Options for a Progressive List:-</span></td>
</tr>
<tr valign="top">
<td width=25>[[image:DotPoint1.JPG|link=]]</td>
<td>select (<span style="font-weight: 700; font-size: 15px; background-color: lightcyan;">Left Click</span> on) the '''Progressive List''' in the '''Session Editor'''</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint2.JPG|link=]]</td>
<td>select (<span style="font-weight: 700; font-size: 15px; background-color: lightcyan;">Left Click</span> on) the <span style="font-weight: 700; font-size: 15px; color: white; background-color: black;">&#160;Edit&#160;</span> button at the bottom of the '''Session Editor''' to open the '''Progressive List''' properties window</td>
</tr>
<tr valign="top">
<td colspan=2>You can select from 3 options by cycling ("clicking") through the underlined text.</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint3.JPG|link=]]</td>
<td>Select an option:-
<table>
<table>
<tr>
<tr valign="top">
<td>[[file:DotPoint.JPG]]</td>
<td width=10>[[image:BlueDot10x10.png|link=]]</td>
<td>'''A Random List will run <font color="red">ONLY ONCE</font> and will randomly select a single Child Rule to execute.'''</td>
<td><span style="font-weight: 700; font-size: 15px; background-color: lightgrey;"><u>... successive runs will do nothing</u></span> - after the last child rule has been completed the '''Progressive Rule''' will terminate</td>
</tr>
<tr valign="top">
<td>[[image:BlueDot10x10.png|link=]]</td>
<td><span style="font-weight: 700; font-size: 15px; background-color: lightgrey;"><u>... last child .... will be used for all successive runs</u></span> - after the last child rule has been completed the '''Progressive Rule''' will repeat that child rule on all further runs</td>
</tr>
<tr valign="top">
<td>[[image:BlueDot10x10.png|link=]]</td>
<td><span style="font-weight: 700; font-size: 15px; background-color: lightgrey;"><u>... the first child is chosen again</u></span> - after the last child rule has been completed the '''Progressive Rule''' will start with the first child rule again and it will repeat the sequence</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint4.JPG|link=]]</td>
<td>to accept the new rule settings <span style="font-weight: 700; font-size: 15px; background-color: lightcyan;">Left Click</span> on the [[image:Tick.PNG|Link=]] or the <span style="font-weight: 700; font-size: 15px; color: white; background-color: black;">&#160;Save Changes&#160;</span> button (depending on your version of '''Trainz''') in the rule properties window</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td>
<table width=450>
<tr valign="top">
<td>[[image:RuleProgressiveNoneSetting.png|link=]]<br><br>
[[image:RuleProgressiveLastSetting.png|link=]]<br><br>
[[image:RuleProgressiveRepeatSetting.png|link=]]</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</table>
----
<br>
==Random Lists==


<table>
<table width=1000 bgcolor="lightcyan" cellpadding=2>
<tr valign="top">
<td width=10>[[image:BlueDot10x10.png|link=]]</td>
<td>Details for this rule can be found at [[image:WikiLink.PNG|link=]] '''[[Session_Rule_List_with_Parameters#Random_List_Rule|Random List Rule]]'''</td>
</tr>
<tr valign="top">
<td width=10>[[image:BlueDot10x10.png|link=]]</td>
<td>'''Random Lists''' are shown with '''"dot" icons''' on each '''Child Rule''' which indicates that '''ONE''' of them will be selected at random</td>
</tr>
</table>
<br>
<table width=1000>
<tr>
<tr>
<td>[[file:RandomListRules.JPG]]</td>
<td width=500>[[image:RandomListRules.JPG|500px|link=]]</td>
<td width=500>
<table width=500 bgcolor=#000000 cellpadding=2>
<tr valign="top">
<td>
<table bgcolor=#ffffb0 cellpadding=2>
<tr valign="top">
<td width=25>[[image:NotePad.PNG|link=]]</td>
<td><span style="font-size: 17px;">'''Notes:'''</span><br>
----
</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint.JPG|10px|link=]]</td>
<td>a '''Random List''' will run '''ONCE ONLY'''</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint.JPG|10px|link=]]</td>
<td>a child rule will be selected '''at random''' and once that child rule has been completed, the '''Random List''' will terminate</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint.JPG|10px|link=]]</td>
<td>there are no control options for a '''Random List'''</td>
</tr>
</tr>
</table>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
==Reset Lists==


==='''Reset Lists: [[Session_Rule_List_with_Parameters#Reset_List_Rule|Reset List Rule]]'''===
<table width=1000 bgcolor="lightcyan" cellpadding=2>
 
<tr valign="top">
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.
<td width=10>[[image:BlueDot10x10.png|link=]]</td>
 
<td>Details for this rule can be found at [[image:WikiLink.PNG|link=]] '''[[Session_Rule_List_with_Parameters#Reset_List_Rule|Reset List Rule]]'''</td>
<table>
</tr>
<tr valign="top">
<td width=10>[[image:BlueDot10x10.png|link=]]</td>
<td>'''Reset Lists''' are shown with '''equality (<span style="font-size: 15px;">=</span>) icons''' on each '''Child Rule''' which indicates that they will all be executed at the same time</td>
</tr>
</table>
<br>
<table width=1000>
<tr>
<tr>
<td>[[file:ResetListRules.JPG]]</td>
<td width=500>[[image:ResetListRules.JPG|500px|link=]]</td>
<td width=500>
<table width=500 bgcolor=#000000 cellpadding=2>
<tr valign="top">
<td>
<table bgcolor=#ffffb0 cellpadding=2>
<tr valign="top">
<td width=25>[[image:NotePad.PNG|link=]]</td>
<td><span style="font-size: 17px;">'''Notes:'''</span><br>
----
</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint.JPG|10px|link=]]</td>
<td>a '''Reset List''' will never terminate. It will run '''continuously'''</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint.JPG|10px|link=]]</td>
<td>after the last child rule has been completed, all the child rules will be reset and executed again</td>
</tr>
<tr valign="top">
<td>[[image:DotPoint.JPG|10px|link=]]</td>
<td>there are no control options for a '''Reset List'''</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<table> <!-- BEGIN Nav Buttons Table -->
<tr valign="top">
<td width=729><span id="stepRelated"></span>&nbsp;</td>
<td width=46>[[image:BackToTop.png|link=#top|alt=Top|Top]]</td>
<td width=75>[[image:NextUp.png|link=#stepOthers|alt=Next Up|Top]]</td>
<td width=75>&nbsp;</td>
<td width=75>&nbsp;</td>
</tr>
</table> <!-- END Nav Buttons Table -->
<br>
<table> <!-- BEGIN Nav Buttons Table -->
<tr valign="top">
<td width=729><span id="bottom"></span>&nbsp;</td>
</tr>
</table> <!-- END Nav Buttons Table -->
----
----
='''Trainz Wiki'''=
<table width=1000>
<tr valign="top">
<td>
<table width=500 cellpadding=2 bgcolor=#ffffff>
<tr valign="top">
<td width=80>[[image:TrainzWiki.png|link=]]</td>
<td>
<span style="font-size: 17px;">'''More Tutorials and Guides to Using Trainz'''</span><br>
*'''<span class="plain;">[http://online.ts2009.com/mediaWiki/index.php/HowTo How to Guides]</span>'''
*'''[[Driver Commands List]]'''
*'''[[Session Rule List with Parameters|Session Rules List (Alphabetical) with Parameters]]'''
*'''[[Session Rules By Categories With Properties|Session Rules List (Categories) With Parameters]]'''
</td>
</tr>
</tr>
</table>
</table>
 
</td>
=='''Trainz Creation Tutorials:'''==
<td>
*'''<span class="plainlinks">[http://online.ts2009.com/mediaWiki/index.php/HowTo How to Guides]</span>'''
<table width=500 cellpadding=4 bgcolor="aquamarine">
'''Related Session Creation Tutorials:'''
<tr valign="top">
<div style="column-count:2;-moz-column-count:2;-webkit-column-count:2">
<td width=50>[[image:LinkWiki.PNG|link=]]</td>
*'''[[Creating a HTML Asset]]'''
<td>
*'''[[Controlling Junctions in Sessions]]'''
<span style="font-size: 17px;">'''Related Links'''</span><br>
*'''[[Controlling Signals in Sessions]]'''
*'''[[How to Use Message Popup Rule|How to Use the Message Popup Rule]]'''
*'''[[Message Popup Rule Applications]]'''
*'''[[How to Use Navigation Point Rules|How to Use Navigation Point Rules]]'''
*'''[[Message Popup Example|Message Popup Rule Examples]]'''
*'''[[How to Use Session Editor|How to Use the Session Editor]]'''
*'''[[Navigation Point Applications]]'''
*'''[[Parent and Child Rules|Parent and Child Rules]]'''
*'''[[Navigation Point Rules Examples]]'''
</td>
*'''[[Parent Rule List]]'''
</tr>
*'''[[Trigger Basics]]'''
</table>
*'''[[Using Variables in Sessions - Examples]]'''
</td>
</div>
</tr>
</table>
----
This page was created by Trainz user '''<span class="plain;">[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]]

Latest revision as of 10:41, 10 September 2026

Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 The information in this Wiki Page describes how Parent and Child rules are used in the Session Editor for TANE, TRS19, TRS22 and Trainz Plus.


Session Rules are the "programming tools" for constructing interactive sessions
Parent Rules are the decision makers amongst the Session Rules
  Top   Next Down Bottom

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.
Notes:
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 Only certain rules can be Parent Rules. See the Trainz Wiki page List of Parent Rules for details
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 Most Parent Rules will either wait for a specific event or perform a test or a comparison. They will execute their Child Rules when the event occurs or the test/comparison is true
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 Any rule can be a Child Rule including other Parent Rules


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
Steps: To Indent a Rule:-
select (Left Click) the rule to be indented
Left Click the Right Arrow Indent tool at the bottom of the Session Editor
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127

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 the 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.

Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 the cause of the trigger event is set in the properties of the Trigger Check Rule
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 the message shown is set in the properties of the Message Popup Rule
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 the duration of the wait is set in the properties of the Wait Rule
In the screenshot above, the
Line  1 : Trigger Check Rule is a Parent Rule. It has rules indented below it which are its Child Rules:-
Line  2 : 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:-
Line  3 : Message Popup Rule is indented under the Simultaneous List Rule so it is a Child of that rule
Line  4 : 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
Line  5 : Close Message Popup Rule is indented under the Wait Rule so it is a Child of that rule


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
Simultaneously...
The Message Popup Rule is executed
The Wait Rule is executed. This is set to force a 20 second wait, then ...
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


  Top Next Up Next Down Bottom

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 List Rule
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
Notes:

Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 an Ordered List can be set to repeat a set number of times
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 each Child Rule in the sequence must be completed before the next Child Rule can be executed
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 an Ordered List is completed when the last Child Rule is completed


Because some rules will wait for an event (such as a mouse click, a set time or a time period, a trigger, etc) before they are completed, it is possible for the Ordered List to hang indefinitely waiting for the event to occur. This will stop that particular Child Rule from being completed and any following Child Rules from being started. So, if possible, place Child Rules that are event dependent at the end of an ordered list.


 Setting the Options 

The rule settings allow you to control how many times an Ordered List will run.

Steps: To Set the Repeat Options for an Ordered List:-
select (Left Click on) the Ordered List in the Session Editor
select (Left Click on) the  Edit  button at the bottom of the Session Editor to open the Ordered List properties window
Select an Option Button:-
This process will repeat 1 time(s)
This process will repeat forever
to change the number of repeats to any required number Left Click on the 1 and enter a new value. Click the Link= to accept the change
to accept the new rule settings Left Click on the Link= or the  Save Changes  button (depending on your version of Trainz) in the rule properties window



Notes:

Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 the minimum number is 1 which means that the Ordered List will execute once only
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 the "repeat forever" option will force the list to restart again endlessly


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


Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127
Notes:

Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 a Simultaneous List can be set to complete when all the Child Rules have been completed, or when any one of the Child Rules has been completed
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 while all Child Rules in a Simultaneous List will start at the same time, some will take longer to complete than others and some may wait for a particular event before they can complete


 Setting the Options 

The rule settings allow you to control how a Simultaneous List will be terminated.

Steps: To Set the Completion Options for a Simultaneous List:-
select (Left Click on) the Simultaneous List in the Session Editor
select (Left Click on) the  Edit  button at the bottom of the Session Editor to open the Simultaneous List properties window
Depending on your version of Trainz 2 or 3 options are presented by cycling ("clicking") through the underlined text.
Select an option:-
all child rules have reached a completed state
all child rules have reached a 'was completed' state
one of the child rules has completed
to accept the new rule settings Left Click on the Link= or the  Save Changes  button (depending on your version of Trainz) in the rule properties window





Notes:

Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 the first option, "all child rules have reached a completed state", means that the Simultaneous List will wait until ALL child rules have been completed before terminating. Some child rules may wait for an event, such as a trigger or a set time, before they terminate
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 the second option, "all child rules have reached a 'was completed' state", is needed for the UDS feature in TRS19 Platinium and later versions that allows you to switch between Driver and Surveyor. If you make the switch back to Driver when some rules have been completed but others have not, then the completed child rules will not be restarted and the Simultaneous Rule will wait until all the child rules reach the was completed state before it terminates
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 the third option, "one of the child rules has completed" will terminate the Simultaneous Rule, and any child rules that have not yet completed, as soon as one child rule completes


  Top Next Up Next Down Bottom

Other Types of Lists

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


Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127
Notes:

Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 a Progressive List executes only a single child rule each time it runs
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 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. Until all the child rules have been executed


 Setting the Options 

The rule settings allow you to control what happens after the last child rule in a Progressive List has been completed.

Steps: To Set the Completion Options for a Progressive List:-
select (Left Click on) the Progressive List in the Session Editor
select (Left Click on) the  Edit  button at the bottom of the Session Editor to open the Progressive List properties window
You can select from 3 options by cycling ("clicking") through the underlined text.
Select an option:-
... successive runs will do nothing - after the last child rule has been completed the Progressive Rule will terminate
... last child .... will be used for all successive runs - after the last child rule has been completed the Progressive Rule will repeat that child rule on all further runs
... the first child is chosen again - after the last child rule has been completed the Progressive Rule will start with the first child rule again and it will repeat the sequence
to accept the new rule settings Left Click on the Link= or the  Save Changes  button (depending on your version of Trainz) in the rule properties window





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


Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127
Notes:

Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 a Random List will run ONCE ONLY
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 a child rule will be selected at random and once that child rule has been completed, the Random List will terminate
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 there are no control options for a Random List


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


Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127
Notes:

Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 a Reset List will never terminate. It will run continuously
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 after the last child rule has been completed, all the child rules will be reset and executed again
Error creating thumbnail: /bin/bash: line 1: /usr/bin/convert: No such file or directory Error code: 127 there are no control options for a Reset List


  Top Next Up    


 


Trainz Wiki

More Tutorials and Guides to Using Trainz

Related Links


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