Hey everyone, I am using AGS 3.4.1 and a custom dialogue script. I have a trs file in Spanish and when I test it everything in a GUI or Display"" works fine. However, none of my character speech text is translated at all! I have checked the .trs file for line breaks and there are none. I have change the font of the speech/menu to try and debug this matter and nothing. I am running very low on ideas on what could be causing this issue. If anyone could help it would be greatly appreciated :)
Edit: The fault was I did not compile the translation file and the trs file was corrupted.
Quotea custom dialog script
Tell us more about this?
No problem! Also as an update, I recently discovered that in very rare circumstances you will see a very quick glimpse of translated text before changing back to English. It happens with the typewriter effect.
The custom dialogue script uses a GUI label rather than the TextWindowGUI. Also, I have a typewriter effect to go with it. Is there something I need to do in order for this to work correctly?
AGS only do proper translation when it has full text. If you do typewriter effect, that means that the label will have partial text most of the time, preventing AGS from finding translation match automatically.
In case like this you should use "GetTranslation" to receive and store a full text in the current language, then run typewriter effect with it. Example:
function RunTypewriterSpeech(String text)
{
String fulltext = GetTranslation(text);
// start typewriter with "fulltext"
}
Although that does make perfect sense, I have noticed that line is already in the script.
function Speak(this Character*, String txt, int speed, int color)
{
String text = GetTranslation(txt);
// ChangePortrait(chars_setup[this.ID].Portrait);
if (!color) {color = chars_setup[this.ID].SpeechColor;}
else
{
color = DEFAULT_SPEECH_COLOR;
}
lbltext.TextColor = color;
String tmp = "";
int text_length = text.Length;
int i = 0;
char curChar;
bool abort = false;
bool speaking = false;
bool keys;
ShowTextBox();
Wait(5);
while (i < text_length && !abort )
{
curChar = text.Chars[i];
tmp = tmp.AppendChar(curChar);
lbltext.Text = tmp;
if (curChar == eKeyPeriod || curChar == eKeyExclamationMark || curChar == eKeyQuestionMark || curChar == eKeyOpenBracket)
{
// ChangePortrait(chars_setup[this.ID].Portrait);
speaking = false;
Wait(1);
}
else if (!speaking && !IsGamePaused())
{
speaking = true;
}
Wait(speed);
abort = IsKeyPressed(eKeyReturn) || IsKeyPressed(eKeySpace) == true;
i++;
aSpeech.Play();
}
lbltext.Text = text;
if (abort || Autotext==false)
{Wait(7); WaitKey(9000);}
else
{WaitKey(60);}
lbltext.Text = "";
}
Unless there is a fault in this script somewhere? Because it still sin't working. Also this script is above my global script. Could that possibly be the case?