The replace dialog did not even fit the screen in the starting size of simutrans. This should be fixed, since resizing also does not work properly. Also the actions by the buttons are completely incomprehensive.

I don't quite understand this first paragraph, prissi. Do you mean that the dialog is too big? In what way it doesn't resize properly? Making it bigger, smaller? Please be more specific. Your last sentences is also incomprehensive for me. Can you rewrite, please?

Even more, it would make more sense to have this as a line tool. As part of convoi it does not really make sense, because a single convoi is easily replace manually (Send to depot => window pop up => replace: same effort as before, schedule is kept)

I don't agree with this. If I want to replace a single convoy, I have to only do an action and then forget. It's all automatic. With your example, the vehicle can arrive at the depot some time after and even you may just have forgotten what to do with it (two actions separate in time, more micromanagement). Even for replacing a full line, it is more comfortable this way: click on any of the vehicles of the line, then replace. The other way, you have to look for the line, then find a suitable vehicle there, then replace. Not much a difference.

The text on the buttons gives not hint what is funtion actually is. Especially what replace cycle options do is completely incomperhensive, and what is the difference between replace all and replace all in the line? Also there is the info missing how how the current convoi carriers and how long station is needs. Otherwise things will be really messy in the end.

The dialog does not fit the screen if you just start simutrans. The resize and some text is outside the actual screen (Just start pak64 and click on a ship). Resizing will allow to have some text outside of the windows.

The UI desgin is pretty messy imho, with lots of empty space. Maybe just put all text and options concerning replacing right of the main "depot" window.

And the drop down menu should cycle, I think there was an option for that, otherwise I need to add it.

And at least wernimans version never replaced a convoi, since never everybody got off the train.

The UI desgin is pretty messy imho, with lots of empty space. Maybe just put all text and options concerning replacing right of the main "depot" window.

I agree with prissi - also placing the convoice centered does not really fit the simutrans gui, where convois are always orientated at the left. I like prissi's idea of an extended depot window very much, but maybe just but both convois (old an new) in one line.

Concerning the line-tool discussion: It's surely faster to have it as a convoi dialog, but it breaks with the way simutrans usually handles this.On the other hand it wouldn't be very handy as line tool, because there might be different convois on the same line and maybe you want to replace convois on more than one line ...One always has the problem of selecting the "old" (to be replaced) convoi, if it's not a convoi tool ...

The text on the buttons gives not hint what is funtion actually is. Especially what replace cycle options do is completely incomperhensive, and what is the difference between replace all and replace all in the line? Also there is the info missing how how the current convoi carriers and how long station is needs. Otherwise things will be really messy in the end.

Prissi, consider that this is a working approximation to test functionality, not a final polished version. If this is to come into trunk, some refinements should be done, but I need to know in advance. Otherwise, it is not worth the effort. I hope you understand.

To the replace cycle, a hint can be to gray it out unless "replace line" or "replace all" is selected. This, together with a good help window may serve. What do you think?

"replace all in line" is as incomprehensible as "show all", "all" what? That's the tooltip for. In the latter, it says: "Also show vehicles that can't be used for the selected action". In the former, I wrote "Replace all convoys like this belonging to this line"

You're right. Some important info is missing, but the problem is that it can clutter things up. Where to put number of convoys and station length of all convoy? Under the image? I'll try it, together with z9999 ideas about cost and number of matching convoys.

The dialog does not fit the screen if you just start simutrans. The resize and some text is outside the actual screen (Just start pak64 and click on a ship). Resizing will allow to have some text outside of the windows.

The UI desgin is pretty messy imho, with lots of empty space. Maybe just put all text and options concerning replacing right of the main "depot" window.

And the drop down menu should cycle, I think there was an option for that, otherwise I need to add it.

And at least wernimans version never replaced a convoi, since never everybody got off the train.

Yes. Locations should be reworked. The main problem I face is the info of vehicles. That empty space in the middle of the window is no good at all. Ideas? Perhaps move it to the bottom of the window like in the depot window? Will also look at the cycle thing.

@robofish: Thanks for the last comment. I was starting thinking that there was nothing good about the patch... Regarding the center question. At first versions the convoy was at the left, but looked most strange... In one line would be very difficult with present state of convoy assembler.

EDIT: Below is a screen capture with something towards a more depot-like interface. Vehicle count and speed of replaced convoy in shown. Three actions buttons in the middle with explanation tooltips.

@prissi: I've looked at gui_combobox.cc and cycling is not possible in current implementation. Even now I remember that there is an "empty state" (-1) I had to manually remove in my component: } else if(komp == &action_selector) { int selection = p.i; if ( selection < 0 ) { action_selector.set_selection(0); selection=0; }[...]

Thank you for the latest version, which I have been integrating into Simutrans-Experimental.

I have found a bug, however: when the "replace cycle" setting is reduced to 0, I get a "runtime check failure" no. 2 ("stack around the variable 'n' was corrupted"), which points to the final closing brace of the void replace_frame_t::update_data() method in the replace_frame.cc file.

Edit: Another glitch is that when the convoys enter the depot and are replaced, the cost of selling the original vehicle and the cost of buying the new vehicle are so rapidly produced that the floating numbers generated by each operation obscure each other.

Edit: I have noticed that the other bug, the vehicles not automatically being sent to the depot, only seems to occur with rail vehicles, not with road vehicles. I have not tried it with other types yet.

Edit: I have noticed that the other bug, the vehicles not automatically being sent to the depot, only seems to occur with rail vehicles, not with road vehicles. I have not tried it with other types yet.

I hope this isn't misleading, but when I observed that bug it was with a bus. But who knows wether that only occurred in that specific version and not anymore since...

interesting - I had it consistently with rail vehicles, but was consistently able to get road vehicles to work. The next thing to work out is whether this is an issue with the original patch or Simutrans-Experimental...

Edit: Incidentally, a further bug: whenever a replacement operation is completed, it gives the message, "all convoys in line [liNE] replaced", even when one has opted to replace only one convoy or all convoys of one type, rather than all in a line.

James, nice catch! The zero bug should be corrected with this version.

The money issue is not printed by the patch. The depot's buying routine produces it. It happens the same as when in FF mode.

Regarding the last one, can you be more specific and/or attach a savegame with instructions so that I can reproduce?

EDIT: Again, the message is not a bug. Whenever the last replaced vehicle of a line is replaced, the message appear. If not wanted, a flag can be added to the convoy, but I think that rewriting the sentence can be a better option.

thank you for the patch, but I am afraid that it does not fix the problem: the previous behaviour recurs.

Edit: Incidentally, I have modified the text to read, "Replacing vehicles of line (LINE) completed", to avoid confusion.

Edit: Oops - I was getting confused, thinking that you had fixed a different bug. The patch does correctly solve the zero bug. I have uploaded a saved game that reproduces the other two problems here: http://simutrans-germany.com/files/upload/replacing-test.sve . I appreciate that the issue with the text is caused by the depot algorithm, but the reason that the two pieces of text appear so close together is that your replacing algorithm purchases/sells multiple things in quick succession. It would be helpful to modify the code to show the net cost of the entire transaction on a replace cycle.

Regarding then money messages, that's the way ST shows when buying/selling individual vehicles. The same effect happens when you click in the "Sell mode" button. It can be changed, but it is not the objective of the patch.

With this (12+1)th version of the patch, the empty vehicle replacement should have been corrected. Incidentally it's is not a direct bug of the patch. Try, for example, to hit the "withdraw" button of a convoy with one locomotive only: the same behavior. It happens because a convoy with zero capacity is given a 100% loading level. That's reasonable since those convoys shouldn't stop in a station if the line is marked to wait till fully loaded there.

If the patch finally doesn't come to trunk, this should nevertheless be corrected there, imho.

that's odd - my tests haven't found that. find_route works find for ships. It doesn't work for aircraft that are flying, but does work for aircraft on the taxiway or runway. The aircraft issue is not a problem for the replacing system, since the command to go to the depot is not issued until the aircraft is on the ground in any event.

I couldn't get the most recent version to do anything in Tortoise SVN (didn't get the small window), the previous one in this thread patched though. Tortoise threw up some errors as well when I applied the patch, though this is my first time of doing anything like this so I'm probably going wrong somewhere.

More importantly... I know this (or at least something similar) is now in experimental, any chance of it making it into a nightly of standard?

the reason that it won't merge is because there have been vast changes to the code since this patch was originally written. As you note, there is a version of this feature in Experimental (which is somewhat of an enhancement of this version, as it has additional features). I am not aware of any plans to put this into Standard, but I cannot speak for the Standard developers on the subject.

I couldn't get the most recent version to do anything in Tortoise SVN (didn't get the small window), [...]

Patches record changes in the source code of the program. They include the new lines/changes as well as the context (surrounding lines) where those changes are to be applied.

If the code has been changed a lot since the patch was generated, the patch program will not automatically find the suitable context and hence the errors.

Another possibility you have is to apply the patch to the revision from which it was generated (r2456). But note that the game will not have the improvements made since then, savegames may not be compatible (opened) by an up-to-date version, etc.