Jump to content

Error running vmap4extractor


Recommended Posts

Getting an error running vmap4extractor.exe from commit (df924a0180f9ecafb586a70e7f0fe6cb74c520e8):

Processing Map 1161
[################################################################]
Can't open WorldMapsTransport_Siege_of_Orgrimmar_AllianceTransport_Siege_of_Orgrimmar_Alliance.wdt, err=2!
Can't open WorldMapsTransport_Siege_of_Orgrimmar_HordeTransport_Siege_of_Orgrimmar_Horde.wdt, err=2!
Extracting GameObject models...Fatal error: Invalid GameObjectDisplayInfo.dbc file format!

Anyone else have this problem?

Link to comment
Share on other sites

you can try this hack. it works but its not nice.

i encoutered the same error. first i thought it would be solved if the cache_xxx.mpq are included but that didn't solve the problem.

as second step i updated stormlib to most recent git revision but that also didn't solvre the problem. as third step I had a look at the mpqs to find the most recent one with the needed dbc which i manually loaded for extraction. 

remember this is just a hack and not well coded. there need to be a real generic fix for that issue.

void ExtractGameobjectModels()
{
    printf("Extracting GameObject models...");
    /* DBCFile dbc(LocaleMpq, "DBFilesClientGameObjectDisplayInfo.dbc");
    if(!dbc.open())
    {
		printf("Fatal error: Invalid GameObjectDisplayInfo.dbc file format LOCALE!n");
		//DBCFile dbc(WorldMpq, "DBFilesClientGameObjectDisplayInfo.dbc");
		if (!dbc.open())
		{
			printf("Fatal error: Invalid GameObjectDisplayInfo.dbc file format WORLD!n");
			// DIRTY DIRTY HACK !! */
			HANDLE localeFile;
			char localMPQ[512];
			char input_path[1024] = ".";

			sprintf(localMPQ, "%s/Data/Cache/patch-base-18273.MPQ", input_path);
			if (FileExists(localMPQ) == false)
			{   // Use misc.mpq
				printf(localMPQ, "%s/Data/%s/locale-%s.MPQ", input_path);
			}

			if (!SFileOpenArchive(localMPQ, 0, MPQ_OPEN_READ_ONLY, &localeFile))
			{
				exit(1);
			}

			printf("Read GameObjectDisplayInfo.dbc file...n");

			HANDLE dbcFile;
			printf("Handle dbcFile Loadedn");
			if (!SFileOpenFileEx(localeFile, "DBFilesClientGameObjectDisplayInfo.dbc", SFILE_OPEN_FROM_MPQ, &dbcFile))
			{
				printf("First IF loaded File not openedn");
				if (!SFileOpenFileEx(localeFile, "DBFilesClientGameObjectDisplayInfo.dbc", SFILE_OPEN_FROM_MPQ, &dbcFile))
				{
					printf("Fatal error: Cannot find GameObjectDisplayInfo.dbc in archive!n");
					exit(1);
				}
			}
			printf("dbc found and loadedn");

			DBCFile dbc(localeFile, "DBFilesClientGameObjectDisplayInfo.dbc");
			//DBCFile * dbc = new DBCFile(localeFile, "DBFilesClientGameObjectDisplayInfo.dbc");
			//DBCFile dbc(dbcFile);
			printf("dbc localefile setn");
			if (!dbc.open())
			{
				printf("Fatal error: Invalid Map.dbc file format!n");
				exit(1);
			}
			//delete dbc;
			//printf("FATAL ERROR: Map.dbc not found in WORLD data file.n");
			//return 1; */
			printf("dbc openedn");
	//	}
//    }

    std::string basepath = szWorkDirWmo;
	printf("szWorkDirWmo loadedn");
    basepath += "/";
    std::string path;
	printf("basepath %s setn", basepath.c_str());

    FILE * model_list = fopen((basepath + "temp_gameobject_models").c_str(), "wb");
	dbc.open();
	if (dbc.getRecordCount() > 0)
    for (DBCFile::Iterator it = dbc.begin(); it != dbc.end(); ++it)
    {
        path = it->getString(1);

        if (path.length() < 4)
            continue;

        FixNameCase((char*)path.c_str(), path.size());
        char * name = GetPlainName((char*)path.c_str());
        FixNameSpaces(name, strlen(name));

        char * ch_ext = GetExtension(name);
        if (!ch_ext)
            continue;

        strToLower(ch_ext);

        bool result = false;
        if (!strcmp(ch_ext, ".wmo"))
            result = ExtractSingleWmo(path);
        else if (!strcmp(ch_ext, ".mdl"))   // TODO: extract .mdl files, if needed
            continue;
        else //if (!strcmp(ch_ext, ".mdx") || !strcmp(ch_ext, ".m2"))
            result = ExtractSingleModel(path);

        if (result)
        {
            uint32 displayId = it->getUInt(0);
            uint32 path_length = strlen(name);
            fwrite(&displayId, sizeof(uint32), 1, model_list);
            fwrite(&path_length, sizeof(uint32), 1, model_list);
            fwrite(name, sizeof(char), path_length, model_list);
        }
    }

    fclose(model_list);

    printf("Done!n");
}
Link to comment
Share on other sites

Thanks @Shanshaan, that didn't work for me though (Admittedly I may have changed the "ExtractGameobjectModels" code in gameobject_extract.cpp incorrectly).  New error I'm getting on commit (75ea2f19c47a381cacec2674a5d28fb7d4e72695) is:

Processing Map 1161
[################################################################]
Can't open WorldMapsTransport_Siege_of_Orgrimmar_AllianceTransport_Siege_of_Orgrimmar_Alliance.wdt, err=2!
Can't open WorldMapsTransport_Siege_of_Orgrimmar_HordeTransport_Siege_of_Orgrimmar_Horde.wdt, err=2!
Extracting GameObject models...Read GameObjectDisplayInfo.dbc file...
Handle dbcFile Loaded
First IF loaded File not opened
Fatal error: Cannot find GameObjectDisplayInfo.dbc in archive!
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.