Rule Scripting Advice(TS2010)

Ethan777

Singapore Railfan
I am making a session which involves sorting cars into 4 cuts.

The problem is I want the session to only continue when the locomotives(player) has finished sorting out the cars into 4 cuts.

Each cut of cars must be in an order I have set.

Car 1...
Car 2...

So I use the Consist Check to add each car in its following sequence.

How should I script the rules to allow this then? I have tried adding in 4 consist check rules and 4 variable modify rules indented below each CC respectively and at the end a Variable Check rule which checks that the variable "consists"(the name I gave it) is equal to 4 before the next child rules are executed. All these rules have been indented under a Simultaneous List Rule.

So far that hasn't been working for me. Any other solutions? Help greatly appreciated! Thanks! :D
 
Variable Check is not an event

The Variable Check Rule does not wait for your variable to reach 4. If it is an independent rule (not indented under any other rule) it will check the variable at the start of the session and then exit. If it is inside a Simultaneous Execution Rule it will check the variable as soon as the 'simultaneous' block is entered, then exit. Your problem is that by the time the player forms the cuts of cars, the Variable Check has long since tested the variable and exited.

If you can be certain that the player will form the cuts of cars in a certain order, you could indent Consist Check rules, one after another, such that the consist checks will be satisfied from leftmost to rightmost. You don't need a variable, you just need to nest all the child rules under the rightmost consist check.
 
The Variable Check Rule does not wait for your variable to reach 4. If it is an independent rule (not indented under any other rule) it will check the variable at the start of the session and then exit. If it is inside a Simultaneous Execution Rule it will check the variable as soon as the 'simultaneous' block is entered, then exit. Your problem is that by the time the player forms the cuts of cars, the Variable Check has long since tested the variable and exited.

If you can be certain that the player will form the cuts of cars in a certain order, you could indent Consist Check rules, one after another, such that the consist checks will be satisfied from leftmost to rightmost. You don't need a variable, you just need to nest all the child rules under the rightmost consist check.

If I use all Consist Check? which list rule should I use to nest all 4 rules under?

Ordered List or Simultaneous List?

By the way as this session's task can be completed in many ways, I can't script a sequence. I have to do it in such a way such that any consist can be completed first but so long as all 4 are completed, regardless of the order of completion, the session continues. So this is how "variable" it can be.

Is there a way to do this. Thanks! :D
 
Last edited:
Order them

Start with an Ordered List. Its first child rule should be a Simultaneous List containing the four Consist Check rules. Set the Simultaneous List to complete only when all of its child rules are complete. Follow the first Simultaneous List with a second one (also inside the Ordered List) containing the rest of the session.

The Ordered List will make the second Simultaneous List (the one containing the rest of the session) wait for the first Simultaneous List to complete. It won't complete until all four consists exist.
 
Start with an Ordered List. Its first child rule should be a Simultaneous List containing the four Consist Check rules. Set the Simultaneous List to complete only when all of its child rules are complete. Follow the first Simultaneous List with a second one (also inside the Ordered List) containing the rest of the session.

The Ordered List will make the second Simultaneous List (the one containing the rest of the session) wait for the first Simultaneous List to complete. It won't complete until all four consists exist.

Hey I just tried it but the session STILL does not continue. Why?

Could it be because of my consist check rules? I suspect they r the ones that dun complete as the two locos that shunt the cars ain't included in the consist I set in the rule. Should I include them then?

But then again, a player can couple and complete each consist frm either end of the train so I am not sure which end of the train in the Consist Check list should I add in the 2 locomotives.

Any other way? Thks. : )
 
Back
Top