Language Editing
Making an AMAI translation.
As you probably noticed AMAI support several different languages already, if you know a language that is not yet supported you can easily make your own translation and make AMAI use it by following these instructions carefully.
With this you work in the language folder, there you see some folders for all currently supported languages.
Now when you are going to add a new language just create a new folder here and copy all files from the language folder you want to translate from to your folder.
After this you just open all the '.txt' files and translate all text in it with a few exceptions.
Commander.txt and Strategy.txt are table files and need to be opened in a table editor like Microsoft Excel (although a simple text editor will probably do the job too).
When translating these don't touch the first column since that is the link name that makes AMAI know what strategy/command it is that you are currently translating.
If you are adding a report for a new strategy you created just add the function name of your strategy in a new line at the buttom of this file and fill in the other columns for it with your translation.
The chat files only contain different kind of taunts or messages for different situations as you might notice. Don't translate them straight over, remove them instead and come up with own taunts that fit your language better.
The file CommanderStart.txt contains the text displayed at the start of games when played using the commander. here you can also add some credits to yourself for making this translation.
When you are done with all files all that remains is to add your language in the language table located in the file 'Languages.txt' in the root, then you are done, your language should be selectable the next time you try out this AMAI after compiling and reinstalling it to a map.
Making an advanced AMAI translation.
The new chat system allows you to improve your chat using conditions and variables in the chat strings. This is how it works.
Instructions for use of variables, conditions and translations in 'Translations.txt'.
Variables: Entered anywhere in chat text with [ ].
Example: "My [Color] [Race] army will beat you puny [PlayerColor] [PlayerRace] army easily."
Result for a pink orc talking to a green human as seen if you are the green human:
"My pink orc army will beat your puny green human army easily."
Race - The computers own race.
Color - The computer own color.
Name - The computers own name.
PlayerColor - The other players color. (If displayed to enemies all enemies will see theire own color where this variable is)
PlayerRace - The other players race. (If displayed to enemies all enemies will see theire own race where this variable is)
TargetColor - If a computer saying something while it's targeting another player(attack or megatarget) this is the targets color
TargetRace - If a computer saying something while it's targeting another player(attack or megatarget) this is the targets race
OwnGold - Computer displays it's own current gold.
OwnLumber - Computer displays it's own current lumber.
RandomRace - Will display name of a randomly picked race.
More examples:
"I heard that [RandomRace] is really bad in this patch."
"We better attack that [TargetColor] [TargetRace], he's almost dead now."
"Can you please give me some gold, I only have [OwnGold]."
"Hi, my name is [Name], GL & HF!"
Conditions: Entered before the chat string starts with { }.
One condition: "{condition}I will only show this text under this condition."
Many conditions: "{condition1,condition2,condition3}Only when all these 3 conditions are meet you will see this."
Examples:
"{Random<=50}This chat line only has half the chance of other lines to be displayed"
"{OwnGold>=500,OwnLumber>=500}This chat line is only displayed when the computer has over 500 gold and lumber"
"{FFA}This chat line is only displayed if the game is FFA"
1on1 - Is the game a 1on1?
FFA - Is the game a FFA?
Random - usage: {Random>='number between 0 and 100'} {Random>=30} = has 70% chanse to not be displayed if used.
OwnGold - usage: {OwnGold>='amount of gold the computer must have'} {OwnGold>=200} = must have 200 gold to be displayed.
other usage: {OwnGold<400} = must have less than 400 gold to be displayed.
OwnLumber - usage: {OwnLumber>='amount of lumber the computer must have'} {OwnLumber>=300} = must have 300 lumber to be displayed.
Race - usage: {Race=HUMAN, ELF or UNDEAD ORC,} the message is only used by a computer if it's that race.
other usage: {Race!=HUMAN, ELF
or UNDEAD ORC,} the message is only used by a computer if it's not that race.
RaceChoiceRandom - usage: {!RaceChoiceRandom} This message will only display if the computer is not random race.
Other usage: {RaceChoiceRandom} This message will only be displayed if the computer is random race.
More examples:
"{Race!=UNDEAD}[Race:C] is much better than undead will ever be."
"{FFA,Race=HUMAN}Human is so damn good at FFA, I will beat you all with ease."
"{Race!=ORC,1on1}Orcs are really bad now a days, especialy at 1on1."
Different word forms:
Now there is a new table file in every language, 'Translations.txt' is a file where every variable word is tranlated to the
current langauge but not only that, it also contain every word in the different forms that might be needed in the chat.
Example:
"Im a orc, is there any other orcs in the game?"
If this is done only using the variable [Race] the line will be:
"Im a orc, is there any other orc in the game?"
The same error would occure for any race but the solution is in this table.
the table contain translations like this:
ORC orc
ORC:S orcs
HUMAN human
HUMAN:S humans
and so on...
Now the correct line to make it use "orcs" instead of "orc" at the second place in the chat string is formated like this:
"Im a [Race], is there any other [Race:S] in the game"
As you probably understand now the variable [Race:S] will look up the current race name in the list with ":S" after and
use that word instead of the word at the race name alone. It don't need to be ":S" you can enter any identification you want
in the table as long as you refere to the same in the chat string.
like having this in the table:
HUMAN human
HUMAN:S humans
HUMAN:ANYTHING the mighty humans
"[Race] is a good race, don't you all [Race:S] agree that all [Race:S] should be called [Race:ANYTHING]?"
Of course if you enter for example ORC:A and a translation in the table you have to enter
every race with :A and a translation since you never know what race the computer is playing when using your chat line.