Skip to main content

Languages Guide

ElysChat's language system creates immersive communication barriers where players must learn fictional languages to understand each other.

How Language Corruption Works

When a player speaks in a language, each listener receives a corruption of the message based on their proficiency:

ProficiencyRangeEffect
None0.0All words → [???]
Partial0.0 – 0.75Mix of [???], dictionary translations, and phoneme substitutions
Mostly0.75 – 1.0Mostly readable with phonemic flavour
Fluent1.0Full unmodified text

Deterministic: Same message + same proficiency = same corruption output (seeded from MessageId + SenderId).

Emotes are never corrupted — action text in *asterisks* passes through unchanged.

Creating a Language

Create a Data Asset of type UERPLanguageAsset:

// Elvish language example
LanguageId = "elvish";
DisplayName = "Elvish";
SlashCommands = { "elvish", "elv" };

// Dictionary — common word translations
Dictionary = {
{"hello", "sîla"},
{"friend", "mellon"},
{"enemy", "goth"},
{"water", "nen"},
};

// Phoneme substitutions — fallback for words not in dictionary
PhonemeMap = {
{"s", "sh"},
{"th", "dh"},
{"r", "rh"},
};

// Thresholds
PartialThreshold = 0.25f;
MostlyThreshold = 0.75f;

Speaking in a Language

/elvish Hello, friend!
/local /elv Greetings, traveler

Managing Language Proficiency

Use UERPLanguageComponent on your character:

// Teach a language
LanguageComponent->LearnLanguage(TEXT("elvish"), 0.0f);

// Improve proficiency (e.g., from studying or exposure)
LanguageComponent->SetLanguageProficiency(TEXT("elvish"), 0.5f);

// Check proficiency
float Prof = LanguageComponent->GetProficiency(TEXT("elvish"));

NPC Dialogue Corruption

Use UERPLanguageFunctionLibrary for outside-chat corruption:

// Corrupt NPC dialogue based on player's proficiency
FString Corrupted = UERPLanguageFunctionLibrary::CorruptStringForActor(
PlayerActor,
TEXT("What do you seek in these ancient halls?"),
TEXT("elvish"),
ChatConfig
);