Page 1 of 2

Custom Buildings

Posted: 16 Apr 2012 17:39
by PaulC
A while back I coded a quickie grf to make tropical buildings appear in temperate climate, and it was suggested that I expand the grf to allow for more possibilities. Well, I've gone and done just that. :)

"Custom Buildings" contains no shiny new graphics and by default doesn't really do much, but has a number of parameters which allow you to choose which building set you want to use in each climate and to optionally disable certain buildings. Some temperate houses have been modified to accept food, but otherwise no building properties have been changed. If used in arctic climate, temperate and tropical buildings will not have snow above the snow line.

I'm posting here because it's still very much a WIP and there are more things that I would like to add, but it's fully usable in both OTTD and TTDP, with original or OGFX graphics. In fact it actually works best with OGFX because those graphics are a bit less climate specific. Comments, crits and suggestions are all welcome!

Known issues: If using arctic buildings in arctic climate with churches turned off, churches will still appear above the snowline as "shops and offices". I've reported this as an OTTD bug (FS#5148).

EDIT: Should anyone be interested in providing a translation, the relevant lines of code are in the attached text file:
english.txt
(2.42 KiB) Downloaded 331 times
UPDATE: Latest version is v0.1b and can be downloaded here.

Re: Custom Buildings

Posted: 16 Apr 2012 17:47
by supermop
Why, why would anyone want to disable the capsule tower? My heart aches just thinking about it. I'd prefer the disable options to be 'no' and 'hell no' for that option.

Re: Custom Buildings

Posted: 16 Apr 2012 18:14
by PaulC
supermop wrote:Why, why would anyone want to disable the capsule tower? My heart aches just thinking about it. I'd prefer the disable options to be 'no' and 'hell no' for that option.
Well, whatever floats your boast. :) As a distinctive, real-world Japanese building it doesn't really fit into any climate, but then I guess there's also something quintessentially TT about it as well.

Re: Custom Buildings

Posted: 16 Apr 2012 20:05
by supermop
Seeing that building in TT in 94 is part of what inspired me to study architecture!

I can however see people's desire to limit the 'futuristic' buildings,

Re: Custom Buildings

Posted: 16 Apr 2012 20:31
by Hyronymus
Looks like a fun grf so to say. Does it support multiple languages?

Will it be possible to load buildings from more than one climates into one climate by the way?

Re: Custom Buildings

Posted: 16 Apr 2012 21:42
by PaulC
Hyronymus wrote:Looks like a fun grf so to say. Does it support multiple languages?
Do you mean for the parameters? I can add them if anyone feels like doing the translations.
Hyronymus wrote:Will it be possible to load buildings from more than one climates into one climate by the way?
It would be easy enough to code, but I'm not sure how useful such a "mash-up" would be. I have thought about a "more buildings per climate" option though, which would be similar but more selective.

Re: Custom Buildings

Posted: 17 Apr 2012 05:50
by Transportman
Looks like a nice NewGRF. I agree with the suggestion of Hyronymus to have multiple climate buildings in a game.

Another suggestion I have is to make the boolean parameters the other way around. So default on and remove disable from the strings (and make the changes also in the code to reflect that :p). Now on means disable and off means enable, in the new situation it would be on means enable and off means disable. That seems more logical to me.

Re: Custom Buildings

Posted: 17 Apr 2012 10:11
by zooks
This grf does exactly what I was thinking about for a while. Nice one!

Re: Custom Buildings

Posted: 17 Apr 2012 10:49
by Hyronymus
PaulC wrote:
Hyronymus wrote:Looks like a fun grf so to say. Does it support multiple languages?
Do you mean for the parameters? I can add them if anyone feels like doing the translations.
Hyronymus wrote:Will it be possible to load buildings from more than one climates into one climate by the way?
It would be easy enough to code, but I'm not sure how useful such a "mash-up" would be. I have thought about a "more buildings per climate" option though, which would be similar but more selective.
I was asking because if you coded it in NML it's fairly easy to provide different languages. And you can write me down for Dutch then.

If it's posible to allow multiple climate buildings in one climate then I think you should, of only to make cities far more varied.

Re: Custom Buildings

Posted: 17 Apr 2012 11:02
by FooBar
In NFO it's not too hard to provide translations either. It's just more work on the one who has to implement them (translations have to be merged into the code with NFO, unlike NML where you can rely on the translator to provide a working language file).

Re: Custom Buildings

Posted: 17 Apr 2012 12:12
by PaulC
Transportman wrote:Another suggestion I have is to make the boolean parameters the other way around. So default on and remove disable from the strings (and make the changes also in the code to reflect that :p). Now on means disable and off means enable, in the new situation it would be on means enable and off means disable. That seems more logical to me.
If I remove "Disable" from those strings it would be less obvious what those parameters are for. I kinda get what you're saying, but it's not a change I'm likely to make I'm afraid.
Hyronymus wrote:I was asking because if you coded it in NML it's fairly easy to provide different languages. And you can write me down for Dutch then.
I've actually coded in nfo, but as FooBar says that doesn't really make your job any harder. These are the relevant lines of code if you or anyone else is still interested:

(EDIT: Code removed - see first post instead.)
Hyronymus wrote:If it's posible to allow multiple climate buildings in one climate then I think you should, of only to make cities far more varied.
Well, I'll see. :) I still think it needs to be done a bit more intelligently though, I'm not convinced that this mix of houses is a good look...

Re: Custom Buildings

Posted: 17 Apr 2012 13:27
by Transportman
PaulC wrote:
Transportman wrote:Another suggestion I have is to make the boolean parameters the other way around. So default on and remove disable from the strings (and make the changes also in the code to reflect that :p). Now on means disable and off means enable, in the new situation it would be on means enable and off means disable. That seems more logical to me.
If I remove "Disable" from those strings it would be less obvious what those parameters are for. I kinda get what you're saying, but it's not a change I'm likely to make I'm afraid.
Maybe change "Disable" to "Enable" or "Allow"?

Re: Custom Buildings

Posted: 17 Apr 2012 16:12
by Hyronymus
Seeing the screenshot I think the subtropical houses should be left out but the rest doesn't look that bad.

See attachment for the Dutch translation BTW.

Re: Custom Buildings

Posted: 17 Apr 2012 17:41
by PaulC
Thanks Hyronymus! Dutch translation now included in v0.1a...

Re: Custom Buildings

Posted: 17 Apr 2012 18:00
by planetmaker
German (though the names of the office buildings will need translations; I'm not 100% sure currently which those are without looking it up and I don't find the names in OpenTTD's English language file):

Code: Select all

  3 * 106    14 "C" "INFO" "C" "PARA" "C" d0 "T" "NAME" 7F "Gemäßigtes Klima" 00 "T" "DESC" 7F "Wähle, welches Häuserset für das gemäßigte Klima gewählt werden soll." 00 00 00 00 00
    4 * 108    14 "C" "INFO" "C" "PARA" "C" d1 "T" "NAME" 7F "Sub-arktisches Klima" 00 "T" "DESC" 7F "Wähle, welches Häuserset für das sub-arktische Klima gewählt werden soll." 00 00 00 00 00
    5 * 112    14 "C" "INFO" "C" "PARA" "C" d2 "T" "NAME" 7F "Sub-tropisches Klima" 00 "T" "DESC" 7F "Wähle, welches Häuserset für das tropische Klima gewählt werden soll." 00 00 00 00 00
    6 * 95    14 "C" "INFO" "C" "PARA" "C" d3 "T" "NAME" 7F "Keine Kirchen" 00 "T" "DESC" 7F "Kirchen werden nicht gebaut  (IDs #03, 3C, 3D und 53)." 00 00 00 00 00
    7 * 119    14 "C" "INFO" "C" "PARA" "C" d4 "T" "NAME" 7F "Keine Statuen, Brunnen und Parks" 00 "T" "DESC" 7F "Statuen, Brunnen und Parks werden nicht gebaut (IDs #09-0C)." 00 00 00 00 00
    8 * 120    14 "C" "INFO" "C" "PARA" "C" d5 "T" "NAME" 7F "Kein Bürogebäude'capsule'" 00 "T" "DESC" 7F "Das Bürogebäude 'capsule' wird nicht gebaut (ID #11)." 00 00 00 00 00
    9 * 99    14 "C" "INFO" "C" "PARA" "C" d6 "T" "NAME" 7F "Kein altes Stadion" 00 "T" "DESC" 7F "Das alte Stadion wird nicht gebaut (ID #14-17)." 00 00 00 00 00
   10 * 105    14 "C" "INFO" "C" "PARA" "C" d7 "T" "NAME" 7F "Kein modernes Stadion" 00 "T" "DESC" 7F "Das moderne Stadion wird nicht gebaut (ID #20-23)." 00 00 00 00 00
   11 * 116    14 "C" "INFO" "C" "PARA" "C" d8 "T" "NAME" 7F "Kein Bürogebäude 'vertical tube'" 00 "T" "DESC" 7F "Keine Bürogebäude 'vertical tube' wird gebaut (ID #24)." 00 00 00 00 00

   30 * 120    14 "C" "INFO" "C" "PARA" "C"  d0 "C" "VALU" "T" d0 7F "Häuser vom gemäßigten Klima" 00 "T" d1 7F "Häuser vom sub-arktischem Klima" 00 "T" d2 7F "Häuser vom tropischen Klima" 00 00 00 00 00 00
   31 * 120    14 "C" "INFO" "C" "PARA" "C"  d1 "C" "VALU" "T" d0 7F "Häuser vom gemäßigten Klima" 00 "T" d1 7F "Häuser vom sub-arktischem Klima" 00 "T" d2 7F "Häuser vom tropischen Klima" 00 00 00 00 00 00
   32 * 120    14 "C" "INFO" "C" "PARA" "C"  d2 "C" "VALU" "T" d0 7F "Häuser vom gemäßigten Klima" 00 "T" d1 7F "Häuser vom sub-arktischem Klima" 00 "T" d2 7F "Häuser vom tropischen Klima" 00 00 00 00 00 00

   33 * 206    08 07 "PC" 10 11 "Nutzerspezifische Häuser v0.1" 00 98 "Beschreibung: " 89 "Erlaubt mehr Kontrolle über die Standardhäuser mit der Möglichkeit die Häuser einzelner Klimata zu wählen und einzelne Gebäude zu deaktivieren." 0D 98 "Programm von: " 89 "PaulC" 00

Re: Custom Buildings

Posted: 17 Apr 2012 18:06
by Hyronymus
I left the office buildings untranslated too, for the same reason :).

Re: Custom Buildings

Posted: 17 Apr 2012 18:25
by PaulC
Thanks for the translation PM! :)

Building id#11 is called "Modern office building" in the game, #24 is just called "Offices". I used "capsule" and "vertical tube" to make it more obvious which buildings those parameters are for, so feel free to translate them however you want.

Re: Custom Buildings

Posted: 17 Apr 2012 18:31
by Hyronymus
PaulC wrote:Thanks for the translation PM! :)

Building id#11 is called "Modern office building" in the game, #24 is just called "Offices". I used "capsule" and "vertical tube" to make it more obvious which buildings those parameters are for, so feel free to translate them however you want.
Perhaps an idea to add a galery on the wiki with all the default buidlings in OpenTTD and their default cargo acceptance values. Then you can "link" to it.

Re: Custom Buildings

Posted: 17 Apr 2012 19:03
by planetmaker
It could also go into the existing list as found in the NewGRF wiki: http://newgrf-specs.tt-wiki.net/wiki/DefaultHouseProps though adding the sprite numbers would probably go already go a long way: http://mz.openttdcoop.org/opengfx/newgr ... =2033:2091 (edite sprite numbers in URL)

Re: Custom Buildings

Posted: 18 Apr 2012 03:02
by PaulC
Hyronymus and planetmaker wrote:...
I can see how such an illustrated list would be useful on the wiki, though I wouldn't want to use that for the action 14 URL, if that's what you meant. When the grf is more "finished" it will link to a proper release topic or perhaps it's own wiki page, but that's for the future... :)

For the here and now is another update (v0.1b) containing planetmaker's German translation: