|
You last visited: Today at 01:18
Advertisement
[MEGA RELEASE]MultiLanguage System for Client
Discussion on [MEGA RELEASE]MultiLanguage System for Client within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.
02/10/2015, 07:03
|
#16
|
elite*gold: 83
Join Date: Nov 2013
Posts: 2,891
Received Thanks: 2,764
|
Quote:
Originally Posted by hsomy
How to translate quests?
|
You could ask the player which language he wants at his first login and save it in the database via mysql_query. Then youre running the select query before every quest starts and depending on the entry in your db the quest will start in another language.
EDIT:
example quest:
PHP Code:
quest firstlogin begin state start begin when login with pc.get_level() == 1 begin say("Language?") local s = select("Deutsch", "English", "Spanish") mysql_query("INSERT INTO player.language (player_id, language_id) VALUES ("..pc.get_player_id..", "..s..");") set_state(_COMPLETE_) end end state _COMPLETE_ begin end end
quest example begin state start begin when login or kill with pc.get_level() >= 25 begin local language = mysql_query("SELECT language_id FROM player.language WHERE player_id = "..pc.get_player_id()..";") if language == 1 then set_state(quest_german) elseif language == 2 then set_state(quest_english) elseif language == 3 then set_state(quest_spanish) end end end state quest_german begin when letter begin send_letter("Hallo Welt!") end when button or info begin say("Hallo Welt!") say("Willkommen!") end end state quest_english begin when letter begin send_letter("Hello World!") end when button or info begin say("Hello World!") say("Welcome!") end end state quest_spanish begin when letter begin send_letter("Hola mundo!") end when button or info begin say("Hola mundo!") say("Bienvenida!") end end end
|
|
|
02/10/2015, 12:29
|
#17
|
elite*gold: 103
Join Date: Aug 2014
Posts: 1,425
Received Thanks: 315
|
Danke ! Sehr nice!
|
|
|
02/10/2015, 12:30
|
#18
|
elite*gold: 0
Join Date: Jan 2014
Posts: 268
Received Thanks: 373
|
Quote:
Originally Posted by [Sensenmann]
You could ask the player which language he wants at his first login and save it in the database via mysql_query. Then youre running the select query before every quest starts and depending on the entry in your db the quest will start in another language.
EDIT:
example quest:
PHP Code:
quest firstlogin begin
state start begin
when login with pc.get_level() == 1 begin
say("Language?")
local s = select("Deutsch", "English", "Spanish")
mysql_query("INSERT INTO player.language (player_id, language_id) VALUES ("..pc.get_player_id..", "..s..");")
set_state(_COMPLETE_)
end
end
state _COMPLETE_ begin
end
end
quest example begin
state start begin
when login or kill with pc.get_level() >= 25 begin
local language = mysql_query("SELECT language_id FROM player.language WHERE player_id = "..pc.get_player_id()..";")
if language == 1 then
set_state(quest_german)
elseif language == 2 then
set_state(quest_english)
elseif language == 3 then
set_state(quest_spanish)
end
end
end
state quest_german begin
when letter begin
send_letter("Hallo Welt!")
end
when button or info begin
say("Hallo Welt!")
say("Willkommen!")
end
end
state quest_english begin
when letter begin
send_letter("Hello World!")
end
when button or info begin
say("Hello World!")
say("Welcome!")
end
end
state quest_spanish begin
when letter begin
send_letter("Hola mundo!")
end
when button or info begin
say("Hola mundo!")
say("Bienvenida!")
end
end
end
|
I'd rather use the quest flags for this - you don't need to use querys everytime..^^
Quest1:
Code:
quest language begin
state start begin
when letter begin
send_letter("Choose language")
end
when button or info begin
say_title("Choose language")
say("Hello "..pc.get_name().."!")
say("You can choose your language of")
say("your quests. The default language is")
say("english as you can see but we have")
say("more options to offer.")
say("Please choose your main language.")
say("")
local lang = select("English", "German", "Exit")
if lang == 3 then
return
end
pc.setqf("lang", lang - 1)
say_title("Language chosen")
say("Thank you. We will save your selection")
say("and the quests will be in this language")
say("now.")
say("")
complete_quest()
end
end
state __COMPLETE__ begin
end
end
Example Quest 2 with language selection:
Code:
quest kill begin
state start begin
when letter begin
local lang = pc.getf("language", "lang")
if lang == 0 then
send_letter("Quest 1")
elseif lang == 1 then
send_letter("Aufgabe 1")
end
end
when button or info begin
local lang = pc.getf("language", "lang")
if lang == 0 then
say_title("Quest 1")
say("Go and kill five wilddogs.")
say("Return to the smith if you have")
say("successfully completed the task.")
say("")
elseif lang == 1 then
say_title("Aufgabe 1")
say("Töte fünf Wildhunde und kehre")
say("danach zum Schmied zurück.")
say("")
end
end
end
end
(well I was too lazy to complete this quest q_q)
Kind Regards
|
|
|
02/10/2015, 13:00
|
#19
|
elite*gold: 83
Join Date: Nov 2013
Posts: 2,891
Received Thanks: 2,764
|
Quote:
Originally Posted by Lefloyd
I'd rather use the quest flags for this - you don't need to use querys everytime..^^
Quest1:
[...](well I was too lazy to complete this quest q_q)
Kind Regards
|
Mit
PHP Code:
pc.getqf("questname", "flagname")
kann man questflags aus anderen Quests auslesen? *-*
Wusste ich noch nicht, hätte es sonst auch so gemacht
|
|
|
02/10/2015, 13:34
|
#20
|
elite*gold: 0
Join Date: Oct 2013
Posts: 81
Received Thanks: 27
|
How about the text like "You received item x"? It's seems that multilanguage system can't work in this way, or maybe we need to modify the show mode of those message!
|
|
|
02/10/2015, 14:06
|
#21
|
elite*gold: 0
Join Date: May 2013
Posts: 353
Received Thanks: 621
|
Quote:
Originally Posted by VeSpacco
How about the text like "You received item x"? It's seems that multilanguage system can't work in this way, or maybe we need to modify the show mode of those message!
|
OH MY FKN *** ! You wrote your own text to that topic? Im so proud!...
For this Strings you have the locale_string.txt
b2t:
It`s a nice System! But Serverside i would prefer a Questfunc which reads variables in .txt or sth. like locale.lua
For ex.:
Code:
say(GetTextByLanguage("EXAMPLE_VALUE"))
and in the new "locale"-File sth like this:
Code:
#Syntax is not right i think, its only the idea ;)
{"de",
"EXAMPLE_VALUE" : "Das ist ein Beispiel!",
}
{"en",
"EXAMPLE_VALUE" : "This is an example!",
}
|
|
|
02/10/2015, 15:41
|
#22
|
elite*gold: 0
Join Date: Oct 2013
Posts: 81
Received Thanks: 27
|
Quote:
Originally Posted by .Sanii
OH MY FKN *** ! You wrote your own text to that topic? Im so proud!...
For this Strings you have the locale_string.txt
[/code]
|
Ahahah!
Yes, I've locale_string.txt, but it's "global", I think that: for make a multilanguage system for locale_string it's needed to modify the server code, and add a variable that represent the language of the player, and so the server choose the better locale_string for the right player, or the easiest way maybe can be a string like this "You have received the %s item - Usted ha recibido el artículo % s - Vous avez reçu l'élément % s...."
|
|
|
02/10/2015, 15:49
|
#23
|
elite*gold: 0
Join Date: May 2013
Posts: 353
Received Thanks: 621
|
A String like your example is possible, but it is bad splitting of the string.
i would say: if you have the source, modify the complete LC_TEXT Funktion which reads the locale_string in the gamesource, and use the players language variable.
Then you put in the strings in the File which example i have posted before, so you can use 1 file for quests and game and all languages
Maybe i will try to make this in the next days
|
|
|
02/10/2015, 16:01
|
#24
|
elite*gold: 0
Join Date: May 2014
Posts: 8
Received Thanks: 1
|
nice eugen gj
|
|
|
02/10/2015, 16:16
|
#25
|
elite*gold: 0
Join Date: Jan 2015
Posts: 310
Received Thanks: 117
|
Das was mir auffällt ist das es Shiro2 gestern als erstes hatte und es 1 Tag später releasd wird. Welcher geniale Kopf hat es gerript x3? Oder habt ihr es auch türkischen Foren gezogen?
Gruß
|
|
|
02/10/2015, 16:20
|
#26
|
elite*gold: 0
Join Date: Jan 2011
Posts: 13
Received Thanks: 2
|
Quote:
Originally Posted by Lefloyd
I'd rather use the quest flags for this - you don't need to use querys everytime..^^
Quest1:
Code:
quest language begin
state start begin
when letter begin
send_letter("Choose language")
end
when button or info begin
say_title("Choose language")
say("Hello "..pc.get_name().."!")
say("You can choose your language of")
say("your quests. The default language is")
say("english as you can see but we have")
say("more options to offer.")
say("Please choose your main language.")
say("")
local lang = select("English", "German", "Exit")
if lang == 3 then
return
end
pc.setqf("lang", lang - 1)
say_title("Language chosen")
say("Thank you. We will save your selection")
say("and the quests will be in this language")
say("now.")
say("")
complete_quest()
end
end
state __COMPLETE__ begin
end
end
Example Quest 2 with language selection:
Code:
quest kill begin
state start begin
when letter begin
local lang = pc.getf("language", "lang")
if lang == 0 then
send_letter("Quest 1")
elseif lang == 1 then
send_letter("Aufgabe 1")
end
end
when button or info begin
local lang = pc.getf("language", "lang")
if lang == 0 then
say_title("Quest 1")
say("Go and kill five wilddogs.")
say("Return to the smith if you have")
say("successfully completed the task.")
say("")
elseif lang == 1 then
say_title("Aufgabe 1")
say("Töte fünf Wildhunde und kehre")
say("danach zum Schmied zurück.")
say("")
end
end
end
end
(well I was too lazy to complete this quest q_q)
Kind Regards
|
Thanks for helping i'll use your quest i have one last question what about ox event? Is there chance to translate questions and show the users language
|
|
|
02/10/2015, 17:40
|
#27
|
elite*gold: 83
Join Date: Nov 2013
Posts: 2,891
Received Thanks: 2,764
|
Quote:
Originally Posted by Gummibären 123
Das was mir auffällt ist das es Shiro2 gestern als erstes hatte und es 1 Tag später releasd wird. Welcher geniale Kopf hat es gerript x3? Oder habt ihr es auch türkischen Foren gezogen?
Gruß
|
komisch ... der thread ist schon 1 jahr alt
|
|
|
02/10/2015, 22:22
|
#28
|
wild wild son
elite*gold: 0
Join Date: Feb 2011
Posts: 5,996
Received Thanks: 3,391
|
Quote:
Originally Posted by [Sensenmann]
Mit
PHP Code:
pc.getqf("questname", "flagname")
kann man questflags aus anderen Quests auslesen? *-*
Wusste ich noch nicht, hätte es sonst auch so gemacht 
|
Sollte soweit mit pc. getf(string questName, string flagName) möglich sein.
Quote:
Originally Posted by [Sensenmann]
komisch ... der thread ist schon 1 jahr alt 
|
Weswegen das Thema bereits gemeldet worden ist. (closerequested)
lg
|
|
|
 |
|
Similar Threads
|
[Mega Release]IntroLogo Client Tutorial
11/30/2016 - Metin2 PServer Guides & Strategies - 57 Replies
-----EN-----
Hello,
I decided make public the IntroLogo sistem of Metin2DR.
This system allows put images when you start the client.
First you need download the resources.
Please, be carrefully with the "TABS".
|
[Release] PixelStealth (Multilanguage Palladium Pixel Bot)
06/24/2015 - DarkOrbit - 144 Replies
Hello I am Patrik and I created and edited easy palladium bot which is free for everyone :)
http://i.imgur.com/OyCFsVl.png
Why PixelStealth? My pixelbot collect Palladium like OpenStealth. Do not believe me? Test it :)
How to start:
1.) Download the * .rar file
2.) Unpack the *.rar file
|
[MEGA RELEASE]Automatic Ox-Event System
03/23/2013 - Metin2 PServer Guides & Strategies - 25 Replies
--]--
quest oxevents begin
state start begin
function open()
if(oxevent.open() == 0) then
return 0
elseif(oxevent.open() == 1) then
return 1
else
|
Perfect World Multilanguage Service(MS) Working Multi Client
09/17/2010 - Perfect World - 0 Replies
its only a multi client for pwms. enjoy ;)
|
All times are GMT +1. The time now is 01:19.
|
|