Station's name from nearby industry (new version: 1.2.1)
Moderator: Graphics Moderators
-
- Engineer
- Posts: 111
- Joined: 08 Feb 2007 11:59
- Skype: a.locritani
- Location: Italy
Station's name from nearby industry (new version: 1.2.1)
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.
it also has a sort of "special feature" (I don't call it a bug 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). 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: 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
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.
it also has a sort of "special feature" (I don't call it a bug 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). 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: 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
Last edited by a.locritani on 11 Mar 2010 18:55, edited 11 times in total.
-
- Engineer
- Posts: 111
- Joined: 08 Feb 2007 11:59
- Skype: a.locritani
- Location: Italy
Re: Station's name from nearby industry
Last edited by a.locritani on 11 Mar 2010 18:53, edited 9 times in total.
-
- Tycoon
- Posts: 5948
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Station's name from nearby industry
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.a.locritani wrote: [...] Please let me know of any problem/strange behavior [...]
regards
Michael
-
- Engineer
- Posts: 111
- Joined: 08 Feb 2007 11:59
- Skype: a.locritani
- Location: Italy
Re: Station's name from nearby industry
michael blunck wrote: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.a.locritani wrote: [...] Please let me know of any problem/strange behavior [...]
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!
Re: Station's name from nearby industry
Good effort, I like
Official TT-Dave Fan Club
Dave's Screenshot Thread! - Albion: A fictional Britain
Flickr
Why be a song when you can be a symphony? r is a...
Dave's Screenshot Thread! - Albion: A fictional Britain
Flickr
Why be a song when you can be a symphony? r is a...
- CommanderZ
- Tycoon
- Posts: 1872
- Joined: 07 Apr 2008 18:29
- Location: Czech Republic
- Contact:
Re: Station's name from nearby industry
There was and OpenTTD patch that did exactly this some time ago. A grf is certainly better solution, thank you
Re: Station's name from nearby industry
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
My Scenarios:
Archipiélago Hermoso (Latest Release: Version 3.2)
Turnpike Falls (Latest Release: Version 0.91)
- JacobD88
- Chief Executive
- Posts: 708
- Joined: 16 Aug 2008 17:51
- Location: Long Eaton, Nottinghamshire. UK
- Contact:
Re: Station's name from nearby industry
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...
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
I'm using the latest nightly r14583 and when i load the grf i get the following error...
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
-
- Error
- snfni_error1.png (265.74 KiB) Viewed 3078 times
High-Functioning Autistic & Proud... National Autistic Society * Asperger Foundation
My (O)TTD Work...BIGGER DEPOTS (REL.) & SERVICING-STATIONS (WIP) * Advanced DEPOT DESIGNS * SCREENSHOTS
My personal website is occasionally here - sometimes it's just the family site - it's basically a lucky dip
My (O)TTD Work...BIGGER DEPOTS (REL.) & SERVICING-STATIONS (WIP) * Advanced DEPOT DESIGNS * SCREENSHOTS
My personal website is occasionally here - sometimes it's just the family site - it's basically a lucky dip
-
- Engineer
- Posts: 111
- Joined: 08 Feb 2007 11:59
- Skype: a.locritani
- Location: Italy
Re: Station's name from nearby industry
quoting from my first post:JacobD88 wrote:Regarding OTTD; i'm having trouble getting this GRF to work...
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.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.
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.
Last edited by a.locritani on 17 Nov 2008 10:49, edited 1 time in total.
- JacobD88
- Chief Executive
- Posts: 708
- Joined: 16 Aug 2008 17:51
- Location: Long Eaton, Nottinghamshire. UK
- Contact:
Re: Station's name from nearby industry
a.locritani wrote:quoting from my first post:JacobD88 wrote:Regarding OTTD; i'm having trouble getting this GRF to work...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.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.
Dang! Sorry scanned through readme/1st post at the end so missed that but got the rest about city areas...
High-Functioning Autistic & Proud... National Autistic Society * Asperger Foundation
My (O)TTD Work...BIGGER DEPOTS (REL.) & SERVICING-STATIONS (WIP) * Advanced DEPOT DESIGNS * SCREENSHOTS
My personal website is occasionally here - sometimes it's just the family site - it's basically a lucky dip
My (O)TTD Work...BIGGER DEPOTS (REL.) & SERVICING-STATIONS (WIP) * Advanced DEPOT DESIGNS * SCREENSHOTS
My personal website is occasionally here - sometimes it's just the family site - it's basically a lucky dip
Re: Station's name from nearby industry
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.
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.
Re: Station's name from nearby industry
well, with a proper "recipy", it probably will be easy to add this to the NewIndustry NewGrfs for the saied authors... ???Roujin wrote:I only wonder if the incompatibility with NewIndustry grfs can be solved somehow.
Re: Station's name from nearby industry
I can only agree with that, nice grfRoujin wrote:Nice effort, congratulations.
In fact, I was yesterday: http://bugs.openttd.org/task/1822 . Now waiting for a dev to apply it to trunk.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.
-
- Engineer
- Posts: 111
- Joined: 08 Feb 2007 11:59
- Skype: a.locritani
- Location: Italy
Re: Station's name from nearby industry
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: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).
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.Roujin wrote:I only wonder if the incompatibility with NewIndustry grfs can be solved somehow.
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.
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 !!!Yexo wrote:In fact, I was yesterday: http://bugs.openttd.org/task/1822 . Now waiting for a dev to apply it to trunk.
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...
Last edited by a.locritani on 17 Nov 2008 21:17, edited 1 time in total.
Re: Station's name from nearby industry
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 well, nevermind that - by now everyone's informed that I'm the author of that patch. (PS: I did _not_ want to advertise my lousy archievements! )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.
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.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.
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.Yexo wrote:In fact, I was yesterday: http://bugs.openttd.org/task/1822 . Now waiting for a dev to apply it to trunk.
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?
-
- Engineer
- Posts: 111
- Joined: 08 Feb 2007 11:59
- Skype: a.locritani
- Location: Italy
Re: Station's name from nearby industry
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?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?
GRF updated: no more errors on loading in ottd < 0.7, but only a warning about the need of Yexo's patch
Re: Station's name from nearby industry
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.
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).
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).
Last edited by Roujin on 17 Nov 2008 22:04, edited 1 time in total.
Re: Station's name from nearby industry
You're right, thanks for pointing it out.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.
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.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?
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:
Thanks for testing it .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.
These problems here are issues with Yexo's patch, not with a.locritani's grf, so this post is directed at Yexo
That one is impossible to fix with the current approach. how does TTDPatch behave in this case?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.
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.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.)
Re: Station's name from nearby industry
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.Yexo wrote:That one is impossible to fix with the current approach. how does TTDPatch behave in this case?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.
Regarding TTDPatch, I'm also curious about that. Could anyone with a copy to hand test this for us and post his results?
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"?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.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.)
We should get an official word on this (devs) before assuming things
Re: Station's name from nearby industry
Using such a string will only introduce more problems, like what should happen if the industry closes down?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.
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.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
Who is online
Users browsing this forum: Amazon [Bot] and 80 guests