Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Le Woltaire on Thu 12/06/2008 22:10:50

Title: Switch translation
Post by: Le Woltaire on Thu 12/06/2008 22:10:50
Is it possible to change the translation with a GUI in the game?

Example: You have a button and switch to the English translation from the German translation when you click on it.
Title: Re: Switch translation
Post by: Khris on Thu 12/06/2008 22:14:45
No.
Title: Re: Switch translation
Post by: Le Woltaire on Thu 12/06/2008 22:26:57
Phew...how boring...

I think it would be useful.
Many people don't recognize that there is an additional translation in their own language
especially if it's the first time that they get confronted with an AGS game...
Including it into a GUI would be great...

Isn't it possible to script a command that accesses the acsetup.cfg file and resets the translation?

Something like: SetTranslation("German");

Title: Re: Switch translation
Post by: Khris on Thu 12/06/2008 22:34:25
You can code a custom Launcher that'll rewrite acsetup.cfg.

Having said that, people who don't care to read a game's publishing notes and/or the readme, do they deserve special treatment...?
Title: Re: Switch translation
Post by: Le Woltaire on Thu 12/06/2008 22:49:50
Yeah...I know...
In most cases people don't bother with the manuals...

Besides, it could be part of a gaming concept.
We already had games that used multiple languages during the game like Soviet Underzögerdings.

In my case the possibility to switch between languages would fit very good with the whole concept of the game...
Title: Re: Switch translation
Post by: JpSoft on Thu 12/06/2008 23:15:26
You can also add a "Change language GUI" where you could explain to the player what he must do if he want change the language, and optionally, the translations available.  :)

Of course, create your own launcher is a better solution, but it requires some knoweledge about it.

Jp
Title: Re: Switch translation
Post by: Khris on Fri 13/06/2008 06:39:24
It MIGHT be possible to change acsetup.cfg from withing the game, then use RunAGSGame to restart the game itself...

And of course there's the possibility to use a custom translation system; switching languages in-game won't be a problem then.
Title: Re: Switch translation
Post by: Le Woltaire on Fri 13/06/2008 08:30:31
Quote from: KhrisMUC on Fri 13/06/2008 06:39:24
It MIGHT be possible to change acsetup.cfg from withing the game, then use RunAGSGame to restart the game itself...

That would be absolutely enough...
All I need is a way to access the acsetup.cfg from within the game...
Rewrite it with all existing settings and rerun the game...

I made a test with this script:

function Engl_OnClick(GUIControl *control, MouseButton button)
{
File *output = File.Open("acsetup.cfg", eFileWrite);
if (output == null)
  Display("Error opening file.");
else {
  output.WriteString("[misc]");
  output.WriteString("gamecolordepth=32");
  output.WriteString("defaultres=4");
  output.WriteString("screenres=1");
  output.WriteString("defaultgfxdriver=DX5");
  output.WriteString("gfxdriver=DX5");
  output.WriteString("cachemax=102400");
  output.WriteString("windowed=0");
  output.WriteString("refresh=0");
  output.WriteString("gfxfilter=None");
 
  output.WriteString("[sound]");
  output.WriteString("digiid=-1"); 
  output.WriteString("midiid=-1");
  output.WriteString("digiindx=0");
  output.WriteString("midiindx=0");
  output.WriteString("digiwinindx=0");
  output.WriteString("digiwin=1096302880");
  output.WriteString("midiwinindx=0");
  output.WriteString("midiwin=-1");
 
  output.WriteString("[language]");
  output.WriteString("translation=English");

  output.Close();
  RunAGSGame("A Second Face.exe",0, 0);}


It seems to work at the first moment,
but then I recognize that the acsetup.cfg messes up.
All strings are in one line.
And I get those funny rectangles between them...
Title: Re: Switch translation
Post by: Khris on Fri 13/06/2008 08:40:39
Try File.WriteRawLine.
Title: Re: Switch translation
Post by: Le Woltaire on Fri 13/06/2008 08:59:03
Ok It works now, but AGS doesn't seem to rerun the config settings when running another game...

I still get it in German after clicking the button...
When I exit and restart the game it runs in English...

Title: Re: Switch translation
Post by: Joseph DiPerla on Fri 13/06/2008 16:26:47
It might store the settings in a buffer once the game is loaded. Therefore, changing the config file wont do anything. RunAGS seems to be using the same settings in the buffer.

Have you tried using the SetRestartPoint script function and then RestartGame to restart the game to see if that changes anything?
Title: Re: Switch translation
Post by: GarageGothic on Fri 13/06/2008 16:29:46
Yeah, AGS doesn't re-initialize the settings when you use RunAGSGame. That also killed my ambition of being able to change resolution and toggle windowed mode from in-game. Seeing as RestartGame in effect just restores savegame file 999 it shouldn't make any difference.
Title: Re: Switch translation
Post by: Joseph DiPerla on Fri 13/06/2008 16:50:40
Just tried my idea. No Deal. It edits the file fine and it restarts, but nothing. Still in English.

Sorry.
Title: Re: Switch translation
Post by: Pumaman on Fri 13/06/2008 18:36:57
It would be possible to add some sort of ChangeTranslation script command, if people would find it useful?
Title: Re: Switch translation
Post by: GarageGothic on Fri 13/06/2008 18:54:31
I think it's a good idea. Perhaps an overhaul of the translation code could be part of the next AGS version, along with the scheduled reworking of the dialog system? I remember there were requests for separate speech files such as german.vox, french.vox and so on.

Also, I recall reading in an old thread (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=18328.0) that:

Quoteif a translation is in use the speech won't play

Is this still true? I didn't see it mentioned in the changelist, so I assume so. If so, that's quite a pity. I'm sure a lot of non-english speakers would enjoy, and could even learn from, playing a game with English audio and localized subtitles.

(Perhaps lipsync for LucasArts style speech could be implemented in the process? *hint hint*)
Title: Re: Switch translation
Post by: Le Woltaire on Fri 13/06/2008 19:31:50
Actually when I developed Earl Bobby I used translation files for the voice actings.
So the voices can play in a translation.
Blashyrkh scripted some Perl scripts that make the dubbing of translation files easier.
You can find them somewhere on my homepage...

But my main argumentation for a Change Translation command is:

It makes clearly comprehensible that the game can be played in another language.
For example by having some little flags on the first screen site (like on Homepages...)
If people don't understand English, they won't get how the setup.exe works.
That's one of the reasons why we make a translation...
Title: Re: Switch translation
Post by: Pumaman on Sun 15/06/2008 20:06:11
Yeah, I can see that it would be good to be able to have a GUI when the game first starts up that asks the player what language they want, and there's no technical reason why this couldn't be added. I'll look into it for 3.0.3.