Jump to content

Client Locale String


Recommended Posts

  • Premium

M2 Download Center

This is the hidden content, please
  ( Internal )

This is the hidden content, please
  ( GitHub )

This is the hidden content, please

Edited by Sonitex
Added usage example
  • Metin2 Dev 173
  • kekw 3
  • Eyes 1
  • Dislove 4
  • Angry 4
  • Not Good 2
  • Sad 2
  • Cry 2
  • Think 6
  • Confused 9
  • Lmao 2
  • Good 82
  • Love 9
  • Love 211
Link to comment
Share on other sites

  • Premium
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 comment
Share on other sites

			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

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Premium

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 comment
Share on other sites

  • 2 weeks later...
  • Premium
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 comment
Share on other sites

  • 2 weeks later...
  • Premium
On 12/3/2020 at 11:51 AM, Sonitex said:

M2 Download Center

This is the hidden content, please
  ( Internal )

This is the hidden content, please
  ( 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 comment
Share on other sites

  • 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 comment
Share on other sites



×
×
  • 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.