-
Notifications
You must be signed in to change notification settings - Fork 0
Predefined Player Words
Predefined Player Words are a list of hardcoded words which are treated specially by the parser when encountered in the player's input.
Table of Contents
- About Predefined Player Words
- Changing The Predefined Player Words
- Player Words and i18n
- Alan Source Code References
From Alan's Reference Manual, "Appendix E: Predefined Player Words":
Alan defines a set of words for the player to use, which are required for the syntax variations described in Player Input on page 164. These words are available even without any declarations at all in the game source. Some of these might conflict with, or complement, words defined in the source. The lists below contain those player words for the currently defined languages.
The follwing table resumes the predefined player words of the supported languages:
language | ALL | AND | BUT | THEM | NOISE |
---|---|---|---|---|---|
English |
all , everything
|
and , then
|
but , except
|
them |
go , the
|
Swedish |
alla , allt
|
och |
förutom , utom
|
dem , dom
|
gå |
German | alles |
und |
ausser |
sie |
das , der , die , gehen
|
The predefined player words are hardcoded into Alan (see below), and currently there is no way to redefine them; but you can create synonyms for them.
NOTE — On Alan's planning board there are currently two proposals to overcome this limitation and allow using unsupported languages without having to edit and recompile Alan source files:
- Implementing a
NEW
clause to (re)define new player words. (Pivotal #3991234)- Via external translation files. (Pivotal #3991235)
If you're localizing Alan to another language, your main concern is that none of the predefined Player Words conflict with other meaningful words in the language you're targetting.
By default, Alan uses English as the base language, unless you explicitly specify another language via OPTIONS
. If one of the English Player Words should conflict with the target language you're targetting (in your own adventure, or if translating the Standard Library to that locale), you can always switch to another supported languages as the base language (ie, Germaan and Swedish) — after all, you're going anyway to create synonims for the Player Words to enable their use in the target language, and you'r also going to translate the system messages, therefore it doesn't really matter which language you use as a base language since in the final adventure it won't be exposed to the player.
Implementation of Player Words in Italian is handled in the lib_supplemento.i
library module.
Here are the Italian words, implemented as synonyms:
ALL | AND | BUT | THEM | NOISE |
---|---|---|---|---|
tutto |
e |
tranne |
il |
|
tutti |
poi |
eccetto |
lo |
|
tutte |
escluso |
la |
||
esclusa |
i |
|||
esclusi |
gli |
|||
escluse |
le |
|||
'l''' |
These player words are hardcoded into Alan, and their definition can be found in compiler/wrd.c
(182–226):
/*======================================================================
prepareWords()
Prepare the dictionary by inserting some words dependent on the
selected language, for example.
*/
void prepareWords(void)
{
/* Enter some words in the dictionary. Predefined pronouns are added
to the classes, not here */
switch (opts[OPTLANG].value) {
case L_ENGLISH:
newWord("go", NOISE_WORD, 0, NULL);
newWord("them", THEM_WORD, 0, NULL);
newWord("except", EXCEPT_WORD, 0, NULL);
newWord("but", EXCEPT_WORD, 0, NULL);
newWord("and", CONJUNCTION_WORD, 0, NULL);
newWord("all", ALL_WORD, 0, NULL);
newWord("everything", ALL_WORD, 0, NULL);
newWord("then", CONJUNCTION_WORD, 0, NULL);
break;
case L_SWEDISH:
newWord("gå", NOISE_WORD, 0, NULL);
newWord("dem", THEM_WORD, 0, NULL);
newWord("utom", EXCEPT_WORD, 0, NULL);
newWord("förutom", EXCEPT_WORD, 0, NULL);
newWord("och", CONJUNCTION_WORD, 0, NULL);
newWord("allt", ALL_WORD, 0, NULL);
newWord("alla", ALL_WORD, 0, NULL);
break;
case L_GERMAN:
newWord("gehen", NOISE_WORD, 0, NULL);
newWord("sie", THEM_WORD, 0, NULL);
newWord("ausser", EXCEPT_WORD, 0, NULL);
newWord("und", CONJUNCTION_WORD, 0, NULL);
newWord("alles", ALL_WORD, 0, NULL);
break;
default:
SYSERR("Unrecognized language", nulsrcp);
break;
}
}
Alan is an Interactive Fiction authoring tool for creating text adventures: www.alanif.se