- v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
- Use this page to report any issues related to the migration.
Difference between revisions of "Language token"
m (Creating page for DF2014 (5/143)) |
(rem migrated) |
||
(22 intermediate revisions by 11 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | Language tokens | + | {{Quality|Fine}} |
+ | {{av}} | ||
+ | {{Modding}} | ||
+ | |||
+ | '''Language tokens''' can be used to adjust existing [[language]]s or create a whole new languages. Vanilla language definitions can be found in <code>[[Game folder|<Dwarf Fortress>]]\data\vanilla\vanilla_languages\</code> within the language_*.txt raw files. Each [[token]] is permitted in a specific context. | ||
+ | |||
+ | Note: All language [[raw file]]s use [[Character table|Codepage 437]] encoding, and you should make sure you are editing these files in that format. As many text editors default to UTF-8, some characters with diacritical marks may fail to show properly. Saving one of the default language raw files in this state will overwrite these characters with the unicode question mark, which will corrupt the file. To fix this replace the file with a clean one downloaded from the distributed version of DF. | ||
+ | |||
+ | __TOC__ | ||
+ | {{clear}} | ||
==WORD== | ==WORD== | ||
Line 12: | Line 19: | ||
|- | |- | ||
− | | NOUN | + | | {{text anchor|NOUN}} |
| | | | ||
* singular | * singular | ||
* plural | * plural | ||
− | | Begins defining a noun usage of a word | + | | Begins defining a noun usage of a word. |
|- | |- | ||
− | | ADJ | + | | {{text anchor|ADJ}} |
| | | | ||
* adjective | * adjective | ||
− | | Begins defining an adjective usage of a word | + | | Begins defining an adjective usage of a word. |
|- | |- | ||
− | | PREFIX | + | | {{text anchor|PREFIX}} |
| | | | ||
− | * prefix | + | * prefix |
− | | Begins defining a prefix usage of a word | + | | Begins defining a prefix usage of a word. |
|- | |- | ||
− | | VERB | + | | {{text anchor|VERB}} |
| | | | ||
* present first person | * present first person | ||
Line 38: | Line 45: | ||
* past participle | * past participle | ||
* present participle | * present participle | ||
− | | Defines a verb usage of a word | + | | Defines a verb usage of a word. |
|- | |- | ||
− | | ADJ_DIST | + | | {{text anchor|ADJ_DIST}} |
| number 1-7 | | number 1-7 | ||
| Determines what order the adjective being defined comes in when in a string of multiple adjectives. | | Determines what order the adjective being defined comes in when in a string of multiple adjectives. | ||
|- | |- | ||
− | | THE_NOUN_SING | + | | {{text anchor|THE_NOUN_SING}} |
− | | | + | | |
− | | Lets the singular noun form of the word be used after "the" | + | | Lets the singular noun form of the word be used after "the" ("The X of Y", where X is the word with the tag). |
|- | |- | ||
− | | THE_NOUN_PLUR | + | | {{text anchor|THE_NOUN_PLUR}} |
− | | | + | | |
− | | As above, but with plural | + | | As above, but with plural ("The Xs of Y"). |
|- | |- | ||
− | | THE_COMPOUND_NOUN_SING | + | | {{text anchor|THE_COMPOUND_NOUN_SING}} |
− | | | + | | |
− | | Lets the singular noun form of the word be used as part of a compound noun after "the" ("The Z-X of Y") | + | | Lets the singular noun form of the word be used as part of a compound noun after "the" ("The Z-X of Y"). |
|- | |- | ||
− | | THE_COMPOUND_NOUN_PLUR | + | | {{text anchor|THE_COMPOUND_NOUN_PLUR}} |
− | | | + | | |
− | | As above, but with plural | + | | As above, but with plural ("The Z-Xs of Y"). |
|- | |- | ||
− | | THE_COMPOUND_ADJ | + | | {{text anchor|THE_COMPOUND_ADJ}} |
− | | | + | | |
− | | Lets the adjective form of the word be used as part of a compound noun after "the" ("The Z-X of Y") | + | | Lets the adjective form of the word be used as part of a compound noun after "the" ("The Z-X of Y"). |
|- | |- | ||
− | | OF_NOUN_SING | + | | {{text anchor|OF_NOUN_SING}} |
− | | | + | | |
− | | Lets the singular noun form of the word be used after "of" ("The Y of X") | + | | Lets the singular noun form of the word be used after "of" ("The Y of X"). |
|- | |- | ||
− | | OF_NOUN_PLUR | + | | {{text anchor|OF_NOUN_PLUR}} |
− | | | + | | |
− | | As above, but with plural | + | | As above, but with plural ("The Y of Xs"). |
|- | |- | ||
− | | FRONT_COMPOUND_NOUN_SING | + | | {{text anchor|FRONT_COMPOUND_NOUN_SING}} |
− | | | + | | |
− | | Lets the singular noun form of the word be used at the front of a compound noun (XY, as in surnames) | + | | Lets the singular noun form of the word be used at the front of a compound noun ("XY", as in surnames). |
|- | |- | ||
− | | FRONT_COMPOUND_NOUN_PLUR | + | | {{text anchor|FRONT_COMPOUND_NOUN_PLUR}} |
− | | | + | | |
| As above, but with plural. | | As above, but with plural. | ||
|- | |- | ||
− | | REAR_COMPOUND_NOUN_SING | + | | {{text anchor|REAR_COMPOUND_NOUN_SING}} |
| | | | ||
− | | Lets the singular noun form of the word be used at the rear of a compound noun (YX, as in surnames) | + | | Lets the singular noun form of the word be used at the rear of a compound noun ("YX", as in surnames). |
|- | |- | ||
− | | REAR_COMPOUND_NOUN_PLUR | + | | {{text anchor|REAR_COMPOUND_NOUN_PLUR}} |
− | | | + | | |
| As above, but with plural. | | As above, but with plural. | ||
|- | |- | ||
− | | FRONT_COMPOUND_ADJ | + | | {{text anchor|FRONT_COMPOUND_ADJ}} |
− | | | + | | |
− | | Lets the adjective form of the word be used at the front of a compound noun | + | | Lets the adjective form of the word be used at the front of a compound noun. |
|- | |- | ||
− | | REAR_COMPOUND_ADJ | + | | {{text anchor|REAR_COMPOUND_ADJ}} |
− | | | + | | |
| As above, but at the rear instead. | | As above, but at the rear instead. | ||
− | + | ||
|- | |- | ||
− | | FRONT_COMPOUND_PREFIX | + | | {{text anchor|FRONT_COMPOUND_PREFIX}} |
− | | | + | | |
| Allows the prefix form to be appended as a prefix to a compound noun. | | Allows the prefix form to be appended as a prefix to a compound noun. | ||
|- | |- | ||
− | | THE_COMPOUND_PREFIX | + | | {{text anchor|THE_COMPOUND_PREFIX}} |
− | | | + | | |
| Allows the prefix form to be appended as a prefix to a compound noun following "the". | | Allows the prefix form to be appended as a prefix to a compound noun following "the". | ||
|- | |- | ||
− | | STANDARD_VERB | + | | {{text anchor|STANDARD_VERB}} |
− | | | + | | |
| Allows the verb to be used in a compound noun and for its participles to be used as adjectives. | | Allows the verb to be used in a compound noun and for its participles to be used as adjectives. | ||
− | |||
|} | |} | ||
Line 135: | Line 141: | ||
|- | |- | ||
− | | S_WORD | + | | {{text anchor|S_WORD}} |
| | | | ||
* WORD | * WORD | ||
− | | Specifies the given WORD (defined in language_words.txt) as belonging to the symbol being defined. A given word can belong to multiple symbols. | + | | Specifies the given WORD (defined in #REDIRECT [[language_words.txt]]) as belonging to the symbol being defined. A given word can belong to multiple symbols. |
− | |||
|} | |} | ||
− | |||
==TRANSLATION== | ==TRANSLATION== | ||
Line 152: | Line 156: | ||
|- | |- | ||
− | | T_WORD | + | | {{text anchor|T_WORD}} |
− | | | + | | |
* WORD | * WORD | ||
* translation | * translation | ||
| Specifies a translation from a given WORD (defined in language_words.txt) into the language being defined. | | Specifies a translation from a given WORD (defined in language_words.txt) into the language being defined. | ||
− | |||
|} | |} | ||
− | ==English instead of | + | ==English instead of dwarven language== |
− | You can hack the language files in | + | You can hack the language files to display english in-game with this regular expression command: |
'''<nowiki>:%s/T_WORD:\([A-Z_ -]*\):[^\]]*\]/T_WORD:\1:\L\1]/</nowiki>''' | '''<nowiki>:%s/T_WORD:\([A-Z_ -]*\):[^\]]*\]/T_WORD:\1:\L\1]/</nowiki>''' | ||
+ | ==See also== | ||
+ | * [[40d:Language]] (has expanded explanations of parts of the language system, which seems to still be the same in this version) | ||
+ | * [[Speech file]]s | ||
+ | * '''Raws''' | ||
+ | ** [[language_SYM.txt]] | ||
− | + | ||
− | |||
− | |||
{{Category|Modding}} | {{Category|Modding}} | ||
{{Category|Tokens}} | {{Category|Tokens}} | ||
+ | [[ru:Language token]] | ||
+ | [[Category:Language]] |
Latest revision as of 06:14, 8 February 2023
v50.14 · v0.47.05 This article is about the current version of DF.Note that some content may still need to be updated. |
Modding |
---|
Tokens |
Audio · Biome · Graphics · Interaction · Mod info · Plant · Speech · Sphere · Syndrome · World |
Body tokens |
Body · Body detail plan · Bodygloss · Tissue |
Creature tokens |
Creature · Creature mannerism · Personality · Creature variation · Procedural graphics layer |
Descriptor tokens |
Descriptor color · Color · Descriptor pattern · Descriptor shape |
Entity tokens |
Entity · Ethic · Language · Value · Position |
Job tokens |
Building · Labor · Reaction · Skill · Unit type |
Item tokens |
Item type · Item definition · Ammo · Armor · Instrument · Tool · Trap component · Weapon |
Material tokens |
Material type · Material definition · Inorganic material definition |
Language tokens can be used to adjust existing languages or create a whole new languages. Vanilla language definitions can be found in <Dwarf Fortress>\data\vanilla\vanilla_languages\
within the language_*.txt raw files. Each token is permitted in a specific context.
Note: All language raw files use Codepage 437 encoding, and you should make sure you are editing these files in that format. As many text editors default to UTF-8, some characters with diacritical marks may fail to show properly. Saving one of the default language raw files in this state will overwrite these characters with the unicode question mark, which will corrupt the file. To fix this replace the file with a clean one downloaded from the distributed version of DF.
WORD[edit]
Token | Arguments | Description |
---|---|---|
NOUN |
|
Begins defining a noun usage of a word. |
ADJ |
|
Begins defining an adjective usage of a word. |
PREFIX |
|
Begins defining a prefix usage of a word. |
VERB |
|
Defines a verb usage of a word. |
ADJ_DIST | number 1-7 | Determines what order the adjective being defined comes in when in a string of multiple adjectives. |
THE_NOUN_SING | Lets the singular noun form of the word be used after "the" ("The X of Y", where X is the word with the tag). | |
THE_NOUN_PLUR | As above, but with plural ("The Xs of Y"). | |
THE_COMPOUND_NOUN_SING | Lets the singular noun form of the word be used as part of a compound noun after "the" ("The Z-X of Y"). | |
THE_COMPOUND_NOUN_PLUR | As above, but with plural ("The Z-Xs of Y"). | |
THE_COMPOUND_ADJ | Lets the adjective form of the word be used as part of a compound noun after "the" ("The Z-X of Y"). | |
OF_NOUN_SING | Lets the singular noun form of the word be used after "of" ("The Y of X"). | |
OF_NOUN_PLUR | As above, but with plural ("The Y of Xs"). | |
FRONT_COMPOUND_NOUN_SING | Lets the singular noun form of the word be used at the front of a compound noun ("XY", as in surnames). | |
FRONT_COMPOUND_NOUN_PLUR | As above, but with plural. | |
REAR_COMPOUND_NOUN_SING | Lets the singular noun form of the word be used at the rear of a compound noun ("YX", as in surnames). | |
REAR_COMPOUND_NOUN_PLUR | As above, but with plural. | |
FRONT_COMPOUND_ADJ | Lets the adjective form of the word be used at the front of a compound noun. | |
REAR_COMPOUND_ADJ | As above, but at the rear instead. | |
FRONT_COMPOUND_PREFIX | Allows the prefix form to be appended as a prefix to a compound noun. | |
THE_COMPOUND_PREFIX | Allows the prefix form to be appended as a prefix to a compound noun following "the". | |
STANDARD_VERB | Allows the verb to be used in a compound noun and for its participles to be used as adjectives. |
SYMBOL[edit]
Token | Arguments | Description |
---|---|---|
S_WORD |
|
Specifies the given WORD (defined in #REDIRECT language_words.txt) as belonging to the symbol being defined. A given word can belong to multiple symbols. |
TRANSLATION[edit]
Token | Arguments | Description |
---|---|---|
T_WORD |
|
Specifies a translation from a given WORD (defined in language_words.txt) into the language being defined. |
English instead of dwarven language[edit]
You can hack the language files to display english in-game with this regular expression command:
:%s/T_WORD:\([A-Z_ -]*\):[^\]]*\]/T_WORD:\1:\L\1]/
See also[edit]
- 40d:Language (has expanded explanations of parts of the language system, which seems to still be the same in this version)
- Speech files
- Raws