Register for your free account! | Forgot your password?

You last visited: Today at 16:35

  • Please register to post and access all features, it's quick, easy and FREE!

 

[MEGA RELEASE]MultiLanguage System for Client

Closed Thread
 
Old   #16

 
elite*gold: 83
Join Date: Nov 2013
Posts: 2,870
Received Thanks: 2,696
Quote:
Originally Posted by hsomy View Post
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 



rollback is offline  
Old   #17

 
elite*gold: 1
Join Date: Aug 2014
Posts: 1,378
Received Thanks: 293
Danke ! Sehr nice!


.0x404´Err0xR is offline  
Old   #18
 
elite*gold: 0
Join Date: Jan 2014
Posts: 267
Received Thanks: 361
Quote:
Originally Posted by [Sensenmann] View Post
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
Lefloyd is offline  
Thanks
1 User
Old   #19

 
elite*gold: 83
Join Date: Nov 2013
Posts: 2,870
Received Thanks: 2,696
Quote:
Originally Posted by Lefloyd View Post
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


rollback is offline  
Old   #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!
VeSpacco is offline  
Old   #21
 
elite*gold: 0
Join Date: May 2013
Posts: 345
Received Thanks: 600
Quote:
Originally Posted by VeSpacco View Post
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!",
}
.Sanii is offline  
Thanks
2 Users
Old   #22
 
elite*gold: 0
Join Date: Oct 2013
Posts: 81
Received Thanks: 27
Quote:
Originally Posted by .Sanii View Post
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...."
VeSpacco is offline  
Old   #23
 
elite*gold: 0
Join Date: May 2013
Posts: 345
Received Thanks: 600
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
.Sanii is offline  
Old   #24
 
elite*gold: 0
Join Date: May 2014
Posts: 8
Received Thanks: 1
nice eugen gj
mirceaciurcea is offline  
Old   #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ß
Lemmiwinks # is offline  
Old   #26
 
elite*gold: 0
Join Date: Jan 2011
Posts: 13
Received Thanks: 1
Quote:
Originally Posted by Lefloyd View Post
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
hsomy is offline  
Old   #27

 
elite*gold: 83
Join Date: Nov 2013
Posts: 2,870
Received Thanks: 2,696
Quote:
Originally Posted by Gummibären 123 View Post
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
rollback is offline  
Thanks
1 User
Old   #28
wherever the light ends

 
elite*gold: 244
Join Date: Feb 2011
Posts: 4,875
Received Thanks: 2,786
Quote:
Originally Posted by [Sensenmann] View Post
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] View Post
komisch ... der thread ist schon 1 jahr alt
Weswegen das Thema bereits gemeldet worden ist. (closerequested)

lg


Nick is offline  
Thanks
1 User
Closed Thread



« Previous Thread | Next Thread »

Similar Threads
[Mega Release]IntroLogo Client Tutorial
-----EN----- Hello, I decided make public the IntroLogo sistem of Metin2DR. This system allows put images when you start the client. First...
57 Replies - Metin2 PServer Guides & Strategies
[Release] PixelStealth (Multilanguage Palladium Pixel Bot)
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...
144 Replies - DarkOrbit
[MEGA RELEASE]Automatic Ox-Event System
--]-- quest oxevents begin state start begin function open() if(oxevent.open() == 0) then return 0 elseif(oxevent.open() == 1) then...
25 Replies - Metin2 PServer Guides & Strategies
Perfect World Multilanguage Service(MS) Working Multi Client
its only a multi client for pwms. enjoy ;)
0 Replies - Perfect World



All times are GMT +1. The time now is 16:35.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2017 elitepvpers All Rights Reserved.