• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Mass export/import?

Status
Not open for further replies.
Level 3
Joined
May 4, 2012
Messages
29
Here's what's going on - I wanted to modify the melee maps (RoC and TFT alike) with some custom units, heroes, etc. So I downloaded and applied the necessary models, made some proper triggers and all is fine.

However, I've only done it with one map and it would be hell of a trouble to manually import all this stuff to every W3 melee map. Though exporting and importing object database is pretty nice, since you can make it a one file only, the worse part is the models. Not only do I have to import each of them separately, but I also have to change the path of each, and of course generally each model has a different path.

Umm, of course you know it well. But here's my question. Is there any faster way of importing these files (mainly the stuff from import manager, so that I wouldn't have to struggle with all those paths)? I tried to find some method via Google, but no good. And I thought it's worth a try to ask before I spend hours on importing everything manually.

Thanks!
 
Level 31
Joined
Jun 27, 2008
Messages
2,557
I think you cannot. Well, you can copy your current map, paste, rename, open it, delete all triggers, custom items, spells, units, doodads etc, reset it fully to default and here you go, you have a new, empty map with imported material. I guess it would be easier to do than to import a ton of material into new one.
 
Level 3
Joined
May 4, 2012
Messages
29
Oh, but I don't want to remove anything. I just want to add stuff to melee maps and this stuff is object database, 30 model files and a set of triggers. I guess that's it.
 
Level 5
Joined
Jun 16, 2004
Messages
108
I can think of two pretty simple ways.

First, if you have the jass newgen pack (or are willing to download it) you can look inside the grim extension pack included with it (grimex) and read the manual for the file importer. This seems to be a tool that does precisely what you want, offering to import files and setup their path in the map as well. You will have to do some preliminary configuration steps and perhaps write a batch file to sort of automate adding all your files, but after that you basically would just run that script over and over to import to each map.

The other way I can think of involves opening up your map in an MPQ editor (the one that has all the models and imports and such already), deleting various data such as the terrain and preplaced units/items/doodads and shadows if you feel like it, then importing that data from another map. This might have some problems associated with it that you have to overcome. Since you said they are melee maps, though, you handle a lot of the change between melee maps just changing those files. Note that after changing the data files you should probably recalculate shadows (if you did not import the other map's shadow file) and then save to recalculate other things (such as pathing).

I would recommend doing the first one since it requires an investment of time once, then it should work for any number of maps. And if you change what models you use or anything, you can simply modify your script slightly and reimport into all the maps again.
 
Level 3
Joined
May 4, 2012
Messages
29
Well, the first method seems better, indeed. I will try it as soon as I create the last remaining unit and will ask if I run into any problems. Thanks!
 
Level 9
Joined
May 31, 2010
Messages
366
you can remove terrain units and doodads from the map, change the size to the map size of the next you want to make and just copy and paste (mak all terrain first) from the next map to the one where you deleted all stuff, then copy all doodads and paste them, after that all units

so the models triggers and changes will stay and you get the next modifided map in about 5 min's
 
Level 3
Joined
May 4, 2012
Messages
29
So I tried the first method Halo7568 suggested.

This jass newgen pack seems to be pretty useful!
I hope I'm doing it right. I launched this pack's version of map editor, opened my map in it (by the way, it stated that the map was saved with a newer version of the editor), clicked on "Extentions" tab, "Export files" and chose a directory to which all stuff should be exported. And it did export everything, so I happily opened another, "fresh" melee map to which I wanted to import it. Again, "Extentions", "Import directory", chose the folder I exported to earlier, and... nothing. Some loading screen popped out for a moment, after a few seconds "Success!" came up but that's it. It seems like nothing was imported, triggers, object database and import manager all seem to be the same as they were.

Did I mess something? :(
 
Level 5
Joined
Jun 16, 2004
Messages
108
When you export all files using the extensions menu, it creates several subdirectories inside the directory you export to. You have to import each of those subdirectories manually. I recommend making a .bat file or something to try to get around it, by calling the file importer on the command line for every file you need to import.

When I tried it, it seems that a custom unit did not get transferred over properly. Not sure if I messed up with the multi-step menu based import, but I had to manually add in some object data files (.w3u for custom units, .w3a for custom abilities). Making a script to run file importer manually might help fix it. Or you might be able to import those files manually.

Might need your new map to be changed to .w3x, not sure.
 
Level 3
Joined
May 4, 2012
Messages
29
It is really odd. Even before I tried importing the whole directory and subdirectories alike. And it didn't seem to work. But now it looks like the files seem to be imported only after I quit and launch again the editor. And what's more, only imports and object database directories seem to be imported, as triggers and gameplay constants remain the same.

Edit: Next time I tried even object data didn't import. o_o
 
Level 5
Joined
Jun 16, 2004
Messages
108
Yeah, for some reason it does not seem to import object data when you use the menu import. Also, you have to close and open the map in the world editor (or just close the editor and reload the map) before the imported files take a visual effect. Something about it is mentioned in the readme.

In any case, I figured the most convenient thing to do would be to make a batch file like this: http://pastebin.com/gzndcxRh

Basically, the idea is to manually list every file you want to import into every map, along with the map's local path for the file. You would call it on the command line by running the batch with the map's path as the parameter, with the file paths to import being viewable from the directory you are executing from.

Well, it is not that complex to form your own batch file for this purpose, and I would recommend doing it, because then it is basically a one step process to import into every map (assuming you do not change triggers and units and so on between maps).
 
Level 3
Joined
May 4, 2012
Messages
29
Could you please instruct me on creating such a bat file? Things like where to create this bat, how to define the map to which to import, how tu launch it (I mean, do I only have to run it and a chosen map will have everything imported automatically, or do I have to open this map in the editor first or something like that). I tried analysing the one you posted, but it's still too unclear to me and the only bat files I ever created were pretty basic ones. :p Thanks!
 
Last edited:
Level 5
Joined
Jun 16, 2004
Messages
108
Sure thing, first here is a new paste: http://pastebin.com/ePtMGamn
You should modify the fipath to be your full path to fileimporter.exe like I have it.
Next, you should modify searchdirs to be a semi-colon separated string of all directories that contain files you want to import into each map. For example, when you export all files using the grimext menu option, with a simple map I know stuff gets exported to three directories (environment, triggers, and objects). So in the minimum case you would want to put those directories in (perhaps more since you have custom models and such). Each path should end with a forward slash, and you should use forward slashes instead of backslashes as I have done.

If your three paths for example are C:/wc3/map/environment, C:/wc3/map/triggers, and C:/wc3/map/objects, the searchdirs would look like this:
set searchdirs="C:/wc3/map/environment/;C:/wc3/map/triggers/;C:/wc3/map/objects/"

After that comes each import line, which I have like this for example:
%fipath% %1 %searchdirs% war3map.w3a war3map.w3a

The first three parameters basically never change, but they are the fileimporter.exe itself (to run it), the map to run on, and the directories to search through for the files you want to import. The next two are the path to the file you want to import (will search through the search directories, but you can specify full paths too), and finally, the local path the file will have when imported (you could specify war3imported\war3map.w3a for example).

Simply create such a line for just about every file you want to import into new maps. Some files you will not want to import, such as war3map.doo, war3map.w3e, war3map.shd, war3map.wpm, war3mapUnits.doo, and war3map.mmp (this list might not be correct or complete, you can search for what files do on a wc3 w3m/w3x map format specification). The general idea with not importing those is to preserve the map's terrain, doodads, pathing, shadows, unit/item placement, and so on, while importing all the other custom data you have. You might actually want some of these things imported, I am not sure what exactly you are trying.

To run the batch file, you run it on the command line with the map path as the argument.
On Windows 7 / Windows Vista, simply go to where your batch file is, hold shift, right click somewhere in the blank space in the directory, and select to open a command prompt at this location. Then the command looks like:
import.bat path/to/map/map.w3x

Anyway, good luck.

Also, do not have the map open in the WE when you import on the command line like this. Just open the map afterwards.
 
Level 3
Joined
May 4, 2012
Messages
29
I will try it right in a moment, but I will ask one more thing before that. Gameplay constants were exported as a .txt file, do I import it the same way? I mean, won't the file be imported to import manager, like a model? It happened when I tried to import non-import manager files (object data, gameplay constants and triggers) via the "Import directory" option in "Extentions" tab of the editor.

I was thinking that maybe I should specify some particular path for these non-import manager files so that it could properly import them, but I have no idea what path or even if that's what should be done.

Well, maybe I'll be able to tell more once I make and check this bat file. :)

Oh, one more thing. When I specify the path to import, I also use forward slashes, right?
 
Level 5
Joined
Jun 16, 2004
Messages
108
For now you can just try importing everything the exporter exports. The "war3map.xxx" files usually should be imported with no path in front of it, like I did in the example batch file. I am not sure if the gameplay constants .txt file has a path associated with it, but you should try it without one for now. As a side note, if that .txt file modifies the gameplay constants, then when you open the map in the editor you probably will not see the changes in the editor's gameplay constants menu. However, the changes should still apply in game.

Object data and triggers should be imported if you want things like custom units / items / triggers to be imported to other maps.
 
Level 3
Joined
May 4, 2012
Messages
29
Hmm, I have troubles running the bat with map's path. I have Windows XP and it looks like I cannot run the command prompt in chosen folder. So I opened prompt window and deduced that instead of "import.bat" I would have to type its path. So the command I tried was:

"C:\Documents and Settings\Stan\Pulpit\import bat\import.bat C:\Documents and Settings\Stan\Pulpit\import bat\(4)Duskwood.w3x"

(I put the map in the same folder as my import.bat, just in case)

Trying that gave me some error about incorrect path. So I tried several options:

"C:\Documents and Settings\Stan\Pulpit\import bat\import.bat (4)Duskwood.w3x"

"C:\Documents and Settings\Stan\Pulpit\import bat\import.bat" C:\Documents and Settings\Stan\Pulpit\import bat\(4)Duskwood.w3x

"C:\Documents and Settings\Stan\Pulpit\import bat\import.bat" (4)Duskwood.w3x

and none of them worked. In best case no error would pop out and the bat would seem to launch but it looked like map was not included. It was the same as if I would simply run import.bat right off the... well, bat.

Thank you for your help. :D


Edit: Oh, and just in case it could by any help, here's my bat: http://pastebin.com/SrJesRRX
 
Level 5
Joined
Jun 16, 2004
Messages
108
The last one should successfully execute the batch file, assuming the map is in the current directory of execution (the path shown in the command prompt).

Since you put your files in a place where the path has spaces in it, you will have to surround paths that have spaces with quotation marks, like so:
set fipath=C:/Documents and Settings/Stan/Pulpit/jassnewgenpack5d/grimext/FileImporter.exe
becomes
set fipath="C:/Documents and Settings/Stan/Pulpit/jassnewgenpack5d/grimext/FileImporter.exe"

and

ReplaceableTextures/CommandButtonsDisabled/DISBTNZodiac Warrior.blp
probably needs to become
"ReplaceableTextures/CommandButtonsDisabled/DISBTNZodiac Warrior.blp"
(not sure about this second one, you should double check afterwards, but I am pretty sure you need quotations)
 
Status
Not open for further replies.
Top