Page 1 of 4

How many tiles does this need?

Posted: 11 Nov 2005 09:30
by webfreakz.nl
When building large stations for example (bigger than 7x7) you have to count how big is your station before you place it (like 10x8). What about something like this?

Posted: 11 Nov 2005 10:13
by bobingabout
i like it :P

Posted: 11 Nov 2005 10:15
by webfreakz.nl
bobingabout wrote:i like it :P
great :D

In the picture, it is only one stroke, but It could also be something like:

18x3

and figure out yourself what this will do ;)

Posted: 11 Nov 2005 10:49
by MeusH
You mean some kind of measure tool?
It would be really interesting... mmm

Posted: 11 Nov 2005 11:43
by Brianetta
Nod. I like it.

Posted: 11 Nov 2005 11:52
by Twinsen
Yes, a very usefull tool!
I just think the numbers should be a bit smaller

Posted: 11 Nov 2005 11:54
by Bjarni
I like this idea. It's faster than counting specially if you want say 12x1. It could be made a general measure tool so you can count lengths and call that function for a simple measure (is this 25 or 30 tiles) and by the station building. It could also be used to show length of tunnels when building those. Showing length between signals can be useful too

I hope you wrote a patch instead of using photoshop :wink:

Posted: 11 Nov 2005 12:35
by Smudge
Love it!!

Posted: 11 Nov 2005 13:36
by webfreakz.nl
Bjarni wrote:I like this idea. It's faster than counting specially if you want say 12x1. It could be made a general measure tool so you can count lengths and call that function for a simple measure (is this 25 or 30 tiles) and by the station building. It could also be used to show length of tunnels when building those. Showing length between signals can be useful too

I hope you wrote a patch instead of using photoshop :wink:
It would be handful if this could be done for stations, rails, roads, demolishing, trees(????), canals and so on....


I didn't write a patch, and I didn't use photoshop :P Used Macromedia Fireworks 8 instead 8)

If you could tell me how I could code this.... I will try... but can't guarantee I can get something to work :P



edit:

I was checking some source code, but do I need to edit this file?
viewport.c:
line: 2089
function:

void VpSelectTilesWithMethod(int x, int y, int method)

??

Or should we discuss this on IM?

Posted: 11 Nov 2005 14:20
by belugas
That is a pretty good idea...

One thing though : When building a station, one could enable the drag and drop.. no need to count the tiles, then. In fact, that is what i do (when I can play...)

But, as Bjarni said, it could be helpfull in other situations

Posted: 11 Nov 2005 14:23
by webfreakz.nl
belugas wrote:That is a pretty good idea...

One thing though : When building a station, one could enable the drag and drop.. no need to count the tiles, then. In fact, that is what i do (when I can play...)

But, as Bjarni said, it could be helpfull in other situations
What do you mean?

Posted: 11 Nov 2005 14:40
by belugas
webfreakz.nl wrote:What do you mean?
Simple... Look at the picture 8)

Posted: 11 Nov 2005 14:49
by Mek
belugas wrote:That is a pretty good idea...

One thing though : When building a station, one could enable the drag and drop.. no need to count the tiles, then. In fact, that is what i do (when I can play...)

But, as Bjarni said, it could be helpfull in other situations
especially when building stations it could be helpfull, especially when using drag&drop. I always hate it having to count how many tiles i'm dragging, to get the exact number of tracks i want.

Posted: 11 Nov 2005 14:50
by Brianetta
belugas, that's missing the point somewhat. Say you have a standard platform length of, let's say, 12 squares. This is to match the length of your trains (22 carriages with 2 locos each). You want to be able to consistently drag'n'drop 12 square long platforms. Any shorter, and your load times rocket. Any longer, and you waste space (and slow trains down, if you enable the speed limits).

With drag and drop, that means you have to count squares on the screen whilst holding the mouse and dragging. What webfreakz is suggesting is a tooltip that tells you how large your station is before you let go.

Posted: 11 Nov 2005 15:02
by belugas
You have a point Brianetta.
It's just that, when I have to create a station for a particular lenght of train, usually, I'll pick the highest platform length (7), just one as width and build that part of the station. Afterward, I'll change the length of th next station block to the correct train length ( say 24 wagons long = 12 tiles -7 = 5 more to go), build another station block.
And finally, a drag and drop for the final station format. Therefore, I never counted the tiles...

I agree, my method is a bit tedious. And I agree (now faced with other ways of thinking) that tile counter could be usefull, even for stations.
I will take a look at the code as soon as I can...

Posted: 11 Nov 2005 17:03
by MeusH
I'm almost done with this patch, altough there is one more thing:
How can I create string of other string and integer?
In php it would be

Code: Select all

$str = 'Text '.$int.'; Other text '.$int2;
but how to do it in C?

Posted: 11 Nov 2005 17:05
by webfreakz.nl
belugas wrote:You have a point Brianetta.
It's just that, when I have to create a station for a particular lenght of train, usually, I'll pick the highest platform length (7), just one as width and build that part of the station. Afterward, I'll change the length of th next station block to the correct train length ( say 24 wagons long = 12 tiles -7 = 5 more to go), build another station block.
And finally, a drag and drop for the final station format. Therefore, I never counted the tiles...

I agree, my method is a bit tedious. And I agree (now faced with other ways of thinking) that tile counter could be usefull, even for stations.
I will take a look at the code as soon as I can...
I still don't get what explained in your previous post, but never mind ;) I understand this one (in the quote).

I know I can do it the way you describe in the quote, but it is just double work, and as time==money .... :lol:

Posted: 11 Nov 2005 17:18
by webfreakz.nl
MeusH wrote:I'm almost done with this patch, altough there is one more thing:
How can I create string of other string and integer?
In php it would be

Code: Select all

$str = 'Text '.$int.'; Other text '.$int2;
but how to do it in C?
no in PHP this would be:

Code: Select all

<?
$str = 'Text' .$int. 'Other text' .$int2;
?>
(Yes i do how to program in PHP rather than in C !!)

---here was some text, never mind :P ---

Posted: 11 Nov 2005 17:24
by belugas
MeusH wrote:I'm almost done with this patch, altough there is one more thing:
How can I create string of other string and integer?
In php it would be

Code: Select all

$str = 'Text '.$int.'; Other text '.$int2;
but how to do it in C?
I could be wrong, but I think there is a function in strings.c that you would find interesting :

Code: Select all

static char *FormatNoCommaNumber(char *buff, int32 number)
An example of use (in same C file) would look like

Code: Select all

return FormatNoCommaNumber(buff+4, ymd.year + MAX_YEAR_BEGIN_REAL);

Posted: 11 Nov 2005 17:49
by Shooshpanchick
MeusH wrote:I'm almost done with this patch, altough there is one more thing:
How can I create string of other string and integer?
In php it would be

Code: Select all

$str = 'Text '.$int.'; Other text '.$int2;
but how to do it in C?

Code: Select all

sprintf(str, "Text %d; Other text %d;", int1, int2);