Difference between revisions of "Action4"

From GRFSpecs
Jump to navigationJump to search
(mention extended-byte for first-id more prominently)
 
(34 intermediate revisions by 11 users not shown)
Line 1: Line 1:
  +
==Introduction==
 
  +
Define strings, e.g vehicle, house or industry names
'''''Define vehicle (etc) names or change generic texts'''''
 
 
=Action 4=
 
 
Define vehicle names or change generic texts
 
 
-=Introduction=-
 
   
 
When making new vehicle graphics, you also need to name the new vehicles, or they'll show up with their original name from TTD.
 
When making new vehicle graphics, you also need to name the new vehicles, or they'll show up with their original name from TTD.
  +
However, custom vehicle names assigned by the player in-game (or for TTDPatch also via TTD's vehicle.dat) will always take precendence.
   
In addition, you can change most of TTD's text strings.
+
In TTDPatch you can also use this action to change most of TTD's text strings.
 
Note that changes of vehicles names can be overridden by using TTD's vehicle.dat custom vehicle names.  There is no way to bypass the custom vehicle names, other than turning them off or deleting vehicle.dat.
 
   
  +
== Syntax ==
-=Format=-
 
   
 
The data looks as follows:
 
The data looks as follows:
   
<pre> -+&lt;Sprite-number&gt; * &lt;Length&gt; 04 &lt;feature&gt; &lt;language-id&gt; &lt;num-ent&gt; &lt;offset&gt; &lt;text&gt;+-</pre>
+
&lt;Sprite-number&gt; * &lt;Length&gt; '''04''' &lt;feature&gt; &lt;language-id&gt; &lt;num-ent&gt; &lt;offset&gt; &lt;text&gt;
   
  +
{| |-
||'''Element'''|[[GRFActionsDetailed|'''Size''']]|'''Description'''
 
  +
!Element!![[GRFActionsDetailed|Size]]!!Description
  +
|-
  +
|&lt;Sprite-number&gt;||dec||A sequential sprite number
  +
|-
  +
|&lt;length&gt;||dec||The total number of bytes used in this action.
  +
|-
  +
|04||B||Defines action 04
  +
|-
  +
|&lt;feature&gt;||B||For what type of vehicle/station should this definition be used?
  +
|-
  +
|&lt;language-id&gt;||B||Which of TTD's languages this name is for
  +
|-
  +
|&lt;num-ent&gt;||B||Number of consecutive strings to change
  +
|-
  +
|&lt;offset&gt;||B/B*/W||First ID to change
  +
|-
  +
|&lt;text&gt;||S||New text strings
  +
|}
   
  +
Whether &lt;offset&gt; is a '''BYTE''' (extended byte in openttd for vehicles) or a '''WORD''' is decided by bit 7 of &lt;language-id&gt;, see below.
&lt;Sprite-number&gt;|dec|A sequential sprite number
 
   
  +
== Descriptions ==
&lt;length&gt;|dec|The total number of bytes used in this action.
 
   
  +
=== Sprite-number ===
04|B|Defines action 04
 
 
&lt;feature&gt;|B|For what type of vehicle/station should this definition be used?
 
 
&lt;language-id&gt;|B|Which of TTD's languages this name is for
 
 
&lt;num-ent&gt;|B|Number of consecutive strings to change
 
 
&lt;offset&gt;|B/W|First ID to change
 
 
&lt;text&gt;|S|New text strings||
 
 
Note that &lt;offset&gt; is a '''BYTE''' for feature-specific IDs, but a '''WORD''' for generic text strings.
 
 
-=Filling in the terms=-
 
 
===Sprite-number===
 
   
 
This is just the number you are at.
 
This is just the number you are at.
   
===Length===
+
=== Length ===
   
 
Count the number of bytes in this action.
 
Count the number of bytes in this action.
   
===feature===
+
=== Feature ===
   
This sets the type of feature that you wish to change. Set it to:
+
This sets the type of [[Features|feature]] that you wish to change. Set it to:
   
  +
{|- |
00 for trains
 
  +
!Value!![[Features|Feature]]
 
  +
|-
01 for road vehicles
 
  +
|00||Trains
 
  +
|-
02 for ships
 
  +
|01||Road Vehicles
 
  +
|-
03 for planes
 
  +
|02||Ships
 
  +
|-
04 for stations
 
  +
|03||Aircraft
 
  +
|-
05 for canals
 
  +
|04||Stations
 
  +
|-
06 for bridges
 
  +
|07||Houses
 
  +
|-
07 for houses
 
  +
|0A||Industries
 
  +
|-
0A for industries
 
  +
|0B||Cargos
 
  +
|-
0B for cargos
 
  +
|0D||Airports
 
  +
|-
48 for generic strings (language-id bit 7 set), unless they should only be changed in conjunction with new vehicles/stations/etc., in which case you use the regular feature number above
 
  +
|0F||Objects
 
  +
|-
===language-id===
 
  +
|10||Railtypes
  +
|-
  +
|12||Roadtypes
  +
|-
  +
|13||Tramtypes
  +
|-
  +
|48||Original strings; see [[TextIDs]] for a list of TTD's text IDs.
  +
|}
   
  +
=== language IDs ===
 
The meaning of this byte depends on the GRF version of the .grf file as set in [[Action8#version|action 8]].
 
The meaning of this byte depends on the GRF version of the .grf file as set in [[Action8#version|action 8]].
   
Up to version 6, this is a bit mask of the following bits:
+
{{grfTill|6}} Up to version 6, this is a bit mask of the following bits:
   
  +
{| |-
||Bit|Value|Meaning
 
  +
!Bit!!Value!!Meaning
  +
|-
  +
|0||01||American or "other"
  +
|-
  +
|1||02||English
  +
|-
  +
|2||04||German
  +
|-
  +
|3||08||French
  +
|-
  +
|4||10||Spanish
  +
|-
  +
|7||80||Flag for 16 bit string IDs
  +
|}
   
  +
Add the bits of all languages for which the following strings apply. Bit 7 controls, whether the following string ID consists of 16 or 8 bit. Unknown languages will use the American strings as fallback. Otherwise the string would remain undefined for these languages. To actually define strings for any new language, you must use grf version 7.
0|01|American or &quot;other&quot;
 
   
  +
{{grfFrom|7}} For version 7 and higher, it is a simple language ID from the list below. (This has changed with TTDPatch 2.5 beta 4). Bit 7 has the same meaning as in the earlier versions above.
1|02|English
 
   
  +
In either scheme, you can use the value 7F or FF, respectively, to define strings shown for languages that you do not provide translation for. First set all strings to a default value using this, and later override the language specific ones if they exist.
2|04|German
 
   
  +
Set bit7 (add 0x80 to the languageID as in the table below) in order to use 16 bit string IDs.
3|08|French
 
   
  +
For a list of plural forms see [[StringCodes]]. As the assignment of plural forms to languages is in fact not as fixed as one might expect, the used plural form is defined by each GRF separately for its strings using [[Action0/Global Settings]] property 15.
4|10|Spanish
 
   
  +
{{:language_IDs}}
7|80|Flag for generic strings||
 
   
  +
When translating for a new language, please simply edit the [[language_IDs|language list]] and add the new definition here.
Add the bits of all languages for which the following strings apply. If bit 7 is set, these strings change generic TTD texts instead of specifically the vehicle names. Since TTDPatch now supports languages other than the standard ones, unknown languages will use the American strings as fallback. Otherwise the string would remain undefined for these languages. To actually define strings for any new language, you must use grf version 7.
 
   
  +
=== num-ent ===
For version 7 and higher, it is a simple language ID from the list below. (This has changed with 2.5 beta 4). Bit 7 has the same meaning as in the earlier versions above.
 
 
In either scheme, you can use the value 7F or FF, respectively, to define strings shown for languages that you do not provide translation for. First set all strings to a default value using this, and later override the language specific ones if they exist.
 
 
Currently, the scheme is to use international phone codes as language IDs, unless they're out of range, in which case pick a number vaguely related in some way. Or something else.
 
 
||ID (hex)|Language
 
 
00|American
 
 
01|English
 
 
02|German
 
 
03|French
 
 
04|Spanish
 
 
05|Esperanto
 
 
06|Ido
 
 
07|Russian
 
 
0C|Chinese (Traditional)
 
 
0D|Serbian
 
 
0E|Norwegian (Nynorsk)
 
 
0F|Welsh
 
 
14|Arabic (Egypt)
 
 
15|Czech
 
 
16|Slovak
 
 
18|Bulgarian
 
 
1B|Afrikaans
 
 
1E|Greek
 
 
1F|Dutch
 
 
22|Catalan
 
 
23|Luxembourgish
 
 
24|Hungarian
 
 
26|Macedonian
 
 
27|Italian
 
 
28|Romanian
 
 
29|Icelandic
 
 
2A|Latvian
 
 
2B|Lithuanian
 
 
2C|Slovenian
 
 
2D|Danish
 
 
2E|Swedish
 
 
2F|Norwegian (Bokmal)
 
 
30|Polish
 
 
31|Galician
 
 
32|Frisian
 
 
33|Ukrainian
 
 
34|Estonian
 
 
35|Finnish
 
 
36|Portuguese
 
 
37|Brazilian Portuguese
 
 
38|Croatian
 
 
39|Japanese
 
 
3A|Korean
 
 
3C|Malay
 
 
3E|Turkish
 
 
42|Thai
 
 
54|Vietnamese
 
 
56|Chinese (Simplified)
 
 
5A|Indonesian
 
 
5C|Urdu
 
 
61|Hebrew
 
 
62|Persian
 
 
80|Flag for generic strings (added to language ID)
 
 
7F|any (will be applied no matter what language is active)||
 
 
When translating for a new language, please simply edit this document and add the new definition here.
 
 
===num-ent===
 
   
 
How many consecutive entries to change.
 
How many consecutive entries to change.
   
===offset===
+
=== offset ===
   
 
The ID of the first string to change.
 
The ID of the first string to change.
   
For vehicle IDs (language-id bit 7 is clear), this is a byte value, except for OpenTTD since r13482, where it is an extended byte value.
+
When language-id bit 7 is clear, this is a byte value; For OpenTTD since r13482, where it is an extended byte value for vehicles.
   
For generic text IDs (language-id bit 7 is set), this is a word value in little endian notation, e.g. 8134 becomes 34 81. See [[TextIDs]] for a list of TTD's text IDs (town names are changed with [[ActionF|Action F]] instead).
+
When language-id bit 7 is set, this is a word value in little endian notation, e.g. 8134 becomes 34 81.
   
  +
The 8 bit version is only allowed for vehicles to set their name, in which case the text ID is just the vehicle ID.
In addition, TTDPatch defines the following generic text IDs for this action:
 
  +
To replace original texts, or to define texts for usage in callbacks or properties of vehicles, stations, houses or industries you have to use the 16 bit version. However, town names are changed with [[ActionF|Action F]].
   
  +
For the usable 16 bit text IDs see the table below, resp. for feature 48 see [[TextIDs]].
||ID|Content
 
   
  +
Though these ranges are shared across all features, you should still set the proper feature you are using them for.
C4xx|Set name of station class associated with station ID xx; this is the text above the preview (where otherwise TTD shows &quot;Orientation&quot;)
 
   
  +
{| |-
C5xx|New station names, this changes the text &quot;number of platforms&quot; into the given text when the station with this ID from the current set is selected (i.e. xx=station-id from action 3 and 0)
 
  +
!ID!!Content
  +
|-
  +
|C4xx||Set name of station class associated with station ID xx; this is the text above the preview (where otherwise TTD shows "Orientation")
  +
|-
  +
|C5xx||New station names, this changes the text "number of platforms" into the given text when the station with this ID from the current set is selected (i.e. xx=station-id from action 3 and 0)
  +
|-
  +
|C9xx||Name of the house type of this ID. If both property 12 and this is set, the latest definition is used always. You should prefer setting [[Action0/Houses#Building name ID (12)|property 12]] instead of this, so executables translated with TTD Translator will show the name in the current language. However, if you can't find any suitable old TTD texts, this can be used to specify your custom name. Don't forget to set the same text for all parts of a multi-tile building.
  +
|-
  +
|D0xx||Miscellaneous graphics texts, unique to each .grf file. Used for several callbacks. Some callbacks support IDs up to D3FF.
  +
|-
  +
|D4xx||'''Never use in Action4''', only for displaying textids in range D000-D3FF (grf specific), see [[TextIDs]]
  +
|-
  +
|D8xx
  +
|{{ottd|1.7|rev=r27769}} Useable like DCxx in Action 0 and for inclusion via string codes 0x80 and 0x81.
  +
{{ttdp|}}'''Never use in Action4''', only usable in Action0 features, see [[TextIDs]]
  +
|-
  +
|DCxx||Set miscellaneous persistent GRF texts. Useable in Action 0 and for inclusion via string codes 0x80 and 0x81.
  +
{{ottd|14|ottdrev=gf5394ed2ef}} This area extends up to textid FFFF.
   
  +
{{ttdp|}} Unlike the D0xx GRF texts, these IDs can be used to set properties. The text ID must be set before any [[Action0/Houses|action 0]] references it.
C9xx|Name of the house type of this ID. If both property 12 and this is set, the latest definition is used always. You should prefer setting property 12 instead of this, so executables translated with TTD Translator will show the name in the current language. However, if you can't find any suitable old TTD texts, this can be used to specify your custom name. Don't forget to set the same text for all parts of a multi-tile building.
 
  +
|}
   
  +
{{ttdp|}} The DCxx IDs are allocated internally when defined, and are persistent in the savegame data. Each .grf file gets its own separate map of these internal IDs and thus may set all 256 of them. &nbsp;However, only 1024 IDs are available in total, to be shared by all .grf files ever activated in the savegame. This means these IDs should be used as sparingly as possible. But use them when they are useful!
D0xx|Miscellaneous graphics texts, unique to each .grf file. Used for several callbacks. Some callbacks as well as newobjects support IDs up to D3FF.
 
   
  +
=== text ===
DCxx|Set miscellaneous persistent GRF texts. Unlike the D0xx GRF texts, these IDs can be used to set properties. The text ID must be set before any action 0 references it.||
 
 
The DCxx IDs are allocated internally when defined, and are persistent in the savegame data. Each .grf file gets its own separate map of these internal IDs and thus may set all 256 of them. &nbsp;However, only 1024 IDs are available in total, to be shared by all .grf files ever activated in the savegame. This means these IDs should be used as sparingly as possible. But use them when they are useful!
 
 
===text===
 
   
 
This is a list of zero-terminated strings, there must be as many strings as num-ent specifies.
 
This is a list of zero-terminated strings, there must be as many strings as num-ent specifies.
   
  +
Grfcodec version 0.9.6 or later accepts literal strings in the .nfo. These are encoded exactly as written, in whatever encoding your text editor uses; if you need a 00, put it immediately after the literal string.
You can use the [http://www.ttdpatch.net/cgi-bin/str2hex.pl|str2hex converter] to generate the proper hex values.
 
 
Alternatively, use grfcodec version 0.9.6 or later, which accepts literal strings in the .nfo. These are encoded exactly as written, in whatever encoding your text editor uses; if you need a 00, put it immediately after the literal string.
 
 
 
For the supported encodings, format, and restrictions on what characters you may use, please see [[GRFActionsDetailed#Strings|GRFActionsDetailed]] and StringCodes.
 
For the supported encodings, format, and restrictions on what characters you may use, please see [[GRFActionsDetailed#Strings|GRFActionsDetailed]] and StringCodes.
   
A large number of generic TTD strings require a colour code in front of the actual string. You can also use these colour codes in most of your custom strings. Use them wisely! In case a generic string requires a colour code, the string will have the code displayed in front of the default text as listed in [[TextIDs]].Typically, a colour coded string starts with the escape character (backslash), followed by hex byte and then the actual text string itself. I.e. string 0001 (&quot;\94Off edge of map&quot;) has colour code 0x94 in front of the text string, which will colour it white. You can also put the plain hex byte outside the quoted string without having to escape it. ''94 &quot;Off edge of map&quot;'' would be the same as ''&quot;\94Off edge of map&quot;''
+
A large number of original TTD strings require a colour code in front of the actual string. You can also use these colour codes in most of your custom strings. Use them wisely! In case a string requires a colour code, the string will have the code displayed in front of the default text as listed in [[TextIDs]].Typically, a colour coded string starts with the escape character (backslash), followed by hex byte and then the actual text string itself. I.e. string 0001 ("\94Off edge of map") has colour code 0x94 in front of the text string, which will colour it white. You can also put the plain hex byte outside the quoted string without having to escape it. ''94 "Off edge of map"'' would be the same as ''"\94Off edge of map"''
 
The following 16 colour codes are available for use:
 
 
||'''Code'''|'''Colour'''
 
 
88|Blue
 
 
89|Light Grey
 
 
8A|Yellow
 
 
8B|Red
 
 
8C|Light Purple
 
 
8D|Beige
 
 
8E|Light Orange
 
 
90|Light Yellow
 
 
91|Light Green
 
 
92|Light Pink
 
 
93|Brown
 
 
94|White
 
 
95|Light Blue
 
 
96|Grey
 
 
97|Purple
 
   
  +
The following colour codes are available for use:
98|Black||
 
   
  +
{| |-
-=Example=-
 
  +
!'''Code'''!!'''Colour'''!!'''Pallete Colour'''
  +
|-
  +
|88||Blue|| <div style="background:#3890E8;width:2em;">&nbsp;</div>
  +
|-
  +
|89||Silver|| <div style="background:#C8C8C8;width:2em;">&nbsp;</div>
  +
|-
  +
|8A||Golden|| <div style="background:#FCC000;width:2em;">&nbsp;</div>
  +
|-
  +
|8B||Red|| <div style="background:#FC0000;width:2em;">&nbsp;</div>
  +
|-
  +
|8C||Purple|| <div style="background:#A888E0;width:2em;">&nbsp;</div>
  +
|-
  +
|8D||Light Brown|| <div style="background:#B0B084;width:2em;">&nbsp;</div>
  +
|-
  +
|8E||Orange|| <div style="background:#FCB030;width:2em;">&nbsp;</div>
  +
|-
  +
|8F||Green|| <div style="background:#90E05C;width:2em;">&nbsp;</div>
  +
|-
  +
|90||Yellow|| <div style="background:#FCF880;width:2em;">&nbsp;</div>
  +
|-
  +
|91||Dark Green|| <div style="background:#B4CC7C;width:2em;">&nbsp;</div>
  +
|-
  +
|92||Cream|| <div style="background:#D49480;width:2em;">&nbsp;</div>
  +
|-
  +
|93||Brown|| <div style="background:#A46040;width:2em;">&nbsp;</div>
  +
|-
  +
|94||White|| <div style="background:#FCFCFC;width:2em;">&nbsp;</div>
  +
|-
  +
|95||Light Blue|| <div style="background:#80C4FC;width:2em;">&nbsp;</div>
  +
|-
  +
|96||Grey|| <div style="background:#626562;width:2em;">&nbsp;</div>
  +
|-
  +
|97||Dark Blue|| <div style="background:#8484A4;width:2em;">&nbsp;</div>
  +
|-
  +
|98||Black|| <div style="background:#101010;width:2em;">&nbsp;</div>
  +
|}
   
  +
==Example==
<span style='color:#808080'>Something to go here</span>
 

Latest revision as of 15:58, 11 February 2023

Introduction

Define strings, e.g vehicle, house or industry names

When making new vehicle graphics, you also need to name the new vehicles, or they'll show up with their original name from TTD. However, custom vehicle names assigned by the player in-game (or for TTDPatch also via TTD's vehicle.dat) will always take precendence.

In TTDPatch you can also use this action to change most of TTD's text strings.

Syntax

The data looks as follows:

<Sprite-number> * <Length> 04 <feature> <language-id> <num-ent> <offset> <text>
Element Size Description
<Sprite-number> dec A sequential sprite number
<length> dec The total number of bytes used in this action.
04 B Defines action 04
<feature> B For what type of vehicle/station should this definition be used?
<language-id> B Which of TTD's languages this name is for
<num-ent> B Number of consecutive strings to change
<offset> B/B*/W First ID to change
<text> S New text strings

Whether <offset> is a BYTE (extended byte in openttd for vehicles) or a WORD is decided by bit 7 of <language-id>, see below.

Descriptions

Sprite-number

This is just the number you are at.

Length

Count the number of bytes in this action.

Feature

This sets the type of feature that you wish to change. Set it to:

Value Feature
00 Trains
01 Road Vehicles
02 Ships
03 Aircraft
04 Stations
07 Houses
0A Industries
0B Cargos
0D Airports
0F Objects
10 Railtypes
12 Roadtypes
13 Tramtypes
48 Original strings; see TextIDs for a list of TTD's text IDs.

language IDs

The meaning of this byte depends on the GRF version of the .grf file as set in action 8.

GRFv≤6 Up to version 6, this is a bit mask of the following bits:

Bit Value Meaning
0 01 American or "other"
1 02 English
2 04 German
3 08 French
4 10 Spanish
7 80 Flag for 16 bit string IDs

Add the bits of all languages for which the following strings apply. Bit 7 controls, whether the following string ID consists of 16 or 8 bit. Unknown languages will use the American strings as fallback. Otherwise the string would remain undefined for these languages. To actually define strings for any new language, you must use grf version 7.

GRFv≥7 For version 7 and higher, it is a simple language ID from the list below. (This has changed with TTDPatch 2.5 beta 4). Bit 7 has the same meaning as in the earlier versions above.

In either scheme, you can use the value 7F or FF, respectively, to define strings shown for languages that you do not provide translation for. First set all strings to a default value using this, and later override the language specific ones if they exist.

Set bit7 (add 0x80 to the languageID as in the table below) in order to use 16 bit string IDs.

For a list of plural forms see StringCodes. As the assignment of plural forms to languages is in fact not as fixed as one might expect, the used plural form is defined by each GRF separately for its strings using Action0/Global Settings property 15.

Currently, the scheme is to use international phone codes as language IDs, unless they're out of range. When creating a new translation for OpenTTD pick a number vaguely related in some way. Or something else.

Valid language IDs are listed in the table below. The cases, genders and the type of plural form is only given as reference. Authorative are the definitions in OpenTTD's language file for each language. A complete list of these exact definitions is available here (generated page).

When translating for a new language, please simply edit the language list and add the new definition here.

num-ent

How many consecutive entries to change.

offset

The ID of the first string to change.

When language-id bit 7 is clear, this is a byte value; For OpenTTD since r13482, where it is an extended byte value for vehicles.

When language-id bit 7 is set, this is a word value in little endian notation, e.g. 8134 becomes 34 81.

The 8 bit version is only allowed for vehicles to set their name, in which case the text ID is just the vehicle ID. To replace original texts, or to define texts for usage in callbacks or properties of vehicles, stations, houses or industries you have to use the 16 bit version. However, town names are changed with Action F.

For the usable 16 bit text IDs see the table below, resp. for feature 48 see TextIDs.

Though these ranges are shared across all features, you should still set the proper feature you are using them for.

ID language cases genders plural form
00 English (US)
01 English (GB)
02 German m w n p
03 French m m2 f 2
04 Spanish m f
05 Esperanto n
06 Ido
07 Russian m f n p nom gen dat acc abl pre m f n p 6
08 Irish 4
09 Maltese 12
0A Tamil
0B Chuvash
0C Chinese (Traditional) 1
0D Serbian nom big gen dat aku vok lok ins muški ženski srednji 6
0E Norwegian (Nynorsk) small masculine feminine neuter
0F Welsh
10 Belarusian m f n p nom gen dat acc abl pre m f n p 6
11 Marathi
12 Faroese m f n
13 Scottish Gaelic dat gen nom voc m f 13
14 Arabic (Egypt) 1
15 Czech nom gen dat acc voc loc ins big small m f n map mnp fp np 10
16 Slovak g m z s 10
17 Hindi
18 Bulgarian m f n p m f n p
1B Afrikaans male
1E Greek subs date geniki m f n 2
1F Dutch
21 Basque
22 Catalan Masculin Femenin
23 Luxembourgish
24 Hungarian t ba 2
26 Macedonian
27 Italian ms mp fs fp m ma f
28 Romanian
29 Icelandic karlkyn kvenkyn hvorugkyn
2A Latvian kas m f 3
2B Lithuanian kas ko kam ka kuo kur kreip vyr mot 5
2C Slovenian r d t 8
2D Danish
2E Swedish
2F Norwegian (Bokmal) small masculine feminine neuter
30 Polish d c b n m w m f n 7
31 Galician m f n
32 Frisian
33 Ukrainian r d z m f s mn 6
34 Estonian g in sü
35 Finnish
36 Portuguese n m f mp fp
37 Brazilian Portuguese m f 2
38 Croatian nom gen dat aku vok lok ins male female middle 6
39 Japanese 1
3A Korean m f 11
3C Malay
3D English (AU)
3E Turkish tamlanan 1
42 Thai 1
54 Vietnamese 1
55 Mexican Spanish m f 0
56 Chinese (Simplified) 1
5A Indonesian 1
5C Urdu m f
61 Hebrew singular plural gen m f
62 Persian
66 Latin gen acc abl dat m f n mp fp np
ID Content
C4xx Set name of station class associated with station ID xx; this is the text above the preview (where otherwise TTD shows "Orientation")
C5xx New station names, this changes the text "number of platforms" into the given text when the station with this ID from the current set is selected (i.e. xx=station-id from action 3 and 0)
C9xx Name of the house type of this ID. If both property 12 and this is set, the latest definition is used always. You should prefer setting property 12 instead of this, so executables translated with TTD Translator will show the name in the current language. However, if you can't find any suitable old TTD texts, this can be used to specify your custom name. Don't forget to set the same text for all parts of a multi-tile building.
D0xx Miscellaneous graphics texts, unique to each .grf file. Used for several callbacks. Some callbacks support IDs up to D3FF.
D4xx Never use in Action4, only for displaying textids in range D000-D3FF (grf specific), see TextIDs
D8xx Supported by OpenTTD 1.71.7 Useable like DCxx in Action 0 and for inclusion via string codes 0x80 and 0x81.

Supported by TTDPatchNever use in Action4, only usable in Action0 features, see TextIDs

DCxx Set miscellaneous persistent GRF texts. Useable in Action 0 and for inclusion via string codes 0x80 and 0x81.

Supported by OpenTTD 1414 This area extends up to textid FFFF.

Supported by TTDPatch Unlike the D0xx GRF texts, these IDs can be used to set properties. The text ID must be set before any action 0 references it.

Supported by TTDPatch The DCxx IDs are allocated internally when defined, and are persistent in the savegame data. Each .grf file gets its own separate map of these internal IDs and thus may set all 256 of them.  However, only 1024 IDs are available in total, to be shared by all .grf files ever activated in the savegame. This means these IDs should be used as sparingly as possible. But use them when they are useful!

text

This is a list of zero-terminated strings, there must be as many strings as num-ent specifies.

Grfcodec version 0.9.6 or later accepts literal strings in the .nfo. These are encoded exactly as written, in whatever encoding your text editor uses; if you need a 00, put it immediately after the literal string. For the supported encodings, format, and restrictions on what characters you may use, please see GRFActionsDetailed and StringCodes.

A large number of original TTD strings require a colour code in front of the actual string. You can also use these colour codes in most of your custom strings. Use them wisely! In case a string requires a colour code, the string will have the code displayed in front of the default text as listed in TextIDs.Typically, a colour coded string starts with the escape character (backslash), followed by hex byte and then the actual text string itself. I.e. string 0001 ("\94Off edge of map") has colour code 0x94 in front of the text string, which will colour it white. You can also put the plain hex byte outside the quoted string without having to escape it. 94 "Off edge of map" would be the same as "\94Off edge of map"

The following colour codes are available for use:

Code Colour Pallete Colour
88 Blue
 
89 Silver
 
8A Golden
 
8B Red
 
8C Purple
 
8D Light Brown
 
8E Orange
 
8F Green
 
90 Yellow
 
91 Dark Green
 
92 Cream
 
93 Brown
 
94 White
 
95 Light Blue
 
96 Grey
 
97 Dark Blue
 
98 Black
 

Example