|
TTDPatch Site |
ActionF
Action F - Town namesDefine new town name stylesThis action can be used to define new town name styles for random games and random cities placed in the scenario editor. The data looks as follows: <Sprite-number> * <Length> 0F <ID> <stylenames> <num-parts> <parts>...
Style namesThis item is only present if bit 7 is set in the ID. Its contents are in the format: [<langs> <name>]... 00
There can be any number of style names, until a literal "00" terminates the style name definition. If no appliable name is found, "(unnamed style)" will be displayed in the Options window. The language selection works the same as the action 4 language ID, including the difference for grf version 7 and up, however bit 7 is ignored. This means that there is an ambiguity whether a value of "00" is a list terminator, or the ID of the American language. To resolve this, the first style name definition is never a list terminator (starting with 2.5 beta 4). This means that the definition of the American language name must be the first in the list. Alternatively, since bit 7 is ignored, it is valid to use the value "80" for the ID of the American language as well, but putting it first in the list is the preferred way of defining it. PartsThe following fields are repeated for every part (num-parts times): <textcount> <firstbit> <bitcount> [ <probablity> <part/ID> ]...
Every town has 32 random bits for random naming. You can use the <firstbit> field to make the decisions for every part linearly independent, or at least as independent as possible. The minimal number for the <bitcount> field should be the lowest power of 2 that is higher than the sum of all probabilities (e.g. 2 if the sum is <=4, 3 if it's <=8, 4 if <=16 and so on), but allowing more bits can make the distribution of decisions smoother. The following fields are repeated for every text (textcount times) in every part:
That town name styles are special since they have to be available on the title screen as well, where the graphics files aren't activated yet. This means they're processed at the initialization stage only, and can be skipped only by action 9, but doing so will prevent them from working for the rest of the game. The only way to disable a new town name style once it's loaded is to disable the entire GRF file it's situated in (by using the "New GRF status" window or by putting an exclamation mark next to the filename in newgrf(w).txt). A town name generated this way must meet some requirements to be accepted by TTD: it can't be empty (so you don't have to worry even if your chain can generate an empty string), can't be a name that's already given to a town (to avoid duplicate town names), can't be longer than 31 characters and its displayed form can't be wider than 130 pixels. If a generated name doesn't meet all these requirements, TTD tries again with a different random value. For this reason, your town name style must be able to generate at least 70 different acceptable combinations, since this is the maximum number of towns possible on a map, and TTD may deadlock if it can't find different names for every town on the map. The town name style dropdown menu doesn't support more than 19 entries, and since six entries are already reserved for the old styles, only 13 remain for new styles. If there are more than 13 final style definitions available, only the first 13 will be displayed in the dropdown menu, and therefore be selectable. The other definitions will still be available (e.g. they'll show up in games started with them), but cannot be selected from the user interface. If your GRF isn't available while its name style definition is used in a savegame, the town name style reverts back to German, but the towns get both English and German names; they appear in the wrong order in the town list and duplicate town names may appear. However, no data loss occurs, so the correct names are restored as soon as your definition becomes available again. 2 * 52 0F 80 7F "Mars" 00 00 02 02 00 02 03 "Alpha" 00 01 "Beta" 00 03 02 04 01 " Andromedæ" 00 01 " Carinæ" 00 81 01
Notes:
Created by: system last modification: Tuesday 25 of July, 2006 [03:16:49 UTC] by dmccoy |
Login Search
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||