Babel

ACRE2 introduces an exciting new voice feature for adversarial and cooperative play in the Babel System. This system allows mission makers to define a set of “languages” for players and assign players individually, however you choose, which languages from that set they speak, from one language to multiple languages. If a player speaks a language that another player doesn’t understand the voice of that speaker will be transformed into an unintelligible sound, but one that still retains the elements of language, such as inflection, tone of voice, and cadence of speech. If you speak multiple languages you are able to switch between which language you are speaking in, and will hear people speaking any of the languages you understand unaffected by the Babel System.

For adversarial play this allows you to hide all enemy communications from understanding unless there is someone defined as speaking that language. For cooperative play the use of interpreters between multiple language groups becomes essential, adding a new dynamic to the play experience.

The Babel System and API is present as of the ACRE2 Alpha build number 509. All functions are part of the standard mission maker API and are listed below.

Concepts

The Babel System uses a local API system that must be executed on all clients equally except for where the definition of a individual persons language is concerned, which can differ between clients. Language IDs are sent during the start of speaking events, with non-timely updates applied if a person changes languages in the middle of a conversation. It is imperative that languages be added in the same order on all machines, including JIP, otherwise the numerical values sent during speaking events will not match their literal values on the client. It is best to avoid manipulating the list of languages available after mission init or JIP init.

Function List

acre_api_fnc_babelSetupMission(side)

Provides functionality to allow for easy setup of side-specific languages. An array is provided for each configurable side which specifies the languages that side can speak.

Example: [ [west, "English", "French"], [east, "Russian"], [civilian, "French"] ] call acre_api_fnc_setupMission;

Example 2: [ [west, "English", "French"], [east, "Russian", "French" ] ] call acre_api_fnc_setupMission;

Parameters:side – An array specifying the side and languages to configure. [side, “Language”, ....]
Returns:setup was successful
Return type:bool
acre_api_fnc_babelAddLanguageType(language_id, language_name)

Example: ["en", "English"] call acre_api_fnc_babelAddLanguageType;

Parameters:
  • language_id (string) – The ID which will be used internally for identifying the language or specifying languages via other API methods.
  • language_name (string) – The display name of the language which the user will see
Returns:

setup was successful

Return type:

bool

acre_api_fnc_babelSetSpokenLanguages(language_id, ...)

Sets the languages that the local speaker can speak. The language ID must be utilized here, which was the first parameter provided when calling babelAddLanguageType;

Example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
if(mymission_playerIsRussianSpeaker) then {
        ["ru"] call acre_api_fnc_babelSetSpokenLanguages;
} else {
        if(mymission_playerIsEnglishSpeaker) then {
                ["en"] call acre_api_fnc_babelSetSpokenLanguages;
        } else {
                // bilingual mode
                ["en", "ru"] call acre_api_fnc_babelSetSpokenLanguages;
        };
};

:param language_id: The ID which will be used internally for identifying the language or specifying languages via other API methods.
:type language_id: string
:returns: setup was successful
:rtype: bool
acre_api_fnc_babelSetSpeakingLanguage(language_id, ...)

Sets the language the player will activeluy speak in.

Example: ["en"] call acre_api_fnc_babelSetSpeakingLanguage;

Parameters:language_id (string or integer) – The ID which will be used internally for identifying the language or specifying languages via other API methods.
Returns:setup was successful
Return type:bool
acre_api_fnc_babelGetSpeakingLanguageId()

Gets the ID of the language which is actively being spoken (set with babelSetSpeakingLanguage)

Example: [] call acre_api_fnc_babelSetSpeakingLanguage;

Returns:A language ID
Return type:string
acre_api_fnc_babelGetLanguageName(language_id, ...)

Sets the language the player will activeluy speak in.

Example: ["en"] call acre_api_fnc_babelSetSpeakingLanguage;

Parameters:language_id (integer) – The ID which will be used internally for identifying the language
Returns:setup was successful
Return type:bool