Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

FIX LOADMONSTERAREAINFO - ERROR


Rekomendowane odpowiedzi

Opublikowano
System nie może załadować odpowiedniego pliku z game. 
Rzeczywista nazwa pliku powinna mieć nazwę :
MonsterArealnfo.txt
, ale system próbuje odczytać regen.txt.
Aby rozwiązać ten problem całkowicie należy 
otworzyć GameLib/MapOutdoorLoad.cpp
znaleść funkcję : 
bool CMapOutdoor::LoadMonsterAreaInfo()

i zmienić ją na :

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;
}

Gdyby ktoś miał następujący błąd :

Error	1	error C2039: 'size' : is not a member of 'CMappedFile'

przy linii :

	textFileLoader.Bind(File.size(), pModelData);

należy zmienić ja na :

textFileLoader.Bind(File.size(), pModelData);

 

 

Opublikowano

Dzięki za tutka. Jak zadziała dam znać :)

[25] [50] [75] [100] [125] [150] [175] [200] [225] [250] [275] [300] [325] [350] [375] [400] [425] [450] [475] [500]


 


Ranga: Debiutant

Opublikowano

Po co ty zjebie genetyczny kopiujesz wszystko z innych for?

Wiesz co. Nie każdy ma pojęcie gdzie szukać. Czasem lepiej, jak ktoś skopiuje z innego forum i udostępni dla innych. To nazywa się pomoc.

[25] [50] [75] [100] [125] [150] [175] [200] [225] [250] [275] [300] [325] [350] [375] [400] [425] [450] [475] [500]


 


Ranga: Debiutant

  • 4 tygodnie później...

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...