Jump to content

Client Locale String


Recommended Posts

  • VIP
6 hours ago, newreboot said:

Please can u explain how to use it?

I already compiled the source, and added the locale_string on client, But nothing changed. still reading from my locale_string on serverside...

 

You need to use LocaleChatPacket instead of ChatPacket. 

Link to post
			pkChar->LocaleChatPacket(CHAT_TYPE_INFO, "%d %s %s", m_vec_quiz[i][j].level, m_vec_quiz[i][j].Quiz, m_vec_quiz[i][j].answer ? LC_TEXT("Âü") : LC_TEXT("°ÅÁþ"));
		}
	}

	pkChar->LocaleChatPacket(CHAT_TYPE_INFO, LC_TEXT("ÃÑ ÄûÁî ¼ö: %d"), c);

well i changed the ChatPacket to LocaleChatPacket and give me error on copilation.

The error:

spacer.png

Link to post
  • VIP

Yeah because you have to pass index of the string as an argument. In your case, the bottom part of your code should look like this:

 

pkChar->ChatPacket(CHAT_TYPE_INFO, 880, LC_TEXT("Total number of the Quiz: %d"), c);	

Or:

pkChar->ChatPacket(CHAT_TYPE_INFO, 880, "Total number of the Quiz: %d", c);	

 

Also, this does not support quiz strings. Those are stored in a separate file called locale_quiz.txt and additional changes are needed for it to be usable. This release only supports strings that are inside locale_string text files.

Edited by Sonitex
Link to post
  • 2 weeks later...
  • VIP
5 minutes ago, DrTurk said:

@Sonitex

How do you declare from which locale_string.txt it should load the information?

My locale_string.txt is located in /locale/de

1217 19:56:49074 :: CPythonLocaleString::FindLocaleString: cannot find "1";

 

 

It should be automatically loaded from an active locale path 🤔

  • Love 1
Link to post
  • 2 weeks later...
  • VIP
On 12/3/2020 at 11:51 AM, Sonitex said:

M2 Download Center

Download Here  ( Internal )

Download Here  ( GitHub )

 

Hidden Content

 

Metin2 general format specifiers have been added such as %d, %u, %s, %lu, %lld and %f. If you wish to add others, edit the table. Flags, precision and width parameters have not been implemented because they weren't really used besides floating numbers which are always set to 2 decimals places precision. You can also use this as a template for quest strings, which have been moved to client side on official servers.

 

Chat function takes 3 main arguments:

 

You can modify it's structure to your likings. You can use the default structure which takes chat type and string as arguments and find index of the string in the function it self. Without string index, client will not be able to find the right string. Without string, server will not be able to find format specifiers and pull arguments to send them to client. 

 

    • Chat type,
    • String index,
    • String.

 

thanks but can you make an example about how to use this? for the new people.

🙂

Link to post
  • 5 weeks later...
ChatPacket(CHAT_TYPE_INFO,LC_TEXT ("You can't drop this item because is binded!"));

in that one i did that for test it from locale 

ChatPacket(CHAT_TYPE_INFO, 22219, "dd");

but i got error so how i can do it for that to make it call from locale

i fixed this error i was must use LocaleChatPacket

 

new error

CPythonLocaleString::FindLocaleString: cannot find "22219";

and i have 22219 in my srting 

Edited by LeMo

Lets Go Yes GIF by The Lonely Island

Link to post
4 minutes ago, Kafa said:

I tested it and it works perfect.

i know its work fine from server side but i do not know why cant load from client and everything is good 

Edited by LeMo

Lets Go Yes GIF by The Lonely Island

Link to post
2 hours ago, Mali61 said:

You could expand the topic for locale_quest.txt and locale_quiz.txt

keep it up, nice work 👌

As far as i remember, at the time when he released this topic those things were not there

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



Shoutbox

Shoutbox

Chatroom Rules

 

Join our Discord

A request for help = Shoutbox Ban

Be respectful & Respect the rules

 

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.