Language selection

Not favoritedFavorited Favorited 0 favourites
  • 4 posts
From the Asset Store
Implement multi-language translation inside your game effortlessly with the language.translate plugin!
  • J'avais suivi un tutoriel pour changer la langue de mon jeu en utilisant un tableau JSON, un plugin AJAX, une variable d'instance "TextIndex", pour savoir quel texte dans le tableau JSON afficher, et une variable globale LanguageIndex pour savoir en quelle langue afficher les textes de mon jeu. Depuis, j'ai voulu mettre ce choix de langue dès le début du jeu plutôt que dans les options de l'écran titre. J'ai donc créé une nouvelle feuille d'évènements pour la scène où l'on choisit les langues. Après avoir choisi la langue, l'écran avec mon pseudonyme apparait, qui a une autre feuille d'évènement, puis quand je me retrouve dans la scène de l'écran titre, ma variable "LanguageIndex" se reset. Et donc même si je choisit de mettre le jeu en Français, dès l'écran titre, il me le remet par défaut (en Anglais). En plus que je ne retrouve plus le tutoriel pour les langues. Comment puis-je régler ce problème ?

    I had followed a tutorial to change the language of my game using a JSON array, an AJAX plugin, a ‘TextIndex’ instance variable, to know which text in the JSON array to display, and a global LanguageIndex variable to know in which language to display the texts in my game. Since then, I've wanted to put this language choice at the start of the game rather than in the title screen options. So I created a new event sheet for the scene where you choose the languages. After choosing the language, the screen with my nickname appears, which has another event sheet, and when I'm in the title screen scene, my ‘LanguageIndex’ variable resets. So, even if I choose to put the game in French, as soon as I get to the title screen it defaults to English. What's more, I can't find the tutorial for the different languages. How can I solve this problem?

  • and when I'm in the title screen scene, my ‘LanguageIndex’ variable resets

    Is it a global variable? Global variables are not reset by themselves. There must be an event in your code that resets it.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It's a global variable, and I've removed all references that would allow this variable to be reset to 0 (apart from the one in the language selection screen, of course). It's still the same thing.

  • I've found the problem! It was indeed an option that reset the variable, among other things. Thanks for your help. ^^

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)