[Patch] Stop in depot order [in trunk]

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

[Patch] Stop in depot order [in trunk]

Post by PhilSophus »

This little patch adds a stop in depot order. This might be useful in combination with conditional orders to react to a station stopping acceptance of a cargo (e.g. due to stockpiling in ECS vectors), for example:

1) Go non-stop to A (full load)
2) Go non-stop to B (unload if accepted)
3) If "cargo loaded" = 0 goto order 1 // B did accept our cargo: Restart
4) Go non-stop to depot X (stop) // B did not accept the cargo: stop in depot

Or you could create one-time trips by letting the orders end with an unconditional stop-in-depot.

Stopping in depot still triggers the "train stopped in depot" message to draw the player's attention.

This patch replaces the Service button for depot orders by a drop-down menu allowing you to select among Always Go, Service if needed and Stop. A combination with Refit is possible (I don't know how useful this is, though).
stop_in_depot_order.png
stop_in_depot_order.png (6.56 KiB) Viewed 6594 times
Last edited by PhilSophus on 24 Oct 2008 16:33, edited 8 times in total.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
Serophos
Engineer
Engineer
Posts: 19
Joined: 22 Mar 2008 12:07

Re: [Patch] Stop in depot order [r12932]

Post by Serophos »

Ha, this is cool! I ran into this missing feature two days ago. Hope this makes it's way into the trunk :-)
Nickel_Plate
Traffic Manager
Traffic Manager
Posts: 146
Joined: 27 Dec 2004 19:37
Location: Home of the Big Cat

Re: [Patch] Stop in depot order [r12932]

Post by Nickel_Plate »

This looks interesting i asked for something along these lines before, see thread

http://www.tt-forums.net/viewtopic.php? ... bookmark=1
Nickel_Plate
Traffic Manager
Traffic Manager
Posts: 146
Joined: 27 Dec 2004 19:37
Location: Home of the Big Cat

Re: [Patch] Stop in depot order [r12932]

Post by Nickel_Plate »

Can you upgrade this patch to current nightly.
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: [Patch] Stop in depot order [r13397]

Post by PhilSophus »

Updated patch attached to the top post. Due to lack of time I checked only that it compiles.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: [Patch] Stop in depot order [r14039]

Post by PhilSophus »

And after some time: Another update to current trunk (see top post)
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
dasy2k1
Transport Coordinator
Transport Coordinator
Posts: 344
Joined: 20 Sep 2006 23:43
Location: UK
Contact:

Re: [Patch] Stop in depot order [r14039]

Post by dasy2k1 »

also usefull for cascading engines when you want to moove an old engine you have just replaced to a feeder service the other side of the map and want to send it to the depot that its coaching stock is in
Nickel_Plate
Traffic Manager
Traffic Manager
Posts: 146
Joined: 27 Dec 2004 19:37
Location: Home of the Big Cat

Re: [Patch] Stop in depot order [r14039]

Post by Nickel_Plate »

Update to current nightly please
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: [Patch] Stop in depot order [r14039]

Post by PhilSophus »

Nickel_Plate wrote:Update to current nightly please
Why? The current one applies (with offsets, but that's okay) and compiles cleanly. Does anything not work correctly?
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
Nickel_Plate
Traffic Manager
Traffic Manager
Posts: 146
Joined: 27 Dec 2004 19:37
Location: Home of the Big Cat

Re: [Patch] Stop in depot order [r14039]

Post by Nickel_Plate »

Am compiling with Daylength & Larger Maps, but keep getting "Cannot modify Order" when I try to tell train to stop in depot.
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: [Patch] Stop in depot order [r14192]

Post by PhilSophus »

I can not reproduce this with clean trunk. Nevertheless, I posted a diff to current trunk. Maybe it works better with your modified version.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: [Patch] Stop in depot order [r14192]

Post by Roujin »

I have heard (read: read) some dev say (read: write) that this wouldn't be a useful feature. I have to disagree. This can be a very useful command, and it wouldn't hurt to have it available in my opinion.
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
Eddi
Tycoon
Tycoon
Posts: 8257
Joined: 17 Jan 2007 00:14

Re: [Patch] Stop in depot order [r14192]

Post by Eddi »

i have had a use for this order, where i delivered a PBI steel mill with coal and ore, and the coal supply would overflow every blue moon

so i built a coal train from that stell mill to a power station, and would start it every time i recieved a news about "station xy does not accept coal anymore". the train would then pick up the coal, deliver it to the power station, go back to the steel mill, and stop there for the next time it would be used.

the rare occurance of this overflow did not warrant a "full time" service, so the stopping saved running costs.
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: [Patch] Stop in depot order [r14192]

Post by PhilSophus »

Eddi, isn't that more an application for conditional orders? I usually solve it as follows:
  1. Goto coal mine (full load)
  2. Goto steel mill (unload if accepted)
  3. If load percentage equals 0 goto order 1
  4. Goto power plant
I use the stop in depot order mainly for one-time deliveries of vehicles of the ECS Machinery Vector.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: [Patch] Stop in depot order [r14192]

Post by Roujin »

I would have needed the order when I wanted to send off a group of trains to a specific depot in the network to be stored there, have their orders changed, and then be put into service again on a different route.
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
Eddi
Tycoon
Tycoon
Posts: 8257
Joined: 17 Jan 2007 00:14

Re: [Patch] Stop in depot order [r14192]

Post by Eddi »

PhilSophus wrote:Eddi, isn't that more an application for conditional orders? I usually solve it as follows:
  1. Goto coal mine (full load)
  2. Goto steel mill (unload if accepted)
  3. If load percentage equals 0 goto order 1
  4. Goto power plant
I use the stop in depot order mainly for one-time deliveries of vehicles of the ECS Machinery Vector.
no, that horribly messes up any kind of timetables the coal trains may have, and interrupts the flow for these trains, as the "missing" train cannot carry anymore coal for a while. the single dedicated train is a much more sensible solution, especially since the coal trains not necessarily share orders, as they service different mine-regions.
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: [Patch] Stop in depot order [r14192]

Post by PhilSophus »

Can everybody who uses the patch confirm that the current version is working correctly with clean trunk (I'm asking because of Nickel_Plate's report with a modified version). I haven't that much time for playing ATM as "real timetables" is draining my free time :wink:

If so, I would review the patch for coding style and open a flyspray entry with this patch. The interest now seems to be bigger than it seemed at first.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
Nickel_Plate
Traffic Manager
Traffic Manager
Posts: 146
Joined: 27 Dec 2004 19:37
Location: Home of the Big Cat

Re: [Patch] Stop in depot order [r14192]

Post by Nickel_Plate »

The patch 14192 works OK with rev.14192. It also works with my modified version of Larger Maps & Daylength having started again and recompiled.
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: [Patch] Stop in depot order [r14192]

Post by PhilSophus »

Good to hear. Stop-in-depot shouldn't interfere with Larger Maps or Daylength from my understanding what these patches do.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: [Patch] Stop in depot order [r14192]

Post by Tekky »

In the more conditional orders patch forum thread, I proposed that this patch be merged with the "stop in depot order" patch, because these two patches fit together perfectly, since the stop in depot order is only useful with conditional orders.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Bing [Bot] and 20 guests