Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Tue Oct 24, 2017 5:50 am

All times are UTC




Post new topic  Reply to topic  [ 54 posts ]  Go to page 1 2 3 Next
Author Message
PostPosted: Sat Nov 15, 2008 4:18 pm 
Offline
Engineer
Engineer

Joined: Thu Feb 08, 2007 11:59 am
Posts: 111
Skype: a.locritani
Location: Italy
Hi. After about a week and with a huge help of Michael Blunk (once again, thanks) , I want to release a simple grf about station's name.
Inspired by this Roujin's patch for OTTD, this grf names a station with the name of nearby industry, where "nearby" means within 3 tiles. It only works with default industries, in all climates.

Attachment:
station_name.png
station_name.png [ 22.89 KiB | Viewed 11836 times ]


it also has a sort of "special feature" (I don't call it a bug :roll: because it's indeed useful)

if the industry you are servicing is in "city A" territory, but the station is in "city B" territory, the station will be named "industry city B", as the city beneficing of transfered cargo (I'm talking of local authority rating improvements, here).
Attachment:
File comment: please note the station authority of the tile where the station is built
station_name_special.png
station_name_special.png [ 41.63 KiB | Viewed 14067 times ]

please note the station authority of the tile where the station is built

Because of this, can be possible to have that situation, where 2 station are servicing the same industry, but they are built in different local authority areas:
Attachment:
station_name_special2.png
station_name_special2.png [ 4.89 KiB | Viewed 11830 times ]

the power station is named "Panley power station"

Positional constraints:

Oil refinery: Near coast (distance configurable; does not apply in scenario editor)
Oilrig: At sea level and far from coast (distance configurable; both do not apply in scenario editor)

Only Arctic:
Forest: above snowline
Farm in arctic. Below snowline.

Only Tropic:
Fruit/rubber plantation: Not in desert
farm/factory: Not in desert
Water supply/tower: Only in desert
Lumbermill: Only in rain forest

Only Toyland
Bubble generator: Only for height <= 4

Please note that, since it's not possible to fully recreate default positional constraints, this constraints are (a bit) different from (OTTD's) original one: in particular now oil refinery can be placed also far from map edge but always near water. the same for oil rigs.
also consider that this new version is not fully tested in TTDPatch.

this grf needs TTD patch version 2.6 alpha 0 r1782 or better.
regarding OTTD, it works starting from revision 14598

Please note that this grf is not intended to be used with another industries' grf - only use it with default industries (thanks Michael for pointing it out)

Please let me know of any problem/strange behavior different from signaled ones.

Feel free to improve this grf, if you want; simply let me know

the actual GRF is in the following post (and now also on BANANAS)

--------------------------------------------
HISTORY:
version 1.1 : added feature to disable oil wells only-decreasing-production behavior on temperate (by SirkoZ)
version 1.2: positional constraints added
version 1.2.1: fixed a issue with farm and industries in tropical climate

PARAMETERS:
#1: 1 oil wells can increase production on temperate climate; 0 normal behavior (default)
#2: max distance from coast for oil refineries (default 16)
#3: min distance from coast for oil rigs (default 16)
Param #3 can be omitted and in this case param #2 is used for both refineries and oil rigs

_________________
Name your station from nearby (standard) industry


Last edited by a.locritani on Thu Mar 11, 2010 6:55 pm, edited 11 times in total.

Top
   
PostPosted: Sat Nov 15, 2008 4:19 pm 
Offline
Engineer
Engineer

Joined: Thu Feb 08, 2007 11:59 am
Posts: 111
Skype: a.locritani
Location: Italy
Attachment:
File comment: v. 1.2.1
station_name.grf [4.88 KiB]
Downloaded 562 times

_________________
Name your station from nearby (standard) industry


Last edited by a.locritani on Thu Mar 11, 2010 6:53 pm, edited 9 times in total.

Top
   
PostPosted: Sat Nov 15, 2008 7:35 pm 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 5105
a.locritani wrote:
[...] Please let me know of any problem/strange behavior [...]

IMO, a major problem would be that you cannot use both your .grf and any other industry .grf simultaneously because it´s not possible to override an already overriden industry.

regards
Michael

_________________
Image


Top
   
PostPosted: Sat Nov 15, 2008 7:50 pm 
Offline
Engineer
Engineer

Joined: Thu Feb 08, 2007 11:59 am
Posts: 111
Skype: a.locritani
Location: Italy
michael blunck wrote:
a.locritani wrote:
[...] Please let me know of any problem/strange behavior [...]

IMO, a major problem would be that you cannot use both your .grf and any other industry .grf simultaneously because it´s not possible to override an already overriden industry.



well, it's true, but I think that who develops another grf about industries can use property 24 to name the station.
in that case you can disable this grf and only use it when playing with default industries.
anyway, now I report you point in first post, thanks!

_________________
Name your station from nearby (standard) industry


Top
   
PostPosted: Sun Nov 16, 2008 7:53 pm 
Offline
Moderator
Moderator
User avatar

Joined: Mon Dec 26, 2005 8:19 pm
Posts: 17047
Location: Harringay, North London
Good effort, I like :)

_________________
Albion: A fictional Britain

Official TT-Dave Fan Club
Dave's Screenshot Thread! - Flickr


Why be a song when you can be a symphony? r is a...


Top
   
PostPosted: Sun Nov 16, 2008 8:14 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Apr 07, 2008 6:29 pm
Posts: 1872
Location: Czech Republic
There was and OpenTTD patch that did exactly this some time ago. A grf is certainly better solution, thank you :)


Top
   
PostPosted: Sun Nov 16, 2008 11:46 pm 
Offline
Moderator
Moderator
User avatar

Joined: Sat Dec 18, 2004 5:35 pm
Posts: 14821
Location: Stockholm, Sweden
A neat feature! I often rename my stations so that I know exactly what they are when looking through orders. Sweet, this'll do it for me :P

_________________
Image
OpenTTD Scenarios:
Archipiélago Hermoso
(Latest Release: Version 3.2)
Turnpike Falls (Latest Release: Version 0.91) 2016-06-23


Top
   
PostPosted: Mon Nov 17, 2008 10:32 am 
Offline
Chief Executive
Chief Executive
User avatar

Joined: Sat Aug 16, 2008 5:51 pm
Posts: 672
Location: Long Eaton, Nottinghamshire. UK
Regarding OTTD; i'm having trouble getting this GRF to work...

I'm using the latest nightly r14583 and when i load the grf i get the following error...

Image

OTTD 0.7.0 is not out yet, is this error caused by the GRF been incompatible with OTTD or is there another problem??

Cheers


Attachments:
File comment: Error
snfni_error1.png [265.74 KiB]
Downloaded 1394 times

_________________
High-Functioning Autistic & Proud... National Autistic Society * Asperger Foundation
My (O)TTD Work...BIGGER DEPOTS (REL.) & SERVICING-STATIONS (WIP) * Advanced DEPOT DESIGNS * SCREENSHOTS
Image
I now work for DE PHOTO - CLICK TO BOOK US TO SHOOT YOUR EVENT! We Shoot Kids with Canons!
Top
   
PostPosted: Mon Nov 17, 2008 10:42 am 
Offline
Engineer
Engineer

Joined: Thu Feb 08, 2007 11:59 am
Posts: 111
Skype: a.locritani
Location: Italy
JacobD88 wrote:
Regarding OTTD; i'm having trouble getting this GRF to work...

quoting from my first post:
Quote:
at the moment this GRF is not compatible with OTTD (because used property is not yet implemented) but if you try to use it on OTTD it will complain telling that you need version 0.7 (this because the implementation of the used property is forecast due 0.7) - the exact revision will be inserted when property is implemented.


I've inserted this error message so that if you try to use it on OTTD you'll be warned that it doesn't work. without this error, you may erroneous believe that it's usable and when not working you may complain.

anyway, thanks for your post: I've now edited the first one in order to better stress this point.

to others, thanks for appreciate my work. It's my first GRF and I'm glad that you like it.

_________________
Name your station from nearby (standard) industry


Last edited by a.locritani on Mon Nov 17, 2008 10:49 am, edited 1 time in total.

Top
   
PostPosted: Mon Nov 17, 2008 10:48 am 
Offline
Chief Executive
Chief Executive
User avatar

Joined: Sat Aug 16, 2008 5:51 pm
Posts: 672
Location: Long Eaton, Nottinghamshire. UK
a.locritani wrote:
JacobD88 wrote:
Regarding OTTD; i'm having trouble getting this GRF to work...

quoting from my first post:
Quote:
at the moment this GRF is not compatible with OTTD (because used property is not yet implemented) but if you try to use it on OTTD it will complain telling that you need version 0.7 (this because the implementation of the used property is forecast due 0.7) - the exact revision will be inserted when property is implemented.


I've inserted this error message so that if you try to use it on OTTD you'll be warned that it doesn't work. without this error, you may erroneous believe that it's usable and when not working you may complain.



Dang! Sorry scanned through readme/1st post at the end so missed that but got the rest about city areas... :| :mrgreen:

_________________
High-Functioning Autistic & Proud... National Autistic Society * Asperger Foundation
My (O)TTD Work...BIGGER DEPOTS (REL.) & SERVICING-STATIONS (WIP) * Advanced DEPOT DESIGNS * SCREENSHOTS
Image
I now work for DE PHOTO - CLICK TO BOOK US TO SHOOT YOUR EVENT! We Shoot Kids with Canons!


Top
   
PostPosted: Mon Nov 17, 2008 2:42 pm 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
Nice effort, congratulations. I am the author of the patch CommanderZ mentioned; I discontinued my patch when it was pointed out to me that this feature exists in the newgrf specs (but is not yet implemented in OpenTTD).

Indeed, it is better to solve this by a newgrf, than with a patch that hardcodes it like mine did. I only wonder if the incompatibility with NewIndustry grfs can be solved somehow.


Oh and on the plus side, now that we have such a nice newgrf (mainly/exclusively) featuring the said newgrf action not yet implemented in OpenTTD, maybe some dev is inspired to go and implement it using this grf as a test case. :)

_________________
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage


Top
   
PostPosted: Mon Nov 17, 2008 2:50 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Nov 30, 2006 8:33 pm
Posts: 2141
Roujin wrote:
I only wonder if the incompatibility with NewIndustry grfs can be solved somehow.


well, with a proper "recipy", it probably will be easy to add this to the NewIndustry NewGrfs for the saied authors... ???

_________________
Member of the
ImageImage


Top
   
PostPosted: Mon Nov 17, 2008 2:55 pm 
Offline
Tycoon
Tycoon

Joined: Thu Dec 20, 2007 12:49 pm
Posts: 3653
Roujin wrote:
Nice effort, congratulations.

I can only agree with that, nice grf :)
Quote:
Oh and on the plus side, now that we have such a nice newgrf (mainly/exclusively) featuring the said newgrf action not yet implemented in OpenTTD, maybe some dev is inspired to go and implement it using this grf as a test case. :)

In fact, I was yesterday: http://bugs.openttd.org/task/1822 . Now waiting for a dev to apply it to trunk.


Top
   
PostPosted: Mon Nov 17, 2008 3:15 pm 
Offline
Engineer
Engineer

Joined: Thu Feb 08, 2007 11:59 am
Posts: 111
Skype: a.locritani
Location: Italy
Roujin wrote:
Nice effort, congratulations. I am the author of the patch CommanderZ mentioned; I discontinued my patch when it was pointed out to me that this feature exists in the newgrf specs (but is not yet implemented in OpenTTD).

Hi, Roujin. As I wrote in my first post, was your patch to inspire me. I've also posted in your patch's topic to signal this GRF.

Roujin wrote:
I only wonder if the incompatibility with NewIndustry grfs can be solved somehow.

as DJ Nekkid (if I don't misunderstood him) said, and as I wrote responding to Michael Blunk, in third post, will be "responsability" of NewIndustries GRF 's authors to implement this property in their grf. this should not be difficult at all.
also, the request to implement property 24 in ottd was originally posted by george, in order to use this property in ECS, so maybe ECS already support this.

Yexo wrote:
In fact, I was yesterday: http://bugs.openttd.org/task/1822 . Now waiting for a dev to apply it to trunk.

oh, Yexo, well done! i'll try your patch this evening, if I have time: I want to see how my grf works on ottd !!!

edit: Yexo's patch tried, it works great. But a not-patch-related problem appears: italian cities' names generator creates long city's names and also italian translations of industries' names are long. So adding the former and the latter, the station's name is too long and is clipped. But this is another problem...

_________________
Name your station from nearby (standard) industry


Last edited by a.locritani on Mon Nov 17, 2008 9:17 pm, edited 1 time in total.

Top
   
PostPosted: Mon Nov 17, 2008 9:14 pm 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
a.locritani wrote:
Hi, Roujin. As I wrote in my first post, was your patch to inspire me. I've also posted in your patch's topic to signal this GRF.

Yes, seeing your post there is how I got into this topic in the first place. I also read your initial post here, but inbetween reading it and posting my answer here I seem to have forgotten that you mentioned me already. Probably because CommanderZ mentioned my patch again without mentioning me :lol: well, nevermind that - by now everyone's informed that I'm the author of that patch. :lol: :lol: (PS: I did _not_ want to advertise my lousy archievements! :shock: )


a.locritani wrote:
as DJ Nekkid (if I don't misunderstood him) said, and as I wrote responding to Michael Blunk, in third post, will be "responsability" of NewIndustries GRF 's authors to implement this property in their grf. this should not be difficult at all.
also, the request to implement property 24 in ottd was originally posted by george, in order to use this property in ECS, so maybe ECS already support this.

He at least needs this for his fishing grounds, as those are currently mislabled as "oil fields". This was already "fixed" with my hack/patch (I only found that out by chance and found it quite amusing), and as soon as this property is implemented, he can fix it itself in his newgrf.

Yexo wrote:
In fact, I was yesterday: http://bugs.openttd.org/task/1822 . Now waiting for a dev to apply it to trunk.

Nice one! Now from reading your code (not applied it yet), it seems to take the industry's town as base for the station name (or am I wrong here), as opposed to how it works in TTDPatch, and with the standard station names. Now the question is what to do - as a.locritani said in his initial post here, he does not regard it as a bug, but as a "special feature", because the service you provide at the station will influence your rating at the station's town, not at the industry's.
This obviously tells us we should do it the way it's done in TTDPatch - however it might also lead to confusion and people complaining about "bugs" like "My station built next to 'Alphaville Sawmill' is called 'Betatown Sawmill'". So what to do?

_________________
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage


Top
   
PostPosted: Mon Nov 17, 2008 9:34 pm 
Offline
Engineer
Engineer

Joined: Thu Feb 08, 2007 11:59 am
Posts: 111
Skype: a.locritani
Location: Italy
Roujin wrote:
Nice one! Now from reading your code (not applied it yet), it seems to take the industry's town as base for the station name (or am I wrong here), as opposed to how it works in TTDPatch, and with the standard station names. Now the question is what to do - as a.locritani said in his initial post here, he does not regard it as a bug, but as a "special feature", because the service you provide at the station will influence your rating at the station's town, not at the industry's.
This obviously tells us we should do it the way it's done in TTDPatch - however it might also lead to confusion and people complaining about "bugs" like "My station built next to 'Alphaville Sawmill' is called 'Betatown Sawmill'". So what to do?


Please consider that also in TTDPatch implementation strange things may happen: for example, if an industry is outside any local authority areas, nearby station is still named from nearest town but nevertheless this town doesn't benefit of any (industry based) local rating increasing. And this is also valid for normal stations (ie: not nearby any industry) outside local authority area, both in OTTD and TTDPatch. So we can have a station named "Town A Heights" but not increasing Town A's local rating nor any other town's local rating. Or am I wrong?

GRF updated: no more errors on loading in ottd < 0.7, but only a warning about the need of Yexo's patch

_________________
Name your station from nearby (standard) industry


Top
   
PostPosted: Mon Nov 17, 2008 9:50 pm 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
Okay, I now tested it and as I have some experiences from my patch, of course I know where the little problems are - I had some nice deja vus of problems I already found back when I made my hack/patch. :P
These problems here are issues with Yexo's patch, not with a.locritani's grf, so this post is directed at Yexo ;)

1)
Building an industry station in e.g. "Tonningville" -> e.g. "Tonningville Iron Ore Mine", then renaming the town to something else results in the station keeping its name "Tonningville Iron Ore Mine". This is opposed to how the standard station names work.

2)
Renaming the nearby town first to something long (something near the maximum length you can enter) results in the station name getting cut off. For example, I renamed "Tonningville" to "Tonningvillestantonviriiili" first, then built the station, resulting in "Tonningvillestantonviriiili I" instead of "Tonningvillestantonviriiili Iron Ore Mine". This is opposed to the standard names again who are written out correctly despite being longer than the maximum user enterable name" (e.g. "Tonningvillestantonviriiili Valley". You can easily see that you can't enter such a long name by hand by clicking the rename button on that station.)

3)
Just for completeness' sake I've tested what I already found by reading your code and indeed the town included in the station's name is the industry's town, not the station's town. Still the question remains what to do here.


---
Oh and here's a note / random find for a.locritani, but I suppose it's neither something one can do anything about, nor does it do any harm: As the query tool ("?") in OpenTTD nowadays displays newgrf related information, it states that the industry I just queried originates from your NewGrf "station's name from nearby industries". This may be correct from some coding point of view since you probably sort of redefined them or so (sorry, I'm not into newgrf), but it's also kind of wrong on the other hand. Maybe you could rename the grf to something like "Default industry station names" (since this grf also only works without any new industry sets).

_________________
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage


Last edited by Roujin on Mon Nov 17, 2008 10:04 pm, edited 1 time in total.

Top
   
PostPosted: Mon Nov 17, 2008 10:00 pm 
Offline
Tycoon
Tycoon

Joined: Thu Dec 20, 2007 12:49 pm
Posts: 3653
Roujin wrote:
Nice one! Now from reading your code (not applied it yet), it seems to take the industry's town as base for the station name (or am I wrong here), as opposed to how it works in TTDPatch, and with the standard station names.

You're right, thanks for pointing it out.
Quote:
Now the question is what to do - as a.locritani said in his initial post here, he does not regard it as a bug, but as a "special feature", because the service you provide at the station will influence your rating at the station's town, not at the industry's.
This obviously tells us we should do it the way it's done in TTDPatch - however it might also lead to confusion and people complaining about "bugs" like "My station built next to 'Alphaville Sawmill' is called 'Betatown Sawmill'". So what to do?

I think the way TTDPatch does it is ok, as that is the same way it happens now. I uploaded a new patch to FS that does fix this.

Note that this grf names the stations exactly the same as the industry but there is no need for that. Someone might create a newgrf that names stations near forests like "TOWN's lumber supply".

Edit:
Roujin wrote:
Okay, I now tested it and as I have some experiences from my patch, of course I know where the little problems are - I had some nice deja vus of problems I already found back when I made my hack/patch. :P
These problems here are issues with Yexo's patch, not with a.locritani's grf, so this post is directed at Yexo ;)

Thanks for testing it :).
Quote:
1) Building an industry station in e.g. "Tonningville" -> e.g. "Tonningville Iron Ore Mine", then renaming the town to something else results in the station keeping its name "Tonningville Iron Ore Mine". This is opposed to how the standard station names work.

That one is impossible to fix with the current approach. how does TTDPatch behave in this case?

Quote:
2)Renaming the nearby town first to something long (something near the maximum length you can enter) results in the station name getting cut off. For example, I renamed "Tonningville" to "Tonningvillestantonviriiili" first, then built the station, resulting in "Tonningvillestantonviriiili I" instead of "Tonningvillestantonviriiili Iron Ore Mine". This is opposed to the standard names again who are written out correctly despite being longer than the maximum user enterable name" (e.g. "Tonningvillestantonviriiili Valley". You can easily see that you can't enter such a long name by hand by clicking the rename button on that station.)

In consider the behavior with default names a bug, instead of what my patch does. It's easy to change it so names are not cut off, but the maximum name length is there for a reason.


Top
   
PostPosted: Mon Nov 17, 2008 10:35 pm 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
Yexo wrote:
Quote:
1) Building an industry station in e.g. "Tonningville" -> e.g. "Tonningville Iron Ore Mine", then renaming the town to something else results in the station keeping its name "Tonningville Iron Ore Mine". This is opposed to how the standard station names work.

That one is impossible to fix with the current approach. how does TTDPatch behave in this case?


Yes, I never managed to fix that in my patch either. Might be possible with a new string though. Dalestan pointed something in that direction out to me here, but I was too unknowledgable of the string system in OpenTTD to make anything out of it back then.
Regarding TTDPatch, I'm also curious about that. Could anyone with a copy to hand test this for us and post his results?

Quote:
Quote:
2)Renaming the nearby town first to something long (something near the maximum length you can enter) results in the station name getting cut off. For example, I renamed "Tonningville" to "Tonningvillestantonviriiili" first, then built the station, resulting in "Tonningvillestantonviriiili I" instead of "Tonningvillestantonviriiili Iron Ore Mine". This is opposed to the standard names again who are written out correctly despite being longer than the maximum user enterable name" (e.g. "Tonningvillestantonviriiili Valley". You can easily see that you can't enter such a long name by hand by clicking the rename button on that station.)

In consider the behavior with default names a bug, instead of what my patch does. It's easy to change it so names are not cut off, but the maximum name length is there for a reason.


Well, maybe it's a soft limit? Like "We don't want the user to be able to type in anything longer than xy (30?) letters, but names put together by OpenTTD itself and/or newGrfs can actually be up to yx (say 63) letters long without any harm"?
We should get an official word on this (devs) before assuming things ;)

_________________
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage


Top
   
PostPosted: Mon Nov 17, 2008 10:48 pm 
Offline
Tycoon
Tycoon

Joined: Thu Dec 20, 2007 12:49 pm
Posts: 3653
Roujin wrote:
Yes, I never managed to fix that in my patch either. Might be possible with a new string though. Dalestan pointed something in that direction out to me here, but I was too unknowledgable of the string system in OpenTTD to make anything out of it back then.

Using such a string will only introduce more problems, like what should happen if the industry closes down?

Quote:
Well, maybe it's a soft limit? Like "We don't want the user to be able to type in anything longer than xy (30?) letters, but names put together by OpenTTD itself and/or newGrfs can actually be up to yx (say 63) letters long without any harm"?
We should get an official word on this (devs) before assuming things ;)

The limit is not about the amount of characters, but about the width (in pixels) of the string. Long labels (so also station names) can cause graphical glitches. I don't know what the exact limit is before glitches can occur, so maybe the current implementation is a bit too strict on the length.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 54 posts ]  Go to page 1 2 3 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2017 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2017.
Hosted by Zernebok Hosting.