multilingual game

0 favourites
  • 8 posts
From the Asset Store
five golem elements Sprites Sheet.Best for enemy or villain game characters.
  • Hi all,

    I was wondering what the correct way was to create a multilingual game.

    I'll have to develop a game which lets you choose your language before you start. If chosen French, all the text should be in French and if Dutch... you get the point.

    Now how should I do this? Should I create a global variable "language" and check what it is after the option screen, then set all text to its correspondent language? Seems like the only way to go but it looks so devious to me.

    Thanks for your help!

  • Im using a global variable like you said, that only changes in options screen, and i have a dictionary that has all text, for example:

    OptionS is the name of the entry for "options" in spanish, OptionsE is the name of the entry for "options" in english, and my global variable is called LANG and have "S" value or "E" value, then i use this:

    Text.SetText -> Dic.Get("Options" & LANG)

  • Thanks a lot!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hmm, I'm getting a 0 result when I try to get the value from the Dictionary.

    When I display the text I get the correct result: welcomeTextN or welcomeTextF, depending on the chosen language.

    Yet when I do Dictionary.Get("welcomeText" & language) it returns 0. I'm 100% sure the key value is welcomeTextF & welcomeTextN. Strange... Any ideas?

  • -Are you filling the dictionary value after or before you call it?

    -Revise Caps

    -Try to write in the screen "welcomeText" & language and you can see if its correct.

  • I found the problem. I have 3 layouts. In the first layout I've put the Dictionary object and set all instance variables through the property panel (thats the good way, right?).

    When I display the KeyCount in the second layout, it gives 0. Looks like it forgets the instance variables in the second layout... How can I use the Dictionary throughout all my layouts?

    edit: Global is set to On.

  • No, you shouldnt use instance variables in the dictionary. Search in the tutorials how to use it, its very easy.

    Add key "KeyName" with value "value" -> Thats how you see the line for adding entries to the dictionary in the eventsheet

  • It's working. Thanks for your help mate!

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