Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: About Languages  (Read 4388 times)

0 Members and 1 Guest are viewing this topic.

fsk

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 82
    • View Profile
    • My blog
About Languages
« on: June 28, 2011, 04:04:40 PM »

Hi all!
I have create in my options some flags (greek, english, german for example) as checked box.
So, i want to save in my registry as default.. when i select a language!
Any solution?
Thanks..
Logged

Endrit

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 62
    • View Profile
Re: About Languages
« Reply #1 on: June 28, 2011, 05:35:42 PM »

I think you can use a global variable that change his value by clicking the flag and than you can use a if . (sorry i can give you any script code becouse i don't know if the answer is true )
Logged

Darky

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 109
    • View Profile
    • Spreadcamp
Re: About Languages
« Reply #2 on: June 28, 2011, 06:37:33 PM »

I think Endrit is on the right track. I don't do language changes like that but using the WME Registry functions in combination with a global variable should get you to do what you want.

Just remember, that you can't change language at runtime (as far as I know at least)

I'd do it like that (untested!)
I advise looking up the functions I am about to post so that you better understand what I did.

game.script
Code: WME Script
  1. global currentLanguage = Game.RegReadString("lang", "english");
  2.  
  3. // load string tables from language folder subdirectories
  4. // example of folder structure: myLanguages/english/string.tab , myLanguages/greek/string.tab etc.
  5. Game.LoadStringTable("myLanguages/" + currentLanguage + "/string.tab", true);
  6. Game.LoadStringTable("myLanguages/" + currentLanguage + "/dialogues.tab", true);
  7.  
  8. // if you want to change voices, too, then something like that as well
  9. Game.AddSpeechDir("myLanguages/" + currentLanguage + "/voices");
  10.  

In your Options script where you change language
Code: WME Script
  1. global currentLanguage;
  2.  
  3. on "GreekButtonName"
  4. {
  5.     currentLanguage = Game.RegWriteString("lang", "greek");
  6.     RestartWarning();
  7. }
  8.  
  9. on "GermanButtonName"
  10. {
  11.     currentLanguage = Game.RegWriteString("lang", "german");
  12.     RestartWarning();
  13. }
  14.  
  15. // make a window that informs user that a restart is needed
  16. function RestartWarning()
  17. {
  18.     // insert your window load code here
  19. }
  20.  
Logged

fsk

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 82
    • View Profile
    • My blog
Re: About Languages
« Reply #3 on: June 28, 2011, 09:44:08 PM »

Thanks for replay!  ::rock
Logged

Spellbreaker

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Gender: Male
  • Posts: 376
    • View Profile
    • Apeiron Studios
Re: About Languages
« Reply #4 on: June 29, 2011, 03:47:58 PM »

The Restart warning is not necessery.


Greets,

Spellbreaker
Logged
 

Page created in 0.027 seconds with 25 queries.