Patch: Autoreplace only old vehicles

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

Post Reply
Gollum
Engineer
Engineer
Posts: 16
Joined: 24 Apr 2008 13:26

Patch: Autoreplace only old vehicles

Post by Gollum »

Well, pardon me if I missed something, but I wasn't entirely satisfied with the way autoreplace & autorenew worked. What I wanted was this kind of behaviour:
1. I set autoreplace for a particular engine, but I really don't want to change ALL (maybe just recently bought) vehicles to the new type.
2. Engines are replaced only when they are old (needing autorenew). This requires autorenew to be on.
3. Vehicle types with no autoreplace set are renewed to the same type (if available) just like autorenew always worked.

Maybe this should be in form of some check box when setting autoreplace "route" but I had no time to get into openttd's gui system yet, so I just made it as a patch option which is saved to the config file.

Works with r12892
autoreplace_only_old1.png
autoreplace_only_old1.png (11.66 KiB) Viewed 4304 times
autoreplace_only_old2.png
autoreplace_only_old2.png (12.03 KiB) Viewed 4305 times
Attachments
autoreplace_only_old_gui_r12892.diff
Autoreplace only old vehicles with GUI.
(16.57 KiB) Downloaded 261 times
Last edited by Gollum on 25 Apr 2008 12:13, edited 1 time in total.
Ar4i
Traffic Manager
Traffic Manager
Posts: 153
Joined: 24 Jul 2006 10:40

Re: Patch: Autoreplace only old vehicles

Post by Ar4i »

Yes especially with those train sets it would be good if you can set autoreplace to replace only the vehicles that are getting old, buthas to get into the GUI somehow because sometimes it also good idea to replace all engines of some type with new ones.
Gollum
Engineer
Engineer
Posts: 16
Joined: 24 Apr 2008 13:26

Re: Patch: Autoreplace only old vehicles

Post by Gollum »

Any ideas for the design?
I don't recall any similar features (tell something to do with conditions) in the game gui...
Well... Ah, there's a switch for wagon removal. Maybe a similar button next to this one will work?
Gollum
Engineer
Engineer
Posts: 16
Joined: 24 Apr 2008 13:26

Re: Patch: Autoreplace only old vehicles

Post by Gollum »

Update: remade as gui option in autoreplace dialog.
WORKS ONLY FOR TRAINS AT THE MOMENT.
sulai
Traffic Manager
Traffic Manager
Posts: 159
Joined: 24 Sep 2004 18:23

Re: Patch: Autoreplace only old vehicles

Post by sulai »

I really like this idea!

I was thinking of a more general idea (with the same goal), using the concept of groups.

What if you could define "property based groups". Just as you can do using this patch: http://www.tt-forums.net/viewtopic.php?f=33&t=36648
You could define a group with old vehicles in there and apply the mass command "replace".

Looking at the ottd code, it's not easy to apply "replace" on those general groups.

Also see http://wiki.openttd.org/index.php/User: ... ehicleList the chapters "propterty based groups" and "changes on autoreplace".
Ar4i
Traffic Manager
Traffic Manager
Posts: 153
Joined: 24 Jul 2006 10:40

Re: Patch: Autoreplace only old vehicles

Post by Ar4i »

BTW This patch is a very good idea to use in conjunction with some trainsets like cnidarian, because you loco's would often get obsolete w/o actually having notably better new locos and thus replacing all your trains is very inefficient, so replacing only the old ones is the best solution at least until the GRF starts handling this by itself and forces the autoreplace to choose some new engine automatically.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Google [Bot] and 18 guests