Register for your free account! | Forgot your password?

You last visited: Today at 08:54

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

Advertisement



[R]Fix LoadMonsterAreaInfo - ERROR

Discussion on [R]Fix LoadMonsterAreaInfo - ERROR within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
Ken™'s Avatar
 
elite*gold: 0
Join Date: Aug 2015
Posts: 10
Received Thanks: 45
[R]Fix LoadMonsterAreaInfo - ERROR

The system can't load the right file in the source files. Actual file name should be "MonsterAreaInfo.txt" but the system tries to read regen.txt. Today, I wanna show how to fix this error completely.

Open GameLib/MapOutdoorLoad.cpp and find this function and replace with this.

Code:
bool CMapOutdoor::LoadMonsterAreaInfo()
{
	RemoveAllMonsterAreaInfo(); // 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;
}
Kind Regards ~ Ken
Ken™ is offline  
Thanks
18 Users
Old 12/08/2015, 00:19   #2
 
elite*gold: 150
Join Date: Feb 2009
Posts: 643
Received Thanks: 613
Code:
Error	1	error C2039: 'size' : is not a member of 'CMappedFile'
in that line:

Code:
	textFileLoader.Bind(File.size(), pModelData);
Do you have a solution for that? ^^
Cyber36 is offline  
Old 12/08/2015, 00:20   #3
 
elite*gold: 0
Join Date: Jan 2012
Posts: 282
Received Thanks: 19
You downloaded it from which Site? Maybe the wrong file
Claicon is offline  
Old 12/08/2015, 00:23   #4
 
elite*gold: 26
Join Date: Oct 2011
Posts: 1,262
Received Thanks: 1,062
Quote:
Originally Posted by Cyber36 View Post
Code:
Error	1	error C2039: 'size' : is not a member of 'CMappedFile'
in that line:

Code:
	textFileLoader.Bind(File.size(), pModelData);
Do you have a solution for that? ^^
The "s" of size has to be uppercase.
Try
Code:
	textFileLoader.Bind(File.Size(), pModelData);
instead of
Code:
	textFileLoader.Bind(File.size(), pModelData);
Always be careful when you're randomly trying to use a method because size != Size

Regards,
Socialized
He3o Crysis is offline  
Thanks
4 Users
Old 12/08/2015, 00:39   #5
 
Ken™'s Avatar
 
elite*gold: 0
Join Date: Aug 2015
Posts: 10
Received Thanks: 45
Quote:
Originally Posted by The_Epvp View Post
You downloaded it from which Site? Maybe the wrong file
Maybe, you're wrong about your words? Try to google it
Ken™ is offline  
Old 12/08/2015, 00:40   #6
 
elite*gold: 150
Join Date: Feb 2009
Posts: 643
Received Thanks: 613
Quote:
Originally Posted by Socialized View Post
The "s" of size has to be uppercase.
Try
Code:
	textFileLoader.Bind(File.Size(), pModelData);
instead of
Code:
	textFileLoader.Bind(File.size(), pModelData);
Always be careful when you're randomly trying to use a method because size != Size

Regards,
Socialized
Thank you, that helped and i learned something
Cyber36 is offline  
Old 12/08/2015, 07:32   #7
 
.Aphrodite's Avatar
 
elite*gold: 70
Join Date: Mar 2015
Posts: 98
Received Thanks: 116
Quote:
1>.\MapOutdoorLoad.cpp(450) : error C3861: 'RemoveAllMonsterInfo': identifier not found
There is no function for RemoveAllMonsterInfo

#Fixxed RemoveAllMonsterInfo(); -> RemoveAllMonsterAreaInfo();
.Aphrodite is offline  
Thanks
1 User
Old 12/08/2015, 11:12   #8
 
.J0ker's Avatar
 
elite*gold: 0
The Black Market: 128/0/1
Join Date: Jun 2013
Posts: 1,214
Received Thanks: 327
Thanks
.J0ker is offline  
Old 12/08/2015, 13:12   #9
 
fcsk_aim's Avatar
 
elite*gold: 100
Join Date: Dec 2014
Posts: 93
Received Thanks: 51
It's not a big deal that fix.
Someone with 10% brain can solve itself.

ThANKS ANYWAI
fcsk_aim is offline  
Old 12/08/2015, 13:15   #10
 
naosou's Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 393
Received Thanks: 92
I still get that error in my syserr tho.
naosou is offline  
Old 05/30/2016, 16:51   #11
 
lollo_9_1's Avatar
 
elite*gold: 100
Join Date: Jun 2009
Posts: 168
Received Thanks: 711
Someone told me on skype "I have this error: CMapOutdoor::Load - LoadMonsterAreaInfo ERROR; I applied this fix but nothing happened", I clicked the link he gave me and...

There are several things to say, but these few will suffice:


  1. Can you see? The WorldEditor reads regen.txt, not monsterareainfo.txt. Old map folders have these files, but those are totally useless, if not trash.
  2. The regen.txt is just for the WorldEditor, not launcher. It's to develop ingame regens using the WE itself.
    We can care the less about LoadMonsterAreaInfo at all so much that we can simply wrap its call like this:
    Code:
    #ifdef WORLD_EDITOR
    	if (!LoadMonsterAreaInfo())
    		TraceError("CMapOutdoor::Load - LoadMonsterAreaInfo ERROR");
    #endif
  3. The MonsterAreaInfo feature is quite laggy, and buggy in the WorldEditor too.

Even if it's a 2015 thread, I'm still very astonished that you all fell for something so trivial.
lollo_9_1 is offline  
Thanks
4 Users
Old 05/30/2016, 17:43   #12
 
-Exploit's Avatar
 
elite*gold: 320
The Black Market: 154/1/0
Join Date: May 2015
Posts: 3,441
Received Thanks: 383
Very usefull thanks Ken!
-Exploit is offline  
Old 09/03/2020, 14:02   #13
 
elite*gold: 0
Join Date: May 2014
Posts: 4
Received Thanks: 0
Deadly2000 is offline  
Reply


Similar Threads Similar Threads
[ENG] Error: Error 1 error C2601: 'HackMain' local function definitions are illegal
08/20/2013 - C/C++ - 1 Replies
So, as the title says I've been encountering an error Error 1 error C2601: 'HackMain' local function definitions are illegal I'm running on VC++ (Visual C++) This is my code: void HackMain() { for (;; ) { HackThread(); }
CMapOutdoor::Load - LoadMonsterAreaInfo ERROR
11/25/2012 - Metin2 Private Server - 12 Replies
Hi Epvp Community, kann mir jemand bei dieser Syserr helfen? 1122 19:47:11310 :: CMapOutdoor::Load - LoadMonsterAreaInfo ERROR Hab schon dannach gesucht auf epvp, jedoch finde ich keine konkrete Lösung und nur Vermutungen,
İbot Error-Error Video- Error İmages-HELP
04/10/2012 - DarkOrbit - 11 Replies
SORRY, MY ENGLİSH VERY BAD.I USE TO GOOGLE TRANSLATE :) Most people trying to ibot but in my computer İbot not working. Declared out this error everywhere but I do not get answers Here's the error Video http://youtu.be/q0fK09v-K3c
API Error Code: 100 API Error Description: Invalid parameter Error Message: redirect_
04/08/2012 - elite*gold Trading - 2 Replies
API Error Code: 100 API Error Description: Invalid parameter Error Message: redirect_uri URL is not properly formatted Das bekomme ich wenn ich ne App installiere... ich habe schon 3 Apps richtig installiert, danach kam immer das bei anderen Apps die ich installiert habe.. was heisst das? redirect_uri URL is not properly formatted
Client #CMapOutdoor::Load - LoadMonsterAreaInfo ERROR
11/03/2011 - Metin2 Private Server - 3 Replies
Hi, Ich baue gerade neue Maps ein :D Ich bekomme aber nun bei 2 Maps den Fehler hier: CMapOutdoor::Load - LoadMonsterAreaInfo ERROR Den einen, wenn ich auf die Map komme direkt Kick mit der Nachricht in syserr, und bei der anderen kann ich überall laufen, aber wenn ich dann irgendwo bin bekomme ich an einer gewissen Stelle einen Kick. Help pls



All times are GMT +1. The time now is 08:54.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.