Convert/Upgrade Bridges
Moderator: OpenTTD Developers
Convert/Upgrade Bridges
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
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.
I got it as far as i could say that. i changed it so that you build a new bridge over a existing bridge.peter1138 wrote:What about road bridges? Being able to replace town-owned wooden bridges is quite desirable...
But there is one question that causes a little problem with town owned bridges.
edit: ok found solution

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).

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
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.dtb1322 wrote:What is the status of this patch? Has it been incorporated into 0.5.0-RC4?
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.
Who is online
Users browsing this forum: No registered users and 0 guests