How many tiles does this need?

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

User avatar
webfreakz.nl
Director
Director
Posts: 627
Joined: 11 Aug 2005 08:22
Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
Contact:

How many tiles does this need?

Post 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?
Attachments
openttd_number_tiles.png
openttd_number_tiles.png (32.25 KiB) Viewed 1023 times
# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)
User avatar
bobingabout
Tycoon
Tycoon
Posts: 1850
Joined: 21 May 2005 15:10
Location: Hull, England

Post by bobingabout »

i like it :P
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]
User avatar
webfreakz.nl
Director
Director
Posts: 627
Joined: 11 Aug 2005 08:22
Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
Contact:

Post 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 ;)
# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)
MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

You mean some kind of measure tool?
It would be really interesting... mmm
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2566
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

Nod. I like it.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
User avatar
Twinsen
Engineer
Engineer
Posts: 27
Joined: 15 Jul 2005 12:35
Location: Romania
Contact:

Post by Twinsen »

Yes, a very usefull tool!
I just think the numbers should be a bit smaller
<a href="http://en.prizee.com/?refer=Asafteirobert" target=_blank ><img src="http://en.prizee.com/images-en/promo/fr ... esents.gif" border=0 width=234 height=60 alt="Prizee: Free Games and Presents!" title="Prizee: Free Games and Presents!"></a>
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post 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:
User avatar
Smudge
Engineer
Engineer
Posts: 95
Joined: 31 Jan 2005 12:55
Location: Oostende, Belgium
Contact:

Post by Smudge »

Love it!!
User avatar
webfreakz.nl
Director
Director
Posts: 627
Joined: 11 Aug 2005 08:22
Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
Contact:

Post 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?
# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Post 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
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
User avatar
webfreakz.nl
Director
Director
Posts: 627
Joined: 11 Aug 2005 08:22
Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
Contact:

Post 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?
# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Post by belugas »

webfreakz.nl wrote:What do you mean?
Simple... Look at the picture 8)
Attachments
1 : Click on Drag and Drop Button
<br />2 : Drag the desired station size
<br />3 : Release mouse button.  
<br />4 : enjoy :)
1 : Click on Drag and Drop Button
2 : Drag the desired station size
3 : Release mouse button.
4 : enjoy :)
Unnamed, 19th Jan 1950.png (64.42 KiB) Viewed 5831 times
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
Mek
TTDPatch Developer
TTDPatch Developer
Posts: 417
Joined: 13 Apr 2004 13:35
Location: Eindhoven, Netherlands
Contact:

Post 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.
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2566
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post 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.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Post 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...
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post 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?
Last edited by MeusH on 11 Nov 2005 17:05, edited 1 time in total.
User avatar
webfreakz.nl
Director
Director
Posts: 627
Joined: 11 Aug 2005 08:22
Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
Contact:

Post 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:
# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)
User avatar
webfreakz.nl
Director
Director
Posts: 627
Joined: 11 Aug 2005 08:22
Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
Contact:

Post 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 ---
# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Post 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);
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
Shooshpanchick
Engineer
Engineer
Posts: 8
Joined: 15 Nov 2004 22:58
Contact:

Post 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);
Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: No registered users and 9 guests