September 09, 2024, 05:57:38 AM
Welcome,
Guest
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Latest WME version:
WME 1.9.1
(January 1st, 2010) -
download
Home
Help
Search
Calendar
Login
Register
Wintermute Engine Forum
>
Wintermute Engine
>
Technical forum
>
Topic:
About Languages
« previous
next »
Pages: [
1
]
Print
Author
Topic: About Languages (Read 4732 times)
0 Members and 1 Guest are viewing this topic.
fsk
Occasional poster
Karma: 0
Offline
Gender:
Posts: 82
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
Gender:
Posts: 62
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
Gender:
Posts: 109
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
global
currentLanguage =
Game
.
RegReadString
(
"lang"
,
"english"
)
;
// load string tables from language folder subdirectories
// example of folder structure: myLanguages/english/string.tab , myLanguages/greek/string.tab etc.
Game
.
LoadStringTable
(
"myLanguages/"
+ currentLanguage +
"/string.tab"
,
true
)
;
Game
.
LoadStringTable
(
"myLanguages/"
+ currentLanguage +
"/dialogues.tab"
,
true
)
;
// if you want to change voices, too, then something like that as well
Game
.
AddSpeechDir
(
"myLanguages/"
+ currentLanguage +
"/voices"
)
;
In your Options script where you change language
Code: WME Script
global
currentLanguage;
on
"GreekButtonName"
{
currentLanguage =
Game
.
RegWriteString
(
"lang"
,
"greek"
)
;
RestartWarning
(
)
;
}
on
"GermanButtonName"
{
currentLanguage =
Game
.
RegWriteString
(
"lang"
,
"german"
)
;
RestartWarning
(
)
;
}
// make a window that informs user that a restart is needed
function
RestartWarning
(
)
{
// insert your window load code here
}
Logged
Spreadcamp.com
| First Game:
Space Madness
fsk
Occasional poster
Karma: 0
Offline
Gender:
Posts: 82
Re: About Languages
«
Reply #3 on:
June 28, 2011, 09:44:08 PM »
Thanks for replay!
Logged
Spellbreaker
Supporter
Frequent poster
Karma: 4
Offline
Gender:
Posts: 376
Re: About Languages
«
Reply #4 on:
June 29, 2011, 03:47:58 PM »
The Restart warning is not necessery.
Greets,
Spellbreaker
Logged
Apeiron Studios
http://www.apeironstudios.com
Print
Pages: [
1
]
« previous
next »
Wintermute Engine Forum
>
Wintermute Engine
>
Technical forum
>
Topic:
About Languages