0

I am trying to see how a game reacts to different combinations of mods installed. Installing a mod means copying the mod's files in the game's corresponding folders.

For example the mod has five .hak files, one .mod file, and one .tlk file. The .hak files go in the game's "hak" folder, the .mod file goes in the "modules" folder, and the .tlk file goes in the "tlk" folder.

A mod can have as much as 1000 files so it will take a lot of time to manually select the files across the different folders and move them while testing. I could make an archive file for each mod and have it simply extract its contents in the game's folder for quick install, but I'll still have to manually delete the files when removing it and try not to delete core files by accident.

I suppose it will also work if their extensions are no longer valid.

So in the end I need a way to mark files across different folders, keep track of different groups of marked files at the same time, and either be able to add/remove ".something" to their name, or be able to move them somewhere and then return them to their original location.

5
  • Do the files have to be directly in the hak, mod and tlk folders or can they be in a subfolder?
    – uSlackr
    Dec 19 '16 at 15:42
  • @uSlackr Directly.
    – Nadroev
    Dec 19 '16 at 15:43
  • This might be simpler/quicker: Suppose the root folder for the game's files is GAME. Rename GAME to ORIGINAL. Make other copies of this folder and name them e.g. MOD1, MOD1, MOD3, etc. Now rename MOD1 to GAME, make whatever mods you want and test. When done, rename the folder back to MOD1, rename MOD2 to GAME and ... you get the idea, yes? Dec 19 '16 at 15:58
  • I was thinking something like mklink might work to create links of the files in the destination directory. You could have a batch file that links the files into that directory and then kill the links. Would have been real clean if it was a subfolder moving in and out.
    – uSlackr
    Dec 19 '16 at 20:40
  • @uSlackr I used mkdir to make any directories that are missing and move each individual file. Already had a txt with all the files from each mod from generating a report with winrar, so it was easier to write the bat contents. I marked the answer as correct because it showed me I can use cmd and bat files to move things, but I still don't know how to explain my question. Do I need to remove that "put on hold" tag if I solved it?
    – Nadroev
    Dec 21 '16 at 7:36
1

Your problem is very open to interpretation and can have multiple diferent solutions. Mine:

lets say you have folders like this:

mainGameFolder1\

mainGameFolder1\hak\

mainGameFolder1\modules\

mainGameFolder1\tlk\

modsFolder2\

modsFolder2\mod1\

modsFolder2\mod1\hak\

modsFolder2\mod1\hak\file1.hak

modsFolder2\mod1\hak\file2.hak

...

modsFolder2\mod1\hak\file1000.hak

modsFolder2\mod1\modules\

modsFolder2\mod1\modules\file1.hak

modsFolder2\mod1\modules\file2.hak

...

modsFolder2\mod1\modules\file1000.hak

modsFolder2\mod1\tlk\

modsFolder2\mod1\tlk\file1.hak

modsFolder2\mod1\tlk\file2.hak

...

modsFolder2\mod1\tlk\file1000.hak

modsFolder2\mod2\

...

You can copy files automaticly using cmd (comand line prompt) (start -> type "cmd.exe" or just "cmd", pres enter. Also, see link : https://www.youtube.com/watch?v=BbBe9khzDh4 You can use command copy to copy one (or more) files to certain folder: copy MyFile myFolder more specificly:

C:\ copy modsFolder2\mod1\hak\file1.hak mainGameFolder1\hak\

or more files of some pattern using * (star):

C:\ copy modsFolder2\mod1\hak\file*.hak mainGameFolder1\hak\

this will create 1000 new files:

mainGameFolder1\hak\file1.hak

mainGameFolder1\hak\file2.hak

...

mainGameFolder1\hak\file1000.hak

So what I would do is first ? I would rename all files in all custom mods to some special names, so they would be namely separated from others. For example file1.hak, file2.hak, ...file1000.hak . Why would be this good? Because you can than remove them all when you remove the mod:

C:\ del mainGameFolder1\hak\file*.hak

And this would only remove files that have pattern file.hak .

To fully automate this process you can write commands in copying.bat and removing.bat files: copying.bat:

C:\ copy modsFolder2\mod1\hak\file*.hak mainGameFolder1\hak\

C:\ copy modsFolder2\mod1\modules\file*.hak mainGameFolder1\modules\

C:\ copy modsFolder2\mod1\tlk\file*.hak mainGameFolder1\tlk\

copying.bat:

C:\ del modsFolder2\mod1\hak\file*.hak

C:\ del modsFolder2\mod1\modules\file*.hak

C:\ del modsFolder2\mod1\tlk\file*.hak

You can create files with notepad program. Be careful to separate lines with new line. Then make sure to save as .bat file. You can then run .bat file with cmd.

Also you can do the same thing with any other programming language, e.g. python, C, java,...

Not the answer you're looking for? Browse other questions tagged or ask your own question.