Patch: Less restrictive railroad construction
Moderator: OpenTTD Developers
Patch: Less restrictive railroad construction
Hello, I am somewhat surprised I did not find this patch here or in the suggestion forum, though the thing it fixes pretty annoys me. Tell me if I am wrong.
This patch makes railway construction a bit more tolerant about "Train in the way". It enables you to build/remove/modify track/signals on parallel horizontal/vertical track while the other track is busy. (see attached picture)
Enjoy it.
This patch makes railway construction a bit more tolerant about "Train in the way". It enables you to build/remove/modify track/signals on parallel horizontal/vertical track while the other track is busy. (see attached picture)
Enjoy it.
- Attachments
-
- What it does
- LessRestrictiveRailConstruction.png (10.9 KiB) Viewed 5883 times
-
- LessRestrictiveRailConstruction_ver2_r10908.patch
- The patch: See sticky topics "Howto apply a patch..." and "BuildOTTD"
- (2.63 KiB) Downloaded 122 times
Last edited by frosch on 15 Aug 2007 19:02, edited 1 time in total.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Re: Patch: Less restrictive railroad construction
Excellent. These kinds of patches make me happy. Indeed odd that no-one ever thought about fixing this, because it can get pretty annoying if you have long diagonal railways, and you want to remove road or place signals.
Keep it up!
Keep it up!

"I'm gonna rip his leg off and kick him with it!", Sanjuro, Shogo-MAD
Re: Patch: Less restrictive railroad construction
Nice, although I don't like that use of TileInfo. I'd create a struct just for that, personally. Also, you could use TracksOverlap(v->u.rail.track | trackbits) (where trackbits = TrackToTrackBits(track)) instead of that if statement.
No-one's more important than the earthworm.
-
- Route Supervisor
- Posts: 415
- Joined: 07 Oct 2004 10:05
Re: Patch: Less restrictive railroad construction
Hehe, great patch
I was really waiting for this as it annoyed me too!

Re: Patch: Less restrictive railroad construction
Wow, fast responses.
By the way I am somewhat anxious about the placing/removing signals. I did not find anything that depends on no vehicle being in the way. However while playing I did not encounter any train crashes till now. But it should be more tested.
@Maedhros:
I will fix those things.
By the way I am somewhat anxious about the placing/removing signals. I did not find anything that depends on no vehicle being in the way. However while playing I did not encounter any train crashes till now. But it should be more tested.
@Maedhros:
I will fix those things.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
- RainierWatcher
- Traffic Manager
- Posts: 244
- Joined: 14 Jan 2007 15:10
- Location: West Norfolk, England
Re: Patch: Less restrictive railroad construction
Not exactly the same thing, but would it be possible to extend this patch to allow building of this (or is this a restriction in the map array?):
- Attachments
-
- Trintfingfield Transport, 9th Jan 2010.png (56.79 KiB) Viewed 1179 times
Taken from uncyclopediaWays of Preventing Death:
* Don't breathe air. Seriously. Everyone born before 1870 breathed the substance at some point in their life and every one of them is dead today. A coincidence? I think not.
Re: Patch: Less restrictive railroad construction
If buildonslopes uses the same type of lookup-tables in Patch as it does in Open, it's really quite easy to allow the building. But getting the right graphics drawn is a completely different matter.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Re: Patch: Less restrictive railroad construction
Updated patch in first post with Maedhros suggestions.
@RainierWatcher:
Congratulations, that is exactly what I have been working on for four weeks. Parts of it are already committed, but there are still some sprite-sorting issues. Teaser attached. No, it's not a mock-up.
@RainierWatcher:
Congratulations, that is exactly what I have been working on for four weeks. Parts of it are already committed, but there are still some sprite-sorting issues. Teaser attached. No, it's not a mock-up.

- Attachments
-
- Halftile Foundations Teaser Screenshot
- HalftileFoundationsTeaser.png (89.66 KiB) Viewed 1196 times
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Re: Patch: Less restrictive railroad construction
This was the SINGLE most annoying thing in TTD for me. Thanks for finally fixing that!frosch wrote:Congratulations, that is exactly what I have been working on for four weeks. Parts of it are already committed, but there are still some sprite-sorting issues. Teaser attached. No, it's not a mock-up.
By the way, did you make it so that OTTD always uses the diagonal foundations under diagonal tracks? Those normal zig-zag foundations looked so ugly.
Re: Patch: Less restrictive railroad construction
I forward that. Please do so if its possible.Acerbus wrote:By the way, did you make it so that OTTD always uses the diagonal foundations under diagonal tracks? Those normal zig-zag foundations looked so ugly.
Re: Patch: Less restrictive railroad construction
Also, is it possible to do this:
Highly looking forward to your patch getting included in ChrisIN or trunk.
instead of this:
?Highly looking forward to your patch getting included in ChrisIN or trunk.
- athanasios
- Tycoon
- Posts: 3138
- Joined: 23 Jun 2005 00:09
- Contact:
Re: Patch: Less restrictive railroad construction
Looking forward to play with it. Thank you for your nice patch. 

http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
Re: Patch: Less restrictive railroad construction
Yes, you can see that in the teaser screenshot.Acerbus wrote: By the way, did you make it so that OTTD always uses the diagonal foundations under diagonal tracks? Those normal zig-zag foundations looked so ugly.
By the way: Funny you call it "diagonal foundations". It was my first codename for the project, but later changed it to "halftile foundations" as they are not really diagonal but vertical and horizontal.
Nice idea. I also did not like the zig-zag at the end, but I did not knew a way to remove it without drawing even more foundation-sprites. Thank you for pointing me on this way. I will definitely implement that.Acerbus wrote: Also, is it possible to do this:
###
instead of this:
###
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Re: Patch: Less restrictive railroad construction
Committed in r10922 (I renamed the struct and changed some whitespace, but otherwise it's the same). Thanks! 

No-one's more important than the earthworm.
Re: Patch: Less restrictive railroad construction
Nice, thanks.
Just for the record: Similiar can be done for the convert-rail-tool. It should be allowed to upgrade track if the train on the track/bridge/tunnel/station/road-crossing will stay powered.
Any volunteers?
I will not do it, because it seems to be a lot more work than this patch, and I personally do not play with elrails.
Just for the record: Similiar can be done for the convert-rail-tool. It should be allowed to upgrade track if the train on the track/bridge/tunnel/station/road-crossing will stay powered.
Any volunteers?
I will not do it, because it seems to be a lot more work than this patch, and I personally do not play with elrails.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Re: Patch: Less restrictive railroad construction
just one word: awesome 

Re: Patch: Less restrictive railroad construction
seems someone liked this.. maded it into trunkr10922 maedhros 2007-08-16 15:13:07 +0200 (Thu, 16 Aug 2007) 3 lines
-Codechange: Allow building and removing tracks and signals when there is a
train on a parallel diagonal track that doesn't interact with this one. (frosch)
Re: Patch: Less restrictive railroad construction
yes! several nonexistent hairs on my head would love that patch now 

*<(:-}
-
- Route Supervisor
- Posts: 415
- Joined: 07 Oct 2004 10:05
Re: Patch: Less restrictive railroad construction
great
good my guess was right and I didn't add it to ChrisIN
but now it's time to update ChrisIN anyway with this cool new trunk feature!


Re: Patch: Less restrictive railroad construction
It would be nice if diagonal non-electrified tracks would never show overhead wires - now those squares that are shared with an electrified piece of diagonal track do... (They don't in TTDPatch, though.)
Who is online
Users browsing this forum: No registered users and 7 guests