News:

Simutrans Sites
Know our official sites. Find tools and resources for Simutrans.

Clone vehicle button

Started by valten, June 02, 2013, 06:40:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

valten

It would be nice to have a "Clone" button in the vehicle detail window that would create a clone of the current vehicle (same composition + same schedule/line) in the nearest depot and start it automatically.

Thanks!


Ters

Nearest depot may not actually be the one you want, so I fear this is a mind-reading exercise. Last time something like this was up, it ended up as a proposal to stop having depots and instead spawn vehicles at first waypoint, but so far, that is considered too radical.

valten

Nearest depot supporting this type of vehicle would be good enough for me. It is the responsibility of the player to check the depot before using the button or choose not to use this feature at all.



Ters

What is good for you might not be good for somebody else. The nearest depot might not even be connected to the route used by the vehicle. And should the vehicle start at the beginning of the schedule or at the cloned vehicle's current position? If the former it would be better that the vehicle started at the depot closest to that position. The wanted behaviour likely depends on the type of vehicle. A bus can normally start anywhere in its schedule and still fill up at once, while freight vehicles usually only load at their first stop, so starting them at any other point would waste money. For trains, having them start at the wrong depot at the wrong time can actually cause a dead-lock. You might understand this and not push the button when the vehicle is at an unfortunate position, but somewhere sometime someone else certainly would not.

I therefore fear that this feature would be too unpredictable, even worse than the choose signals. It has been suggested that it should be possible to copy a consist and then paste it in a depot. This sounds a lot safer, as it allows the player to choose the correct depot and do final adjustments, which eliminates the risk of the game doing something other than the player expected, while still saving a lot of work finding the correct vehicle(s) and schedule. However no one has volunteered to code this yet. The same is the case with a method of locating depots easier.

jamespetts

Quote from: Ters on June 03, 2013, 04:51:30 AM
What is good for you might not be good for somebody else. The nearest depot might not even be connected to the route used by the vehicle.

In principle, of course, the depot search could just use the find_route() method backwards from the current position and spawn the vehicle in the first depot found; that way, the closest depot in route distance would be selected. That would not solve the schedule issue, however (although using the cloned vehicle's current stop as the starting stop would probably work as intended most of the time).
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

valten

Thanks all, for your inputs.

When i said nearest depot, i was thinking about the same depot as when you press the "go to nearest depot" button, this means that the code exists already. As for the starting point in the schedule, it should be the same as when you assign a line in the depot window, this reuses also existing code so should not be that difficult to implement.





Ters

I'm just worried that such a thing would end up causing complaints because it wasn't doing what the player wanted, just like for choose signals. Personally, I'd like to be able to tune the schedule before the vehicle starts, and exacty when it starts. Without that, it's pretty useless to me. I might even have to stop a few other vehicles in order to give the new vehicle a clear path out of the depot.

Fabio

clone button could copy the vehicle into the nearest depot as mentioned above and open the depot dialog. here you can edit it and press start.

valten

Thank you Fabio, this is more click more than what i had in mind, but i can live with it.




neroden

Quote from: Fabio on June 05, 2013, 04:51:08 PM
clone button could copy the vehicle into the nearest depot as mentioned above and open the depot dialog. here you can edit it and press start.
I think this is probably the best way to do it.  I would use that.  I might be able to implement this for experimental actually, I've been working with both the "go to depot" code and the vehicle copying code recently.

kierongreen

When I've thought about this I've imagined pressing control-c when a vehicle window is open then control-v in a depot window to build it there. Obviously could have some buttons around as well but they'd clutter interface...

Ters

We at least need a button for copying. Ctrl+c without having anything selected is not normal behaviour. A helpful feature that players can't find isn't very helpful either.

valten

Quote from: neroden on August 01, 2013, 05:11:50 AM
I might be able to implement this for experimental actually, I've been working with both the "go to depot" code and the vehicle copying code recently.

Great! Just let me know if you need a beta (or alpha) tester!

valten

Quote from: Ters on August 01, 2013, 08:08:49 AM
We at least need a button for copying.

What about adding a "clone" button near the "retire" button in the vehicle detail window?

Max-Max

Wouldn't it be logical that a clone appear in the same depot as the "original" departured from?
- My code doesn't have bugs. It develops random features...

Fabio

I'm afraid the original depot is not saved, so it has to be the nearest.

Ters

That was what was requested. The "original" depot might actually be far away, especially for players like me that reassign vehicles across the map.

prissi

The home depot is sve, but may not exist any more, or may be not connected to the network in present. Thus a full depot search is needed.