Distant-join-stations (in trunk)

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

User avatar
ColdIce
Transport Coordinator
Transport Coordinator
Posts: 306
Joined: 25 Apr 2006 10:22
Location: Bucharest

Post by ColdIce »

It doesn`t ! When I release the mouse it just building the station! Firt I build a station without holdin CTRL, then lets say on 5 tiles away I want to build another station I press CRTL, drag the station and instead of that pop-up it just planting the station!
Attachments
Finham Transport, 16 Sep 1994.png
(233.61 KiB) Downloaded 437 times
The rest is confetti!
User avatar
ColdIce
Transport Coordinator
Transport Coordinator
Posts: 306
Joined: 25 Apr 2006 10:22
Location: Bucharest

Post by ColdIce »

Found the problem! :lol: Is not CTRL key ! Is ALT key ! :shock:
The rest is confetti!
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

Yeah, if i remember correctly:
In mini-in, ctrl was for "separate" stations, so you could build 2 stations adjacent.
MJS
Director
Director
Posts: 540
Joined: 28 Jul 2005 09:31

Post by MJS »

Frostregen, is the 'distant stations'-part of this patch still in development? Now that the adjacent stations have been taken care of, it'd be nice to see the other half in as well :-)
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

It is finished...
Needs an update to current trunk though...
MJS
Director
Director
Posts: 540
Joined: 28 Jul 2005 09:31

Post by MJS »

Finished in the sense that it works as a patch - but not that it will be taken into the trunk, apparently. Which would be nice - although I really appreciate the current rush forward in both Ottd and the Patch, it's always nice if the basic features of the two keep up with one another, so that non-expert users can easily make the switch...

Besides, I believe Kaan's wonderful Ottd-builder allows for only one diff at a time in the process, and I already wanted something else in...
chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Post by chrissicom »

Awesome waited for this for a long time :D there are a few conflicts with r10916 but that's only because other things have been added as well so it shouldn't take too long to resolve those conflicts.
chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Post by chrissicom »

Ok, doesn't seem so easy because I get the following error:

In command.h the following is added

Code: Select all

Index: src/command.h
===================================================================
--- src/command.h	(revision 9840)
+++ src/command.h	(working copy)
@@ -200,6 +200,14 @@
 int32 DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc);
 bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, uint32 cmd);
 
+typedef struct CommandContainer {
+	TileIndex tile;
+	uint32 p1;
+	uint32 p2;
+	CommandCallback *callback;
+	uint32 cmd;
+};
+
 #ifdef ENABLE_NETWORK
When I try to compile this in MSVC I get:
error C2220: warning treated as error - no 'object' file generated
warning C4091: 'typedef' : ignored on left of 'CommandContainer' when no variable is declared

I also just noticed this error:
2>..\src\station_cmd.cpp(1428) : error C2065: 'distant_join' : undeclared identifier
2>..\src\station_cmd.cpp(1431) : error C2065: 'joinStationIndex' : undeclared identifier

I don't know why I get this error, it seems well defined and there were no errors applying the .diff file with TortoiseSVN.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

The offending code reads, once all the stuff unrelated to the error is removed

Code: Select all

typedef struct CommandContainer;
Remove the typedef, or use it to define a type.
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
chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Post by chrissicom »

Removing typedef from the line fixes the error but I still have another error which I couldn't resolve yet. As far as I can see it is definded properly with the lines the patch adds.

Code: Select all

2>..\src\station_cmd.cpp(1428) : error C2065: 'distant_join' : undeclared identifier 
2>..\src\station_cmd.cpp(1431) : error C2065: 'joinStationIndex' : undeclared identifier 
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

You may check if the included headers have changed, so it is not visible within this file anymore.
Either include the header in question again, or move the variable declaration to variables.h. (Which should be included anyway)
BamBam
Engineer
Engineer
Posts: 34
Joined: 06 May 2007 17:49

Post by BamBam »

Here's an update to work with the current (10230) trunk.

Regards,
BamBam
Attachments
distant_join_stations_r10230.7z
Win32 executable
(906.43 KiB) Downloaded 183 times
distant_join_stations_r10230.patch
(23.46 KiB) Downloaded 218 times
chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Post by chrissicom »

BamBam wrote:Here's an update to work with the current (10230) trunk.

Regards,
BamBam
Great work, this works perfectly :) also on 10232 *g*
MJS
Director
Director
Posts: 540
Joined: 28 Jul 2005 09:31

Re: Distant-join-stations (rev9840)

Post by MJS »

Now, this wonderful patch is performing splendidly in ChrisIN, I believe (but then again people would never send bug reports to me, so how could I tell if it didn't?). Does anyone know whether the coding style of this patch is up to standard for inclusion in trunk?
User avatar
Maedhros
OpenTTD Developer
OpenTTD Developer
Posts: 603
Joined: 30 Mar 2006 18:24
Location: Durham, UK

Re: Distant-join-stations (rev9840)

Post by Maedhros »

I think this patch goes about things the wrong way. Building a list, and hoping it will be the same on the client and the server from the time the command is issued to the time it is executed is asking for trouble, imho. (Also comments like "Do not laugh :)" don't inspire too much confidence ;).)

The way I would do this would be to pass the selected station ID directly to the command. It'll take some re-ordering of p1 and p2, but I think there's still space for it.
No-one's more important than the earthworm.
chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Re: Distant-join-stations (rev9840)

Post by chrissicom »

Although the patch works usually really well, there are sometimes little bugs (very seldom) that you are asked wether you'd like to join your station with opponents stations (which results in an error message when you click one of the stations).

Also the station catchment area is either painted wrongfully with the righclick show station catchment patch or it is not working properly. See screenshot.
Attachments
catchment%20area%20bug.png
(939.16 KiB) Downloaded 199 times
vanOekelen
Engineer
Engineer
Posts: 28
Joined: 18 Jun 2007 19:06

Re: Distant-join-stations (rev9840)

Post by vanOekelen »

chrissicom wrote:Although the patch works usually really well, there are sometimes little bugs (very seldom) that you are asked wether you'd like to join your station with opponents stations (which results in an error message when you click one of the stations).

Also the station catchment area is either painted wrongfully with the righclick show station catchment patch or it is not working properly. See screenshot.
As far as I know that catchment area is correctly, the station catchment area is only determined by the two most outher station tiles in a rectangle, so the total catchment area should also always be a rectangle.

See also: http://www.tt-forums.net/viewtopic.php?f=33&t=31797
User avatar
Maedhros
OpenTTD Developer
OpenTTD Developer
Posts: 603
Joined: 30 Mar 2006 18:24
Location: Durham, UK

Re: Distant-join-stations (rev9840)

Post by Maedhros »

chrissicom wrote:Although the patch works usually really well, there are sometimes little bugs (very seldom) that you are asked wether you'd like to join your station with opponents stations (which results in an error message when you click one of the stations).
Which is why building a list and hoping no-one else will change it before it gets used is not a good idea. ;)
No-one's more important than the earthworm.
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Re: Distant-join-stations (rev9840)

Post by Frostregen »

Maedhros wrote:
chrissicom wrote:Although the patch works usually really well, there are sometimes little bugs (very seldom) that you are asked wether you'd like to join your station with opponents stations (which results in an error message when you click one of the stations).
Which is why building a list and hoping no-one else will change it before it gets used is not a good idea. ;)
If i remember right, the only way this list could change while you are viewing it,
is by a coop-player in multiplayer.
Other companies stations should never get into the list,
thus cannot modify the list.
(if opponents stations show up in the list, it is a bug ;))

btw, if anyone wants to take over, or make a new version, just do it...
i'm busy with keeping copy&paste up to date
MJS
Director
Director
Posts: 540
Joined: 28 Jul 2005 09:31

Re: Distant-join-stations (rev9840)

Post by MJS »

Does it currently include a last check after the user has chosen a station with which he wants to join? In coop playing, that would be the moment to check whether the chosen station still exists, and return to the choice screen if it doesn't. Or can anyone confirm the rumour that non-coop opponent's stations appear in the list? Otherwise, this seems a rather likely candidate to go into trunk, seeing how it would increase compatibility with Patch.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 49 guests