Distant-join-stations (in trunk)
Moderator: OpenTTD Developers
-
- Chairman
- Posts: 776
- Joined: 20 Jan 2007 12:08
- Location: Germany
Re: Distant-join-stations (rev11917)
I just updated the patch to current trunk (r11917).
If I find the time this weekend I might have a look at open issues, i.e. passing station ID instead of the list index (there are indeed enough bits if one reorders a bit), code style, enums, comments. But I can not promise that I'll find the time.
EDIT: Removed old version of patch
If I find the time this weekend I might have a look at open issues, i.e. passing station ID instead of the list index (there are indeed enough bits if one reorders a bit), code style, enums, comments. But I can not promise that I'll find the time.
EDIT: Removed old version of patch
Last edited by PhilSophus on 19 Jan 2008 23:47, edited 1 time in total.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
-
- Chairman
- Posts: 776
- Joined: 20 Jan 2007 12:08
- Location: Germany
Re: Distant-join-stations (rev9840)
Sorry, for double-posting.
I reordered the bits for CmdBuildRailroadStation, and changed the patch so that it always passes the station ID to join in p2 bits 16-31 or INVALID_STATION if no station should be joined. These bits were free for other station types, so no need to distinguish between them anymore.
While I were at it, I found a bug in the patch: When a dock is build the tile passed to PlaceDocks_Dock is not always the one with the lowest coordinate but always the land tile (which might be a different tile). This resulted in the wrong tiles being checked and building a separate station instead of showing the selection window in some cases.
I fixed that by evaluating _thd.pos instead of just taking tile, however I am not sure, why docks are treated differently. For example building railroad with dragging works as expected when using the passed tile.
Please check, if the patch is working for you in both singleplayer and multiplayer.
EDIT: Adapted to current trunk
I reordered the bits for CmdBuildRailroadStation, and changed the patch so that it always passes the station ID to join in p2 bits 16-31 or INVALID_STATION if no station should be joined. These bits were free for other station types, so no need to distinguish between them anymore.
While I were at it, I found a bug in the patch: When a dock is build the tile passed to PlaceDocks_Dock is not always the one with the lowest coordinate but always the land tile (which might be a different tile). This resulted in the wrong tiles being checked and building a separate station instead of showing the selection window in some cases.
I fixed that by evaluating _thd.pos instead of just taking tile, however I am not sure, why docks are treated differently. For example building railroad with dragging works as expected when using the passed tile.
Please check, if the patch is working for you in both singleplayer and multiplayer.
EDIT: Adapted to current trunk
- Attachments
-
- distant_join_stations_r11985.patch
- (23.68 KiB) Downloaded 221 times
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
Re: Distant-join-stations (rev11985)
This needs and update now
Please...

..: Trond :.. because you deserve it! 
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
Re: Distant-join-stations (rev11985)
In what sense does it need an update? Has it stopped compiling against trunk? Otherwise, the main thing we can wish for here is that it might be included in trunk... I'm especially curious whether the developments on the station list ID have taken away what appeared to be the major blocker for inclusion.
Re: Distant-join-stations (rev11985)
I couldnt compile it against trunk earlier today, and that makes me believe it wount go into trunk eather
And I definately want this one in trunk!
Using the update from Gonozal, this is what BOTTD says:

Using the update from Gonozal, this is what BOTTD says:
Code: Select all
patching file `src/airport_gui.cpp'
patching file `src/command_type.h'
patching file `src/dock_gui.cpp'
patching file `src/lang/english.txt'
Hunk #1 succeeded at 1662 (offset 10 lines).
patching file `src/rail_gui.cpp'
Hunk #2 succeeded at 673 (offset 18 lines).
patching file `src/road_gui.cpp'
Hunk #1 succeeded at 203 (offset -1 lines).
Hunk #2 succeeded at 523 (offset 2 lines).
patching file `src/station_cmd.cpp'
Hunk #1 succeeded at 887 (offset -1 lines).
Hunk #3 succeeded at 918 (offset -1 lines).
Hunk #5 succeeded at 1010 (offset -1 lines).
Hunk #7 succeeded at 1333 (offset -1 lines).
Hunk #9 succeeded at 1395 (offset -1 lines).
Hunk #11 succeeded at 1722 (offset -1 lines).
Hunk #13 succeeded at 2030 (offset -1 lines).
patching file `src/station_gui.cpp'
Hunk #1 FAILED at 24.
Hunk #2 succeeded at 1047 (offset 50 lines).
1 out of 2 hunks FAILED -- saving rejects to src/station_gui.cpp.rej
patching file `src/station_gui.h'
patching file `src/variables.h'
patching file `src/viewport.cpp'
Hunk #1 succeeded at 2319 (offset 11 lines).
patching file `src/viewport_type.h'
patching file `src/window_type.h'
Hunk #1 FAILED at 90.
1 out of 1 hunk FAILED -- saving rejects to src/window_type.h.rej
..: Trond :.. because you deserve it! 
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
-
- Transport Coordinator
- Posts: 340
- Joined: 06 Feb 2006 23:58
Re: Distant-join-stations (rev12558)
Here is the patch updated to r12558.
(and nothing else. based on PhilSophus' distant_join_stations_r11985.patch)
(and nothing else. based on PhilSophus' distant_join_stations_r11985.patch)
Last edited by Frostregen on 04 Apr 2008 09:05, edited 2 times in total.
Re: Distant-join-stations (rev12558)
You're on a roll today, thanks a load!!
..: Trond :.. because you deserve it! 
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
Re: Distant-join-stations (rev12558)
Very nice thanks 

Nintendo DS OpenTTD ---- Latest YAPP Patch ---- OpenTTD Wiki ----
---- Transport Tycoon PSX
Australia Scenario V1.0 ---- Luukland's Tasmania Scenario ---- Italy Scenario 0.35 --- Build A Town Patch

Australia Scenario V1.0 ---- Luukland's Tasmania Scenario ---- Italy Scenario 0.35 --- Build A Town Patch
Re: Distant-join-stations (rev12558)
Oh noes, it broke again... probably due to the changes done in r12570... Dare I ask for another update...
..: Trond :.. because you deserve it! 
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
-
- Transport Coordinator
- Posts: 340
- Joined: 06 Feb 2006 23:58
Re: Distant-join-stations (rev12558)
-
- Attachments
-
- distant_join_stations_r12580.diff
- (23.98 KiB) Downloaded 174 times
Re: Distant-join-stations (rev12580)
Thanks again 

..: Trond :.. because you deserve it! 
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
Re: Distant-join-stations (rev12580)
Sorry to be at it again, but trying to build this again r12647 doesnt work
All the changes in the trunk lately makes it really hard to be addicted to some patches 
I hope you can find the time to update it again (to latest trunk), and I surely hope the devs will accept this one to trunk soon...


I hope you can find the time to update it again (to latest trunk), and I surely hope the devs will accept this one to trunk soon...
..: Trond :.. because you deserve it! 
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
Re: Distant-join-stations (rev12580)
Also because, and I hope it won't help to emphasize that, this is a feature that has been in TTDPatch for quite a while, and it would enhance compatibility between the two strands from a user perspective.
Re: Distant-join-stations (rev12580)
Managed to update this myself (!) so here it is for latest trunk at the moment, and I'm still hoping this one will find it's way into trunk...
- Attachments
-
- distant_join_stations_r12684.patch
- (24.22 KiB) Downloaded 238 times
..: Trond :.. because you deserve it! 
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
Re: Distant-join-stations (rev12580)
Good work, Trond!
Re: Distant-join-stations (rev12684)
Why don't you get a station list if you like to build a station next to an other one?
Greets
Ammler
Greets
Ammler
Town Names:


Still work in progress: OpenGFX or/and OpenSFX - Please help!
Re: Distant-join-stations (rev12684)
Not sure I understood your question correctly Ammler, but if I did, try pressing CTRL while building a station.
..: Trond :.. because you deserve it! 
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
Re: Distant-join-stations (rev12684)
Then, it will apear a new station, instead of the list with all available stations in the spread area. (Seems, like it doesn't overwrite adjacent station patch.)Trond wrote:Not sure I understood your question correctly Ammler, but if I did, try pressing CTRL while building a station.
Thanks
Ammler
Town Names:


Still work in progress: OpenGFX or/and OpenSFX - Please help!
-
- Chairman
- Posts: 776
- Joined: 20 Jan 2007 12:08
- Location: Germany
Re: Distant-join-stations (rev12684)
If you build an adjacent station (including diagonal IIRC) the meaning of CTRL is reversed: Without pressing CTRL the existing station is joined, without CTRL a separate station is built. I guess this is intended.Ammler wrote:Then, it will apear a new station, instead of the list with all available stations in the spread area. (Seems, like it doesn't overwrite adjacent station patch.)
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
Re: Distant-join-stations (rev12684)
Build 2 stations
EDIT: Now I think I get it, if you wanne build a station on the tile next to an existing station and hold control, it just builds a new station and dont ask you if you wanne join to an existing station? Imho thats how it should be? I can't say I ever needed to do that?
Build another one while pressing control and you get a third one.
Build another one, inbetween the two, without control and you get a message you cannot do that. I think thats how it's supposed to be...
Ammler: You want to pop up a message asking you wich of the two stations you wanne join?EDIT: Now I think I get it, if you wanne build a station on the tile next to an existing station and hold control, it just builds a new station and dont ask you if you wanne join to an existing station? Imho thats how it should be? I can't say I ever needed to do that?

..: Trond :.. because you deserve it! 
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
Who is online
Users browsing this forum: No registered users and 7 guests