If rule problem

Ben1337

Trainz operator
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.
 
Hi

I have an interest in doing something similar to this. At the moment I have a Merry-go-round system running between a power station and a coalmine. There is a reception yard at each facility with 3 tracks and an incoming train checks which of these tracks is unoccupied and sets a path to it. The trains are held in the reception sidings until the power station or coal mine queue reaches a level where it can unload or load the whole train.

Before being allowed out onto the mainlines the MGR checks to see if an express is due. If it is, it waits until it has passed, and then follows it along the mainline. Half way along the main line are passing loops and when the MGR approaches them it again checks to see if an express is due. If one is due, the MGR will enter the passing loop and wait until the express has passed. The expresses run approx every 20 minutes with a + or - 3 minutes random variation built in which means each time the session is run the timings are different.

I have all this working at the moment by using the SCS2006 rule to program the session. Each siding has a Yes/No variable allocated to it which is used to indicate whether a siding is occupied or empty and there is an "If" command which checks which siding is empty and then sets the appropriate path to it. Each MGR train has an integer variable set to the appropriate siding number that it enters so that it knows which path to set when leaving the siding.

My next idea is to have reception sidings and departure sidings at each site. The locos will drop the wagons off in one of the reception siding and then go to the departure sidings to pick up a return train. A shunter will come in and take the dropped off wagons to load/unload them and then place them in a vacant departure siding. I haven't quite figured it all out yet but I am confident that it can be done. This is very similar to what you are wanting to do.

By using the variables in this rule combined with the "If" and "Goto" statements plus a bit of imagination there are many things that can be simulated. There is a steep learning curve with this rule and it needs a lot of perseverance to get to grips with it but if total automation is your goal then it is definately worth looking at. As I use this rule exclusively I don't know if these things can be achieved using the ordinary AI commands but it seems to me that it could be one solution for what you are looking to do.

If you need further information about any of this just post back.

Regards

Brian
 
Hey, thanks for the top on using the SCS2006 rule, Ill try to get to grips with it.

I think it might just be what I'm looking for.

I think Ill post a post back after I've come to grips and rate on how well it does.
 
I think that SCS2006 can do the job stated above perfectly, but when I created this thread, I didn't expect to get a stand-alone rule that operates with nothing except its self (Which, now I look at what the SCS stands for more closely, seems a bit obvious about what it does and what it's designed to do).

I don't think that a scenario creation system is right for me because it doesn't posses the ability to accept trains coming from a portal or going into any portals.

Is there an addition to the auran's session/activity system which does in the first post?
 
Last edited:
Hi again

SCS2006 doesn't need portals as you add and delete consists at trackmarks. Consists can be randomised so each time the scenario runs the make up of the consist is different. I have scenarios made for the Carlisle area of the SnC add on which use the working timetable for the Carlisle area and use the random consist command to produce different make ups of freight trains with various loco classes at the head of them. Passenger trains usually have the same make up of coaches but I randomise the loco at the head of the train each time the scenario runs. It helps to stop the scenario becoming boring. I also use return loops to hold such trains as locals which may run 2 or 3 times during the length of the scenario.

Regards

Brian
 
Yeah, I know SCS2006 doesn't need portals (I read (pounced red) the manual), but to be honest, I'm making the route as a whole (I'm only focusing on the coal vale route on this thread, but there are two more parts to it which I'm making as well.) as an Iportal route so that I can share trains with other people over the net.

The Route will include Banks Heath and Rosworth vale as well as the 2 more parts, which makes the route pretty extensive to run by myself. So most of the route has to be run by AI.

The I portal will be placed on rosworth vale (another section of the route, which leads to why I didn't mention this sooner).
 
Last edited:
Hi

I've just had a look at the DLS for rules and there is one called Session Variables by MiZi - kuid2:122381:10015:1 which has a compare function as part of it. It is for 2004 so I don't know if it will work in 2009 but if it does it may be what you are looking for. I have never used it but to do what you want to do will probably require a considerable number of variables to hold data for the AI to decide what to do next. Hopefully this rule can do what you need.

SCS2006 is a great tool but it's main drawback is that you usually have to modify an existing route quite extensively, or design a route specially for its use, to get the best from it. As route building doesn't interest me I tend to alter existing routes which then makes the route unique to myself. Now that you have explained fully what you want to do, this rule probably isn't what you need.

Regards

Brian
 
Sounds like what I'm looking for to me.

I think Ill keep SCS2006 for when I want to create some scenarios for my route.

Thank you kennilworth for helping me.
 
Back
Top