Hi, it's me again with Trainz simulator 2009.
To start of this thread, Ill explain to you what I mean by an if command.
I need an if command to check a particular consist is somewhere (For example, a particular locomotive at a named trigger, doesn't matter what the trigger or locomotive is named.)
If the locomotive isn't at the trigger, then a child rule will execute, if the locomotive is at the trigger, another rule will execute.
The New Coal Vale station layout
The new layout looks like http://img718.imageshack.us/img718/7877/ben1337201004150000.jpg.
The yard is a simple exchange yard.
The yard was made out of the coal vale tutorial map for my own working.
The Basic operations of the yard
Locomotives (that are hauling freight of a type) and multiple units (Carrying passengers) come in from the bottom right track.
Passenger multiple units take the very bottom line into the light blue shaded track (known as the line running beside the station platform), load passengers, change direction and exit the yard on the same line it came into the yard.
Freight trains are the reason I need an if rule (but Ill explain why that is later).
You see, if the freight locomotives have a break van, they exit on the same line as the multiple unit, go onto the center line (I call that line and the loop, the run around loop) run around the train (By taking the line 2 lines above the station platform line to run around the train), uncouple the break van, run around the train to the siding on the west siding of the run around loop, go to the east siding of the run around loop and wait for the local shunter to take away the train and change it with a new rake of wagons.
The shunther wants to get rid of the new inbound train as fast as it can, so it dumps the inbound wagons in a siding next to the lower dark green line (the diesel unloading line for the coal mine basic industry, known as the inbound train line), uncouple the new wagons, couple up to the wagons sitting in the outbound wagons (the line above the inbound line), take them to the run around loop, uncouple the wagons and run around to the new inbound wagons and if they're loaded tanker wagons full of diesel it will unload the diesel at the diesel unloading line and run them to the outbound line, if they're coal trucks though, the shunter would take them to the coal bays (the other 4 dark green lines) and get them loaded up and take them to the out bound line.
But while this is happening the new freight locomotive would couple to thenew wagons, and then couple up to the break can (if provided by the inbound train) and then run it out of the yard.
You see, the shunter wants to get rid of the new locomotive as fast as it can, so the only way to do that is to change the new wagons with wagons which have been waiting in the siding as quickly as possible and then when the wagons are changed and the locomotive is departing, it can fiddle around with the new wagons until another train arrives.
Why I need the if rule
As I said before, the if rule checks if something is within the consist.
All of the trains will be AI driven, so no human interaction is to be used for helping trains get around and shunting.
So, in the aspect of the scenario I have put, I need it to check if there's a break van on the train, so if there's no break van, the locomotive can decouple from the train and go straight to the east siding and wait for its wagons.
But that's not it, the shunter needs to know if there's already some wagons in the in siding to couple the new in-bound wagons to.
The shunter needs to know if there's any wagons on the out-bound siding too to couple some more out-bound wagons to.
Where you come in.
So, I'm wondering if there's a simple way of making the AI check if there's a certain piece of rolling stock somewhere in a layout and making the shunter shunt without any flaws.
If you have any questions, feel free to ask.
To start of this thread, Ill explain to you what I mean by an if command.
I need an if command to check a particular consist is somewhere (For example, a particular locomotive at a named trigger, doesn't matter what the trigger or locomotive is named.)
If the locomotive isn't at the trigger, then a child rule will execute, if the locomotive is at the trigger, another rule will execute.
The New Coal Vale station layout
The new layout looks like http://img718.imageshack.us/img718/7877/ben1337201004150000.jpg.
The yard is a simple exchange yard.
The yard was made out of the coal vale tutorial map for my own working.
The Basic operations of the yard
Locomotives (that are hauling freight of a type) and multiple units (Carrying passengers) come in from the bottom right track.
Passenger multiple units take the very bottom line into the light blue shaded track (known as the line running beside the station platform), load passengers, change direction and exit the yard on the same line it came into the yard.
Freight trains are the reason I need an if rule (but Ill explain why that is later).
You see, if the freight locomotives have a break van, they exit on the same line as the multiple unit, go onto the center line (I call that line and the loop, the run around loop) run around the train (By taking the line 2 lines above the station platform line to run around the train), uncouple the break van, run around the train to the siding on the west siding of the run around loop, go to the east siding of the run around loop and wait for the local shunter to take away the train and change it with a new rake of wagons.
The shunther wants to get rid of the new inbound train as fast as it can, so it dumps the inbound wagons in a siding next to the lower dark green line (the diesel unloading line for the coal mine basic industry, known as the inbound train line), uncouple the new wagons, couple up to the wagons sitting in the outbound wagons (the line above the inbound line), take them to the run around loop, uncouple the wagons and run around to the new inbound wagons and if they're loaded tanker wagons full of diesel it will unload the diesel at the diesel unloading line and run them to the outbound line, if they're coal trucks though, the shunter would take them to the coal bays (the other 4 dark green lines) and get them loaded up and take them to the out bound line.
But while this is happening the new freight locomotive would couple to thenew wagons, and then couple up to the break can (if provided by the inbound train) and then run it out of the yard.
You see, the shunter wants to get rid of the new locomotive as fast as it can, so the only way to do that is to change the new wagons with wagons which have been waiting in the siding as quickly as possible and then when the wagons are changed and the locomotive is departing, it can fiddle around with the new wagons until another train arrives.
Why I need the if rule
As I said before, the if rule checks if something is within the consist.
All of the trains will be AI driven, so no human interaction is to be used for helping trains get around and shunting.
So, in the aspect of the scenario I have put, I need it to check if there's a break van on the train, so if there's no break van, the locomotive can decouple from the train and go straight to the east siding and wait for its wagons.
But that's not it, the shunter needs to know if there's already some wagons in the in siding to couple the new in-bound wagons to.
The shunter needs to know if there's any wagons on the out-bound siding too to couple some more out-bound wagons to.
Where you come in.
So, I'm wondering if there's a simple way of making the AI check if there's a certain piece of rolling stock somewhere in a layout and making the shunter shunt without any flaws.

If you have any questions, feel free to ask.