Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: PERXEO on Thu 11/05/2023 08:30:07

Title: Language not saved in savegame (SOLVED)
Post by: PERXEO on Thu 11/05/2023 08:30:07
Hello again. I'm making quite a bit of progress with my game and now I'm on the subject of translations. I have managed to make it possible to change the language, at runtime. However, when I save a game with a certain language, for example English, when I restore the game, the game resumes with the active language, not with the language in which it was recorded. I guess this is normal behaviour, isn't it? But... can you save the language in the game as a data added to the savegame?
Title: Re: Language not saved in savegame
Post by: Khris on Thu 11/05/2023 12:44:31
You can use a global variable:

// top of global script
string translation;

  // inside handling the change:
  translation = Game.TranslationFilename;

  // inside on_event / eEventRestoreGame
  if (translation != null) Game.ChangeTranslation(translation);
Title: Re: Language not saved in savegame
Post by: Crimson Wizard on Thu 11/05/2023 12:55:25
There are number of config settings that are not a part of the save because they do not relate to game progress, but to player's preferences. For example, a player might want to continue same game using another language, or another display mode.
Title: Re: Language not saved in savegame
Post by: PERXEO on Thu 11/05/2023 13:59:49
Thanks for the idea!! And for the two great explanations!!! Perfect as always!!