Language not saved in savegame (SOLVED)

Started by PERXEO, Thu 11/05/2023 08:30:07

Previous topic - Next topic

PERXEO

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?

Khris

You can use a global variable:

Code: ags
// top of global script
string translation;

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

  // inside on_event / eEventRestoreGame
  if (translation != null) Game.ChangeTranslation(translation);

Crimson Wizard

#2
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.

PERXEO

Thanks for the idea!! And for the two great explanations!!! Perfect as always!!

SMF spam blocked by CleanTalk