Jump to content

Recommended Posts

  • Active+ Member
2 hours ago, Jimmermania said:

Any idea why this is happening?

.png

Its at disconnect for example. I made it like this: [LS;509];%d

You're simply doing it wrong. See the examples in the archive.

Example: [LS;509;%d], datathatpointsto%d

  • 2 weeks later...
  • 1 month later...

With some work it can be left impeccable, the items collected, the hyperlink, the quests, the strings, everything working correctly, something may be missing but so far everything is perfect, thank you very much.

Captura-de-pantalla-2024-05-23-215403.pn

 

Edited by Metin2 Dev International
Core X - External 2 Internal
  • Love 1

Anotaci-n-2024-06-28-185820.png

 

 

  • 2 months later...
  • Developer
On 3/22/2024 at 1:53 AM, 4peppe said:

If applied correctly, everything works fine;
To also have the translations of the items in the strings you need to replace in
 

server -> conf -> item_names.txt

the item names with [IN;VALUEOFITEM]

The only flaw I'm finding is that it translates the names of the mobs but not those of the npcs;

Since you use [IN;VNUM] in the various ChatPacket(s), there is no point in changing all the names in item_names.txt svside to \t[IN:{}]
maybe somewhere you're using item->GetName() as fmt instead ot item->GetVnum() to get in [IN;{}]

spacer.png

Edited by Mitachi
Removed npc part
  • Metin2 Dev 9
  • Good 1
  • Love 2

Villains are not born, they are made.
Join

  • Active+ Member
5 hours ago, Mitachi said:

Since you use [IN;VNUM] in the various ChatPacket(s), there is no point in changing all the names in item_names.txt svside to \t[IN:{}]
maybe somewhere you're using item->GetName() as fmt instead ot item->GetVnum() to get in [IN;{}]

spacer.png

Anyway, this solve the problem about NPC translations, although I have not delved yet into why they did it;

 

Hidden Content

 

// in Srcs\Client\UserInterface\PythonNetworkStreamPhaseGameActor.cpp

	if(kNetActorData.m_bType != CActorInstance::TYPE_PC && 
		kNetActorData.m_bType != CActorInstance::TYPE_NPC)
	{
		const char * c_szName;
		CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();
		if (rkNonPlayer.GetName(kNetActorData.m_dwRace, &c_szName))
			kNetActorData.m_stName = c_szName;
		//else
		//	kNetActorData.m_stName=chrAddPacket.name;

		__RecvCharacterAppendPacket(&kNetActorData);
	}
	else
	{
		s_kNetActorData = kNetActorData;
	}

// remove the TYPE_NPC from the if, like this:

	if(kNetActorData.m_bType != CActorInstance::TYPE_PC && 
		kNetActorData.m_bType != CActorInstance::TYPE_NPC)
	{

// to

	if (kNetActorData.m_bType != CActorInstance::TYPE_PC)
	{

 

 

What a legend you are. Works like a charm.

  • Love 1
On 8/14/2024 at 3:01 PM, Mitachi said:

Dado que utiliza [IN;VNUM] en los distintos ChatPacket(s), no tiene sentido cambiar todos los nombres en item_names.txt svside a \t[IN:{}]
tal vez en algún lugar esté usando item->GetName() como fmt en lugar de item->GetVnum() para obtener [IN;{}]

espaciador.png

De todos modos, esto resuelve el problema sobre las traducciones de los NPC, aunque aún no he profundizado en por qué lo hicieron, lo
hicieron para el nombre del caballo, gracias. @Desbloat para el informe, parche;

Contenido oculto

 



	  
	
		  
		
		  
		
		

	
	
	
	



	     
		    
	

	   
	
		  
		  
	
	
	
	

 

 

I use another method for NPC names, the "problem" is with the horse, that it will no longer say ADMIN's Horse, but will take the name of the horse's NPC, for example White Horse.

search 1.0:
bool CPythonNetworkStream::RecvCharacterAdditionalInfo()

search 1.1:
		kNetActorData.m_stName		= chrInfoPacket.name;

replace:
#if defined(ENABLE_MULTI_LANGUAGE)
		const char* c_szName;
		if (CPythonNonPlayer::Instance().GetName(kNetActorData.m_dwRace, &c_szName))
			kNetActorData.m_stName = c_szName;
		else
			kNetActorData.m_stName	= chrInfoPacket.name;
#else
		kNetActorData.m_stName		= chrInfoPacket.name;
#endif

 

Anotaci-n-2024-08-15-202122.png

Edited by Metin2 Dev International
Core X - External 2 Internal

Anotaci-n-2024-06-28-185820.png

 

 

  • Active+ Member
9 hours ago, josehdelaro said:

I use another method for NPC names, the "problem" is with the horse, that it will no longer say ADMIN's Horse, but will take the name of the horse's NPC, for example White Horse.

search 1.0:
bool CPythonNetworkStream::RecvCharacterAdditionalInfo()

search 1.1:
		kNetActorData.m_stName		= chrInfoPacket.name;

replace:
#if defined(ENABLE_MULTI_LANGUAGE)
		const char* c_szName;
		if (CPythonNonPlayer::Instance().GetName(kNetActorData.m_dwRace, &c_szName))
			kNetActorData.m_stName = c_szName;
		else
			kNetActorData.m_stName	= chrInfoPacket.name;
#else
		kNetActorData.m_stName		= chrInfoPacket.name;
#endif

 

Anotaci-n-2024-08-15-202122.png

 

You can add the @fix11 to your function to fix your horse and pet names. Credits: mmotutkunlari-whistle

bool CPythonNetworkStream::RecvCharacterAdditionalInfo()
{
	TPacketGCCharacterAdditionalInfo chrInfoPacket;
	if (!Recv (sizeof (chrInfoPacket), &chrInfoPacket))
	{
		return false;
	}


	SNetworkActorData kNetActorData = s_kNetActorData;
	if (IsInvisibleRace (kNetActorData.m_dwRace))
	{
		return true;
	}

	if (kNetActorData.m_dwVID == chrInfoPacket.dwVID)
	{
		// @fix11
		if (kNetActorData.m_bType == CActorInstance::TYPE_NPC)
		{
			CPythonLocale::Instance().FormatString (chrInfoPacket.name, sizeof (chrInfoPacket.name));
		}
		// END @fix11

		kNetActorData.m_stName = chrInfoPacket.name;
		kNetActorData.m_dwGuildID = chrInfoPacket.dwGuildID;
		kNetActorData.m_dwLevel = chrInfoPacket.dwLevel;
		kNetActorData.m_sAlignment=chrInfoPacket.sAlignment;
		kNetActorData.m_byPKMode=chrInfoPacket.bPKMode;
		kNetActorData.m_dwGuildID=chrInfoPacket.dwGuildID;
		kNetActorData.m_dwEmpireID=chrInfoPacket.bEmpire;
		kNetActorData.m_dwArmor=chrInfoPacket.awPart[CHR_EQUIPPART_ARMOR];
		kNetActorData.m_dwWeapon=chrInfoPacket.awPart[CHR_EQUIPPART_WEAPON];
		kNetActorData.m_dwHair=chrInfoPacket.awPart[CHR_EQUIPPART_HAIR];
		kNetActorData.m_dwMountVnum=chrInfoPacket.dwMountVnum;

		__RecvCharacterAppendPacket (&kNetActorData);
	}
	else
	{
		TraceError ("TPacketGCCharacterAdditionalInfo name=%s vid=%d race=%d Error", chrInfoPacket.name, chrInfoPacket.dwVID, kNetActorData.m_dwRace);
	}
	return true;
}

 

  • Metin2 Dev 1
15 hours ago, Debloat said:

 

You can add the @fix11 to your function to fix your horse and pet names. Credits: mmotutkunlari-whistle

bool CPythonNetworkStream::RecvCharacterAdditionalInfo()
{
	TPacketGCCharacterAdditionalInfo chrInfoPacket;
	if (!Recv (sizeof (chrInfoPacket), &chrInfoPacket))
	{
		return false;
	}


	SNetworkActorData kNetActorData = s_kNetActorData;
	if (IsInvisibleRace (kNetActorData.m_dwRace))
	{
		return true;
	}

	if (kNetActorData.m_dwVID == chrInfoPacket.dwVID)
	{
		// @fix11
		if (kNetActorData.m_bType == CActorInstance::TYPE_NPC)
		{
			CPythonLocale::Instance().FormatString (chrInfoPacket.name, sizeof (chrInfoPacket.name));
		}
		// END @fix11

		kNetActorData.m_stName = chrInfoPacket.name;
		kNetActorData.m_dwGuildID = chrInfoPacket.dwGuildID;
		kNetActorData.m_dwLevel = chrInfoPacket.dwLevel;
		kNetActorData.m_sAlignment=chrInfoPacket.sAlignment;
		kNetActorData.m_byPKMode=chrInfoPacket.bPKMode;
		kNetActorData.m_dwGuildID=chrInfoPacket.dwGuildID;
		kNetActorData.m_dwEmpireID=chrInfoPacket.bEmpire;
		kNetActorData.m_dwArmor=chrInfoPacket.awPart[CHR_EQUIPPART_ARMOR];
		kNetActorData.m_dwWeapon=chrInfoPacket.awPart[CHR_EQUIPPART_WEAPON];
		kNetActorData.m_dwHair=chrInfoPacket.awPart[CHR_EQUIPPART_HAIR];
		kNetActorData.m_dwMountVnum=chrInfoPacket.dwMountVnum;

		__RecvCharacterAppendPacket (&kNetActorData);
	}
	else
	{
		TraceError ("TPacketGCCharacterAdditionalInfo name=%s vid=%d race=%d Error", chrInfoPacket.name, chrInfoPacket.dwVID, kNetActorData.m_dwRace);
	}
	return true;
}

 

Thanks in the end I had a problem because the pet only showed me the name of the pet and if I tried to use the fix that they gave above I got sysser in the client, in the end I simply fixed it this way and it seems to work perfectly, I'm not an expert in code but I just adapted the fix that they gave before where I have modified it along with the fix that you gave, if it's wrong I would appreciate it if you said it xd

search:
		kNetActorData.m_stName		= chrInfoPacket.name;

replace:
#if defined(ENABLE_MULTI_LANGUAGE)
		if (kNetActorData.m_bType == CActorInstance::TYPE_NPC)
		{
			CPythonLocale::Instance().FormatString(chrInfoPacket.name, sizeof(chrInfoPacket.name));
		}

		auto IsHorseRace = [](DWORD vnum) noexcept {
			return (vnum >= 20101 && vnum <= 20109);
		};

		auto IsPetRace = [](DWORD vnum) noexcept {
			return (vnum >= 34001 && vnum <= 34099);
		};

		if (kNetActorData.m_bType != CActorInstance::TYPE_PC && 
			!IsHorseRace(kNetActorData.m_dwRace) && 
			!IsPetRace(kNetActorData.m_dwRace))
		{
			const char* c_szName = nullptr;
			if (CPythonNonPlayer::Instance().GetName(kNetActorData.m_dwRace, &c_szName))
			{
				kNetActorData.m_stName = c_szName;
			}
			__RecvCharacterAppendPacket(&kNetActorData);
		}
		else
		{
			kNetActorData.m_stName	= chrInfoPacket.name;
		}
#else
		kNetActorData.m_stName		= chrInfoPacket.name;
#endif

Anotaci-n-2024-08-16-205617.png

 

Edited by Metin2 Dev International
Core X - External 2 Internal

Anotaci-n-2024-06-28-185820.png

 

 

  • 4 weeks later...
On 10/29/2022 at 11:30 PM, Mali said:

This is the hidden content, please
 or 
This is the hidden content, please

.png

 

0911 19:47:52106 :: CPythonLocale::ReplaceQuestLocaleString: Error: boost::too_many_args: format-string referred to fewer arguments than were passed
0911 19:47:54805 :: CPythonLocale::ReplaceQuestLocaleString: Error: boost::too_many_args: format-string referred to fewer arguments than were passed ?? my syserr

  • 5 months later...

Hi guys.

I installed it and it worked on my src but due to an error on my pc my ssd was damaged and I had to start over. When I reinstall it it gives me this error when compiling

input_p2p.cpp:237:3: error: unknown type name 'TEMP_BUFFER'
  237 |                 TEMP_BUFFER buf;

  • Premium
On 2/27/2025 at 5:48 AM, shampoo said:

Hi guys.

I installed it and it worked on my src but due to an error on my pc my ssd was damaged and I had to start over. When I reinstall it it gives me this error when compiling

input_p2p.cpp:237:3: error: unknown type name 'TEMP_BUFFER'
  237 |                 TEMP_BUFFER buf;

Hello i had this syserr too,

You have to add :

"Import buffer_manager.h"

In input_p2p.cpp.

EDIT regarding NPC names load from mob proto client side : 

I had an issue with reading NPC names from mob proto client side.

With Mitachi fix everything was perfect but my horse name was like : "*MycharacterName* [LS;888]"

wich is pretty (lol) but  look rough.

adding debload fix11:

Quote
// @fix11 
if (kNetActorData.m_bType == CActorInstance::TYPE_NPC) 
{ 
  CPythonLocale::Instance().FormatString (chrInfoPacket.name, sizeof (chrInfoPacket.name)); 
} 
// END @fix11

 

fixed that issue but I still had another issue as Josehdelaro:

Quote

if I tried to use the fix that they gave above I got sysser in the client,

there was a lot of syserr coming from this in bool CPythonNetworkStream::RecvCharacterAdditionalInfo():
 

TraceError("TPacketGCCharacterAdditionalInfo name=%s vid=%d race=%d Error",chrInfoPacket.name,chrInfoPacket.dwVID,kNetActorData.m_dwRace);

 

So looking in the forum i remembered that TMP4 post this in Rakancito Multilanguage topic :

 

Quote

 

Make NPC names load from clientside mob_proto:

Look for CPythonNetworkStream::__RecvCharacterAppendPacket in PythonNetworkStreamPhaseGameActor.cpp

Add this to the begginning of the function:

 
#ifdef ENABLE_MULTILANGUAGE
	if (pkNetActorData->m_bType == CActorInstance::TYPE_NPC && !(pkNetActorData->m_dwRace >= 20101 && pkNetActorData->m_dwRace <= 20109) && !(pkNetActorData->m_dwRace >= 34001 && pkNetActorData->m_dwRace <= 34099)) // load npc names from clientside
	{
		const char* c_szName;
		CPythonNonPlayer& rkNonPlayer = CPythonNonPlayer::Instance();
		if (rkNonPlayer.GetName(pkNetActorData->m_dwRace, &c_szName))
			pkNetActorData->m_stName = c_szName;
	}
#endif

 

I take both debloat Fix11 and TMP4 way for reading mob names from Client proto, and now everything is fine and i got no syserr client.

 

I don't doubt that Josehdelaro way of doing it work also for the syserr but i didn't tried it.

 

I don't know if this is a good way so i'll gladly take any opinion about it.

Best regards Ariver 

Edited by ARiver
added my npc name mob proto issue
  • Good 1
  • Love 1
  • 6 months later...

spacer.pngspacer.png

 

hello to all

i try so many times but i cant make it Large Map npc names to work from client mob proto

mini map works perfectly mobs and npcs horse names everythink just Large Map is the problem i tried GF new atlas functions no succes.

Thanks to all wait for solution.

  • Active+ Member
On 9/1/2025 at 2:16 AM, silence said:

spacer.pngspacer.png

 

hello to all

i try so many times but i cant make it Large Map npc names to work from client mob proto

mini map works perfectly mobs and npcs horse names everythink just Large Map is the problem i tried GF new atlas functions no succes.

Thanks to all wait for solution.

 

  • Metin2 Dev 1
  • 5 months later...
  • 3 months later...

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.