Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: EnterTheStory (aka tolworthy) on Sun 08/03/2009 23:37:11

Title: how to use 'GetTranslation' with 'Substring' and 'Append'? (SOLVED)
Post by: EnterTheStory (aka tolworthy) on Sun 08/03/2009 23:37:11
I'm using a translation source, but my characters still speak English.

EDIT: I guessed the wrong problem - see later answer.

[deleted code]
Title: Re: how to use 'GetTranslation' with 'Substring' and 'Append'?
Post by: GarageGothic on Sun 08/03/2009 23:46:38
Where did you try putting GetTranslation? It should work if you put:

bigString = GetTranslation(bigString);

as the first line of the function.
Title: Re: how to use 'GetTranslation' with 'Substring' and 'Append'?
Post by: EnterTheStory (aka tolworthy) on Mon 09/03/2009 00:01:35
EDIT:

I'm getting somewhere now.

After much experimenting, it seems that I was wrong. The problem seems to be in the translation file somewhere. I tried a one-line translation source, and it worked perfectly. Then I tried the original full translation (before I added new lines) and AGS complains that it has an uneven number of lines. I can't see where the uneven lines are (the text file is 2.5 MB long) but I'll go and hunt them down.
Title: Re: how to use 'GetTranslation' with 'Substring' and 'Append'?
Post by: GarageGothic on Mon 09/03/2009 00:13:12
I don't remember if String parameters are write protected, but just to make sure you could try creating a temp String, do the "tempString = GetTranslation(bigString)" and then use tempString as the source for the rest of the code.

Also make sure that the content of bigString didn't change since you created the translation source. How long is bigString, by the way? I seem to remember translations having trouble with too long Strings.

Edit: Wrote before I saw your edit. Good luck with the bug hunt!
Title: Re: how to use 'GetTranslation' with 'Substring' and 'Append'?
Post by: EnterTheStory (aka tolworthy) on Mon 09/03/2009 00:16:59
Quote from: GarageGothic on Mon 09/03/2009 00:13:12How long is bigString, by the way? I seem to remember translations having trouble with too long Strings.
Thanks for the suggestion. It might be that. Many of my Strings are pushing 500 characters, and the translation (to Dutch) will be longer. But in tests I managed to show 1000 character lines, so I hope that's not the problem.

EDIT NEXT MORNING:

Found the problem. When I add a line of comment above some complex code I often add a blank line to make it readable. Adding blank lines to the translation source is a Very Bad Idea, I now realize. Problem solved.