Help with triggers

cpufo123

New member
Help with triggers pls. (Trainz 2009)

I have 3 trains (T1 to T3).
Each train moves on a different track
Each train navigates to a different mark (M1 to M3) where it activates its own trigger (R1 to R3)

so T1 goes to M1 and fires R1
.
.
T3 goes to M3 and fires R3

Trains arrive at different times.

Another train T999 MUST WAIT until ALL 3 trains arrive and their marks and activates their triggers.
Only then T999 can move.

I tried trigger check as follows:

check for R1 (wait for... is checked)
-------- check for R2 (wait for... is checked)
---------------- check for R3 (wait for... is checked)

so child of R1 is R2, child of R2 is R3

and T999 waits for trigger for R1

This doesn't work!
e.g: if order of arrival is
T3, then T1, then T2

then T999 start to move when T1 arrives (without waiting for T2)

How to arrange so that T999 waits for all 3 trains (can be more than 3 trains)

TIA
 
Just a tip: Learn what you can before getting too far involved.

Video Tutorials may just answer a lot of your questions,... https://www.twitch.tv/trainz_simulator

Triggers is # 8

Cheers,
Roy

PS: Also you may get more responses if you Register your Trainz program. ( See Register above, next to Helpdesk)
 
What I would do in that situation is

1. set up a variable - lets call it "score" (because I am too lazy to change the default variable name) and give it a value of 0. Use the Variable Modify Rule for this.
2. set up 3 Trigger Check Rules for R1, R2 and R3. Each rule has a single child rule that adds 1 to the value stored in "score". Again use the Variable Modify Rule for this.
3. test the value stored in "score". If it is equal to 3 then execute a child rule to give train 999 its schedule.

Trigger_Rule_Example.jpg


Because all the trigger rules are at the parent level, it does not matter which order they are triggered. The last rule will only be triggered when the value of "score" reaches 3. It might be a good idea to reset score back to 0 after Train 999 has been given its schedule.

PS. I have not tested this on an actual layout but the theory is sound :)
PPS: I did not see that you are using Trainz 2009, the above screenshot was in TANE but I think it might still work.
PPPS: It might be a good idea to register your TS2009 copy. The Register link is at the top of this page.
 
Last edited:
I would use post message and wait for message and clear driver commands.
T1 Drive to M1
T1 Post message driver 1
T2 Drive to M2
T2 Post message driver 2
T3 Drive to M3
T3 Post message driver 3

T999 Wait for message and clear driver 1
T999 Wait for message and clear driver 2
T999 Wait for message and clear driver 3

It does mot matter which order the trains arrive as the message will sit in the message box until a train clears it. If T3 came in first it cant clear the message until T2 and T1 have arrived and posted.
 
Back
Top