Jump to content

Fix LoadMonsterAreaInfo


elroyino

Recommended Posts

Hi devs!

Today im gonna show you how to delete LoadMonsterAreaInfo syserr error! (This error is just ridiculous...)

#1 Go to the client binary and go

  • clientbinary/GameLib/

#2 Search for:

  • MapOutdoorLoad.cpp

#3 Search for:

  • bool CMapOutdoor::Load(float x, float y, float z)

#4 Search for:

  • if (!LoadMonsterAreaInfo())
  • TraceError("CMapOutdoor::Load - LoadMonsterAreaInfo ERROR");

And Delete the whole if with TraceError!

626942301N_vtelen_www.kepfeltoltes.hu_.p

 

Now build your binary and no more LoadMonsterAreaInfo ERROR

I hope i helped you a bit

 

Best regards RoyinardoDaVinci! ^_^^_^

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Lmao 1
  • Love 3
Link to comment
Share on other sites

At first, LoadMonsterAreInfo's first error is coming from regen.txt. If you don't have this file in your pack. System will give this error. As galet said, you're just hidding that.

 

	char c_szFileName[256];
	sprintf(c_szFileName, "%s\\regen.txt", GetMapDataDirectory().c_str());
	
	LPCVOID pModelData;
	CMappedFile File;
	
	if (!CEterPackManager::Instance().Get(File, c_szFileName, &pModelData))
	{
		//TraceError(" CMapOutdoorAccessor::LoadMonsterAreaInfo Load File %s ERROR", c_szFileName);
		return false;
	}

 The code is already explain itself.

If you want to fix it, here is a fix for you.

 

bool CMapOutdoor::LoadMonsterAreaInfo()
{
	RemoveAllMonsterInfo(); // Remove All Monster Info
	
	char szFileName[256];
	_snprintf(szFileName, sizeof(szFileName), "%s\\monsterareainfo.txt", GetMapDataDirectory().c_str());
	
	LPCVOID pModelData;
	CMappedFile File;
	
	if (!CEterPackManager::Instance().Get(File, szFileName, &pModelData)) return false;
	
	CMemoryTextFileLoader textFileLoader;
	CTokenVector stTokenVector;
	
	textFileLoader.Bind(File.size(), pModelData);
	
	for (DWORD i = 0; i < textFileLoader.GetLineCount(); ++i)
	{
		if (!textFileLoader.SplitLine(i, &stTokenVector))
			continue;
		
		stl_lowers(stTokenVector[0]);
		
		// Start to read MonsterAreaInfo.txt
		if (0 == stTokenVector[0].compare("m") || 0 == stTokenVector[0].compare("g"))
		{
			if (stTokenVector.size() < 11)
			{
				TraceError("CMapOutdoorAccessor::LoadMonsterAreaInfo Get MonsterInfo File Format ERROR! continue....");
				continue;
			}

			CMonsterAreaInfo::EMonsterAreaInfoType eMonsterAreaInfoType;
			if (0 == stTokenVector[0].compare("m"))
			{
				eMonsterAreaInfoType = CMonsterAreaInfo::MONSTERAREAINFOTYPE_MONSTER;
			}
			else if (0 == stTokenVector[0].compare("g"))
			{
				eMonsterAreaInfoType = CMonsterAreaInfo::MONSTERAREAINFOTYPE_GROUP;
			}
			else
			{
				TraceError("CMapOutdoorAccessor::LoadMonsterAreaInfo Get MonsterInfo Data ERROR! continue....");
				continue;
			}
			
			const std::string & c_rstrOriginX	= stTokenVector[1].c_str();
			const std::string & c_rstrOriginY	= stTokenVector[2].c_str();
			const std::string & c_rstrSizeX		= stTokenVector[3].c_str();
			const std::string & c_rstrSizeY		= stTokenVector[4].c_str();
			const std::string & c_rstrZ			= stTokenVector[5].c_str();
			const std::string & c_rstrDir		= stTokenVector[6].c_str();
			const std::string & c_rstrTime		= stTokenVector[7].c_str();
			const std::string & c_rstrPercent	= stTokenVector[8].c_str();
			const std::string & c_rstrCount		= stTokenVector[9].c_str();
			const std::string & c_rstrVID		= stTokenVector[10].c_str();
			
			long lOriginX, lOriginY, lSizeX, lSizeY, lZ, lTime, lPercent;
			CMonsterAreaInfo::EMonsterDir eMonsterDir;
			DWORD dwMonsterCount;
			DWORD dwMonsterVID;
			
			lOriginX		= atol(c_rstrOriginX.c_str());
			lOriginY		= atol(c_rstrOriginY.c_str());
			lSizeX			= atol(c_rstrSizeX.c_str());
			lSizeY			= atol(c_rstrSizeY.c_str());
			lZ				= atol(c_rstrZ.c_str());
			eMonsterDir		= (CMonsterAreaInfo::EMonsterDir) atoi(c_rstrDir.c_str());
			lTime			= atol(c_rstrTime.c_str());
			lPercent		= atol(c_rstrPercent.c_str());
			dwMonsterCount	= (DWORD) atoi(c_rstrCount.c_str());
			dwMonsterVID	= (DWORD) atoi(c_rstrVID.c_str());
			
			CMonsterAreaInfo * pMonsterAreaInfo = AddMonsterAreaInfo(lOriginX, lOriginY, lSizeX, lSizeY);
			pMonsterAreaInfo->SetMonsterAreaInfoType(eMonsterAreaInfoType);
			if (CMonsterAreaInfo::MONSTERAREAINFOTYPE_MONSTER == eMonsterAreaInfoType)
				pMonsterAreaInfo->SetMonsterVID(dwMonsterVID);
			else if (CMonsterAreaInfo::MONSTERAREAINFOTYPE_GROUP == eMonsterAreaInfoType)
				pMonsterAreaInfo->SetMonsterGroupID(dwMonsterVID);
			pMonsterAreaInfo->SetMonsterCount(dwMonsterCount);
			pMonsterAreaInfo->SetMonsterDirection(eMonsterDir);
		}		
	}

	return true;
}

The system cannot read the actual file. File name is MonsterAreaInfo.txt but system is trying to read regen.txt.

If you want, you can change monsterareainfo.txt with regen.txt - result will be same.

Kind Regards ~ Ken

  • Love 8

Do not be sorry, be better.

Link to comment
Share on other sites

Posted 6 December · Report post

Hi devs!

Today im gonna show you how to delete LoadMonsterAreaInfo syserr error! (This error is just ridiculous...)

#1 Go to the client binary and go

  • clientbinary/GameLib/

#2 Search for:

  • MapOutdoorLoad.cpp

#3 Search for:

  • bool CMapOutdoor::Load(float x, float y, float z)

#4 Search for:

  • if (!LoadMonsterAreaInfo())
  • TraceError("CMapOutdoor::Load - LoadMonsterAreaInfo ERROR");

 

 

 

Hi you don't need fix nothing...

:| ......Only miss regen.txt in path of the map .....put a empty file with name regen.txt in map client side :|.....this isn't a bug not need fix it

  • Love 3
Link to comment
Share on other sites

  • 3 years later...
On 12/6/2015 at 1:22 PM, Ken said:

At first, LoadMonsterAreInfo's first error is coming from regen.txt. If you don't have this file in your pack. System will give this error. As galet said, you're just hidding that.

 


	char c_szFileName[256];
	sprintf(c_szFileName, "%s\\regen.txt", GetMapDataDirectory().c_str());
	
	LPCVOID pModelData;
	CMappedFile File;
	
	if (!CEterPackManager::Instance().Get(File, c_szFileName, &pModelData))
	{
		//TraceError(" CMapOutdoorAccessor::LoadMonsterAreaInfo Load File %s ERROR", c_szFileName);
		return false;
	}

 The code is already explain itself.

If you want to fix it, here is a fix for you.

 


bool CMapOutdoor::LoadMonsterAreaInfo()
{
	RemoveAllMonsterInfo(); // Remove All Monster Info
	
	char szFileName[256];
	_snprintf(szFileName, sizeof(szFileName), "%s\\monsterareainfo.txt", GetMapDataDirectory().c_str());
	
	LPCVOID pModelData;
	CMappedFile File;
	
	if (!CEterPackManager::Instance().Get(File, szFileName, &pModelData)) return false;
	
	CMemoryTextFileLoader textFileLoader;
	CTokenVector stTokenVector;
	
	textFileLoader.Bind(File.size(), pModelData);
	
	for (DWORD i = 0; i < textFileLoader.GetLineCount(); ++i)
	{
		if (!textFileLoader.SplitLine(i, &stTokenVector))
			continue;
		
		stl_lowers(stTokenVector[0]);
		
		// Start to read MonsterAreaInfo.txt
		if (0 == stTokenVector[0].compare("m") || 0 == stTokenVector[0].compare("g"))
		{
			if (stTokenVector.size() < 11)
			{
				TraceError("CMapOutdoorAccessor::LoadMonsterAreaInfo Get MonsterInfo File Format ERROR! continue....");
				continue;
			}

			CMonsterAreaInfo::EMonsterAreaInfoType eMonsterAreaInfoType;
			if (0 == stTokenVector[0].compare("m"))
			{
				eMonsterAreaInfoType = CMonsterAreaInfo::MONSTERAREAINFOTYPE_MONSTER;
			}
			else if (0 == stTokenVector[0].compare("g"))
			{
				eMonsterAreaInfoType = CMonsterAreaInfo::MONSTERAREAINFOTYPE_GROUP;
			}
			else
			{
				TraceError("CMapOutdoorAccessor::LoadMonsterAreaInfo Get MonsterInfo Data ERROR! continue....");
				continue;
			}
			
			const std::string & c_rstrOriginX	= stTokenVector[1].c_str();
			const std::string & c_rstrOriginY	= stTokenVector[2].c_str();
			const std::string & c_rstrSizeX		= stTokenVector[3].c_str();
			const std::string & c_rstrSizeY		= stTokenVector[4].c_str();
			const std::string & c_rstrZ			= stTokenVector[5].c_str();
			const std::string & c_rstrDir		= stTokenVector[6].c_str();
			const std::string & c_rstrTime		= stTokenVector[7].c_str();
			const std::string & c_rstrPercent	= stTokenVector[8].c_str();
			const std::string & c_rstrCount		= stTokenVector[9].c_str();
			const std::string & c_rstrVID		= stTokenVector[10].c_str();
			
			long lOriginX, lOriginY, lSizeX, lSizeY, lZ, lTime, lPercent;
			CMonsterAreaInfo::EMonsterDir eMonsterDir;
			DWORD dwMonsterCount;
			DWORD dwMonsterVID;
			
			lOriginX		= atol(c_rstrOriginX.c_str());
			lOriginY		= atol(c_rstrOriginY.c_str());
			lSizeX			= atol(c_rstrSizeX.c_str());
			lSizeY			= atol(c_rstrSizeY.c_str());
			lZ				= atol(c_rstrZ.c_str());
			eMonsterDir		= (CMonsterAreaInfo::EMonsterDir) atoi(c_rstrDir.c_str());
			lTime			= atol(c_rstrTime.c_str());
			lPercent		= atol(c_rstrPercent.c_str());
			dwMonsterCount	= (DWORD) atoi(c_rstrCount.c_str());
			dwMonsterVID	= (DWORD) atoi(c_rstrVID.c_str());
			
			CMonsterAreaInfo * pMonsterAreaInfo = AddMonsterAreaInfo(lOriginX, lOriginY, lSizeX, lSizeY);
			pMonsterAreaInfo->SetMonsterAreaInfoType(eMonsterAreaInfoType);
			if (CMonsterAreaInfo::MONSTERAREAINFOTYPE_MONSTER == eMonsterAreaInfoType)
				pMonsterAreaInfo->SetMonsterVID(dwMonsterVID);
			else if (CMonsterAreaInfo::MONSTERAREAINFOTYPE_GROUP == eMonsterAreaInfoType)
				pMonsterAreaInfo->SetMonsterGroupID(dwMonsterVID);
			pMonsterAreaInfo->SetMonsterCount(dwMonsterCount);
			pMonsterAreaInfo->SetMonsterDirection(eMonsterDir);
		}		
	}

	return true;
}

The system cannot read the actual file. File name is MonsterAreaInfo.txt but system is trying to read regen.txt.

If you want, you can change monsterareainfo.txt with regen.txt - result will be same.

Kind Regards ~ Ken

Epic save! Thanks!

  • Confused 1
Link to comment
Share on other sites

Announcements



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