Order skip if train is empty

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Post Reply
Andre9999
Engineer
Engineer
Posts: 4
Joined: 20 Apr 2020 03:20

Order skip if train is empty

Post by Andre9999 »

Hello to everyone,
I would like to ask for advice in situation as follows..
I am playing with JPP 1.27 with ECS.
I am delivering cereals from farm to brewery. Unfortunatelly many months in a year brewery does not accept cereals, so I wanted to create conditional order to deliver cereals to bulk terminal as a plan B when not accepted by brewery.
But simple conditional order (if does not accept this cargo) does not work like it supposed for me in case when brewery accepts delivered cargo.
It looks like below.
My train loads cereals from farm, unloads it in brewery and then goes empty to bulk terminal. (this is in case when brewery DO accept cereals). I wish my train would return to farm, because in this situation the train is empty and going
to bulk terminal is pointless.
Is there an appropriate conditional order which does the trick? I mean my train wouldl skip order which tells him to go to bulk terminal and would return to farm for the next load of cereals.
Here you have my orders (only schema)
1. go to depot ( I do not want train to look for depot i the worst possible moment so I include this order to my list.)
2. go to Farm (full load)
3. Jump to 5 if the next station does not accept cargo
4. go to Brewery (unload all)
5. go to Bulk Terminal (unload all)
I think it should be the second conditional order between 4 and 5, but I can not figure out which one if the one is possible.

And finally another problem.
I decided to attach to cars for fertilizer to the train because brewery produces it and this is booster for farm production. I would like to avoid building the next train only for this purpose.
User avatar
odisseus
Director
Director
Posts: 568
Joined: 01 Nov 2017 21:19

Re: Order skip if train is empty

Post by odisseus »

You can configure the order jump to happen if the load percentage is equal to 0. This seems to match your goal perfectly.

For the case with attached fertilizer wagons, you should calculate the load percentage in the event when your train unloads at the brewery and receives a full load of fertilizer. For example, if the total capacity of the train is 300 tonnes of cereals and 30 tonnes of fertilizer, you the order jump should happen if the load percentage is less than 10.
Andre9999
Engineer
Engineer
Posts: 4
Joined: 20 Apr 2020 03:20

Re: Order skip if train is empty

Post by Andre9999 »

I think that conditional with load percentage counts only fertilizer loading. If statement above is true than I can imagine situation when cereal is not accepted and only fertilizer is loaded (let say 20 tons which is less than 10%) condition is fullfiled and whole load of cereal return to farm. In other words I think that it will not work as I would expect. In that case we do not want to skip orders we want opposite to made that damned train to go to bulk terminal.
User avatar
odisseus
Director
Director
Posts: 568
Joined: 01 Nov 2017 21:19

Re: Order skip if train is empty

Post by odisseus »

I don't know about the JGR patch, but in standard OpenTTD load percentage is calculated with relation to the total capacity of the train. For example, if your train can take 300 tonnes of cereals and 30 tonnes of fertilizer, and it is fully loaded with just cereals, then its load percentage is about 91. Consequently, my suggestion covers the case you have described.

If the train has unloaded the cereals at the brewery, its load percentage will certainly be less than 10, regardless of how much fertilizer it has taken. The condition for the order jump will hold, and the train will return straight to the farm. On the other hand, if the cereals weren't unloaded, the load percentage will be more than 90 — again, regardless of whether any fertilizer was loaded. (I assume that the train has a "full load any cargo" order at the farm.) The jump condition will not hold, and the train will visit the alternative drop point before returning.
Andre9999
Engineer
Engineer
Posts: 4
Joined: 20 Apr 2020 03:20

Re: Order skip if train is empty

Post by Andre9999 »

I will test it later on. As I had written before I do not want to send additional train just for the fertilizer. For me personally is a bit unrealistic. I saw many times that locos often pull various wagons to be more useful. As you see load percentage conditional can be understood in various ways....
Anyway thanks for help.
User avatar
JGR
Tycoon
Tycoon
Posts: 2559
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: Order skip if train is empty

Post by JGR »

odisseus wrote: 21 Apr 2020 03:54 I don't know about the JGR patch, but in standard OpenTTD load percentage is calculated with relation to the total capacity of the train...
I have not changed this.
That said, I have added a separate conditional order for load percentage of specific cargoes.
Ex TTDPatch Coder
Patch Pack, Github
Andre9999
Engineer
Engineer
Posts: 4
Joined: 20 Apr 2020 03:20

Re: Order skip if train is empty

Post by Andre9999 »

Thanks for the reply JGR. I feel convinced now. So it seems I was wrong. Of course I will give it a try tonight and will closely observe the trains' behaviour.
Once again thanks guys.
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: Ahrefs [Bot], reinier and 32 guests