Staggerred Triggering of Triggers

nicky9499

SSoTW Bot
Good day chaps,

I am working on a complex session and have come upon the following scenario:

Train 1 needs to hit Triggers A, B, and C at different times. Triggers A, B and C are all at the same place.

Train 1 supposed hits Trigger A, goes off to do some stuff, comes back and hits Trigger B, goes off again for other stuff, then comes back and hits Trigger C. In that order. Is there a way to do this?

Cheerio,
Nicholas
 
Try putting additional triggers at or near each of the destinations AA, BB, CC. This will give you the sequence you want.

Peter
 
I'm not sure if I understand what you mean, Peter. How will additional triggers help me in sequencing the sequence in which triggers are to be triggered?
 
The way it works is that before trigger B can be actuated, the train must pass trigger AA.

Train goes past A which sends it on the side trip during which it passes trigger AA, only then can it see the next trigger at B which sends it off to BB and so on. The train can only see the next trigger in the sequence, it can't see the others.

Peter
 
Ah, I understand now. At this point I must add, however, that the train is user-driven and these triggers (trackmarks actually, sorry) set the "tower-controlled" switches by virtue of the Setpoints rule. Therefore there are no commands to be added. What I was thinking was along the lines of "make Trigger B wait until Trigger Ax is triggered before becoming active".
 
I think I have the same idea that Narrowgauge has, but lets see:

Instead of having 3 triggers at the same spot, only have 1 trigger.
You set a sequence of actions in the rules, all related to the triggers you have on your route. You use a sequence rule, so all steps have to take place in order.

Example:
In this example, trigger A has replaced all the 3 triggers you have in the same spot!


  1. Trigger A
    • Set junctions 1, 2, 3
  2. Trigger B
    • Show HTML
    • Set junctions 4, 5, 6
  3. Trigger A
    • Set junctions 1, 3, 4
  4. Trigger C
    • Show HTML
  5. Trigger A
    • Set junction 2, 7, 8
 
Hi Onno,

I tried your suggestion which would have worked well...if not for the user train having to trigger the 3 triggers at different times. What is this Sequence Rule you speak of though? Sounds like it might be what I'm after.

So far I have also tried the "Wait for child rules to complete even if no trains are present in the rule triggers" option and arranging my rules like so, assuming the correct order to be triggered is 1-2-3:

> Trigger Check 03
>> Set Junctions
>>>Trigger Check 02
>>>>Set Junctions
>>>>>Trigger Check 01
>>>>>>Set Junctions

Having done this, I notice that Trigger 01 is not activated at all now. So it seems this doesn't work.

All in all, what I would like is for all my Trigger Check rules to simply execute in the order they are presented in Edit Session, regardless of which trigger is activated by any train at any location at any time.
 
What is this Sequence Rule you speak of though? Sounds like it might be what I'm after.
At the moment of writing my previous post I was nowhere near my game PC, so I guessed the correct name. I was wrong. This is the rule I had in mind:
Ordered List,<kuid:-16:2033> (version found in TS12 build 49922; rule build version 2.0)
Ordered List,<kuid:-25:171> (version found in TS12SP1; rule build version 3.6)​
I use it in most (if not all) of my sessions. An example is my "Woodridge logs run".
In my sessions I want things to be check at the moment they become applicable and that's when this rule becomes handy.
 
Last edited:
I think the rule you want to use is Progressive List.

It gets used like this:

Trigger Check
**Progressive List
****First set of actions
****Second set of actions
****Third set of actions

You place one trigger. When the trigger is tripped, it runs Progressive List. The first time Progressive List is started it executes the first item in the list. The second time Progressive List is started, it does the 2nd item, the third time Progressive List is start, it does the 3rd item, etc.

Do you have a copy of the TRS2006 Sessions And Rules PDF? It explains many of these rules.

Todd
 
Thank you Todd, I will try that out. I have 06 but it is not currently installed. Is there an online copy of the pdf somewhere?
 
Progressive List is a step back from everything I've tried so far.
It detects the first rule and does that, but everything else after that does not work.

What did you mean by "the second time Progressive List is started"? Do I need another trigger for this? Do I put another instance of Progressive List? Do I need to indent subsequent rules some more?
 
I can't find an online version anywhere. I checked my TRS2006 DVD and the file isn't listed on the disc, it must be hidden in one of the compressed files on the disc. Contact me and I'll get you a copy.

I haven't used Progressive List, but as I understand you have one trigger. You indent your rules as I listed above. The first time a train passes the trigger, the 1st action is taken. The 2nd time a train passes the trigger, the 2nd action is taken, etc.
Check the options on the trigger rule. There is a an option called "trigger once". If that is checked, the trigger will only trigger the first time a train passes it and not on subsequent times.

Todd
 
You indent your rules as I listed above.

Yes, I have done this.

The first time a train passes the trigger, the 1st action is taken. The 2nd time a train passes the trigger, the 2nd action is taken, etc.

What happens if the train has to trigger these events at different location? Meaning it will not go back to the to the first location to trigger the second rule.

Check the options on the trigger rule. There is a an option called "trigger once".

Yes, it is checked. The problem now is the triggers are not going off twice. They are simply not going off at all.
 
Hi Nicky - Uncheck the "Run Once" check box so the Trigger Check can run multiple times.

In the Trigger Check rule, add more triggers as required.

Any child rules that are run must complete before the next trigger is entered.

Edit:
In a test run I used "Message Pop-up" rules to simulate the required actions. If the resulting pop-up window is not closed then the next trigger will not activate.

Hope this helps.

Trevor
 
Last edited:
Good day Trev,

Firstly apologies to all if I'm taking quite some time to try out suggestions and report back because I have little time for Trainz these days and to be honest this session stuff is tiring, unproductive and borderline annoying.

Actually what I perceived to be the trigger not going off was actually it being triggered, carrying out the instruction...and immediately undoing what it just did.

vai7.png

Where L/R is stated, it will be referring to the direction of the switch when looked at from the facing points.

What should happen:
Player train comes in from the right, crosses the switch, hits trigger, SetJunction throws A to R and B to L.

What actually happens:
Player train comes in from right, crosses the switch, hits the trigger, SetJunction throws A to R and B to L. Half a second later A returns to L position.

The rules are set up simply as:

> Trigger Check (no indent, trigger once only)
>> Set Junctions (1 indent)

What's going on?
 
Hi Nicky - I set up a test route as diagrammed above and the junctions switched as expected. You don't state whether the train is under player control or AI, so I tried both methods.

Are you using TS12 with SP1+HF4? I did find that a session that works perfectly in the base level of TS12 sometimes fails when HF3 or 4 is used; a junction that was set by a scripted asset reverts to its original position at anything up to 4 seconds after being switched. It is not a consistent failure, only happens sometimes.

Are you able to try the route/session in the base TS12 version? If it has been edited in HF4 then it will not be compatible.

Trevor
 
Back
Top