Convert/Upgrade Bridges

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
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Convert/Upgrade Bridges

Post by gigajum »

Yestery evening while i was playing, i had to demolish some bridges and build newer better ones. I thought "hey there's an upgrade/convert button for rail". So i tried to upgrade a bridge, but the game said "cant convert ..." so looked at the code which new to me. After some look around in the code i found the position, and i added the code

The upgrade process is always looking for the best available bridge (only by ascending number not by speedlimit of every bridge since not needed yet)

known bugs:
-Upgrade works only by klicking on the 2 ramps of every bridge. But klicking between these also not works on convert the rail type.
-Upgrade bridge and bridge type needs two upgrade klicks(first to convert type, second upgrades bridge)

Things need to be changed:
If i build a Wooden Bridge and upgrade it, it costs only a few Euros more in comparison with building the better bridge instead of the Wooden Bridge.

I would like to know what you think about this, and if you find any bugs please let me know.

[edit]
removed bug when upgrading bridge and bridge is already best bridge

[edit2] new different handled version http://www.tt-forums.net/viewtopic.php?p=426646#426646
Last edited by gigajum on 06 Apr 2006 14:15, edited 3 times in total.
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1795
Joined: 30 Mar 2005 09:43

Post by peter1138 »

What about road bridges? Being able to replace town-owned wooden bridges is quite desirable...
He's like, some kind of OpenTTD developer.
User avatar
BeSt-Com
Traffic Manager
Traffic Manager
Posts: 181
Joined: 25 May 2005 18:19
Location: Berlin/Germany
Contact:

Post by BeSt-Com »

i think it is a good option.
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

road bridges (include town owned bridges) are a small problem since there is no convert road button. So i have to implemenent this.
But there are other threads about upgrading some things. An extra upgrade Button is a better option to upgrade rail bridges, road bridges, maybe upgrading airports...
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

peter1138 wrote:What about road bridges? Being able to replace town-owned wooden bridges is quite desirable...
I got it as far as i could say that. i changed it so that you build a new bridge over a existing bridge.

But there is one question that causes a little problem with town owned bridges.

edit: ok found solution :)
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

Ok here it is :)

To replace a bridge build a new one over an existing bridge.
- Own bridges can be replaced by any other availabe bridge.
- Town owned bridges can only be replaced with better bridges.
- Competitors bridges cannot be replaced.
- Bridges can only be replaced by same track type (sure issn't it).

Bridges can be replaced while trains or road vehicles drive on it. I tested it and couldn't find any problem. The only thing i found was i bug while demolish a bridge over water while a bus drove over (i clicked on a bridge middle tile. Tested with non debug r4264).
Attachments
upgrade_bridges.diff
patch/diff file
(5.56 KiB) Downloaded 412 times
User avatar
dtb1322
Traffic Manager
Traffic Manager
Posts: 132
Joined: 16 Jan 2007 13:01
Location: New Jersey, USA

Post by dtb1322 »

What is the status of this patch? Has it been incorporated into 0.5.0-RC4?
That's not me, that's my dog. -dtb
User avatar
Maedhros
OpenTTD Developer
OpenTTD Developer
Posts: 603
Joined: 30 Mar 2006 18:24
Location: Durham, UK

Post by Maedhros »

dtb1322 wrote:What is the status of this patch? Has it been incorporated into 0.5.0-RC4?
No, it hasn't. I've updated and changed it a little bit though, and I hope to get it into trunk soon. My version of the patch is attached here for anyone who wants to test it.

Edit: Updated to add a check that the railtype is the same in the bridge being replaced.

Edit 2: Committed to trunk in r8567.
No-one's more important than the earthworm.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Semrush [Bot] and 5 guests