Mass Fixing dyt.emb Flickering/Flashing Issues on Clothes.
Jan 5, 2017 7:33:27 GMT
SK007 and Rub like this
Post by HisanaFukuhara on Jan 5, 2017 7:33:27 GMT
So as an introduction, recently I was tasked with taking a directory's dyt.emb files and adding more onto each file. Skills like SSBKK use a texture value of 004 and 005 so I had to unpack each dyt.emb and add files the corresponded with DATA004 and DATA005
This was the end result:
But you see, I had to do that for literally every single dyt.emb file that correlated to clothing worn in the game
Now, after some research I found some helpful batch commands.
Just a warning: Until you find a batch command or a tool that runs each file/folder individually through embpack, you will always have to run it manually.
What does this mean? You will have to individually click and drag your files over to embpack.
With the help of SK007, we've found a solution to unpacking and repacking your .emb s, the new tools are in the updated tools.rar file (also fixed was the run.bat file).
Here are the tools I used, they were all built by various sources except for #Extract emb which was written by SK007 : here
Let's go through what is in here:
Now what you shouldn't be seeing in here is embpack_v2, you get that from olganix 's thread
Breaking down what each one does, we see that #Extract emb.bat extracts the contents of all your emb s into their respective folders and distributexml distributes an embFiles.xml into all the subfolders in your main directory, meaning every single folder that you got from extracting all your emb s gets an embFiles.xml.
Why do we need this? This is to update your emb with a list of all the new textures within the emb. In this case it's set to include DATA000 through DATA005, that way you don't get errors when you repack your folder.
This is important: YOU MUST COPY AND RUN YOUR .BAT FILES INSIDE THE DIRECTORY THAT HOUSES ALL THE FOLDERS FROM YOUR DYT.EMBs
[This is where you should copy and paste all your .bat files^]
Next up are distributefirst/second/thirdcopy.bat files, what do they do?
Answer:it copies a .bat called first/second/thirdcopy.bat into ALL the folders in your directory. That .bat file (first/second/thirdcopy.bat) basically takes your already existing DATAXXX.dds file and duplicates it, then renames it into the dds file that your transformation needs. DATA003 always seems to be a copy DATA001 and from what I've seen DATA002 is copied for 004 and 005.
Disclaimer: When you use the first four tools provided (the "distribute" ones), they WILL NOT WORK
You need to make some edits:
This is the common format for your first four .bat files (only the ones that start with "distribute")
You need to right click the .bat and select "edit" from the drop down menu, this should open notepad or whatever editing program your computer defaults to.
Next, you need to go to your directory with all the unpacked emb folders, and right click the last folder in the address bar and hit "copy address as text"
example:
Then, highlight ONLY yourdirectoryhere (without including the backslash) and paste with the copied address text. do this for both yourdirectoryhere entries for all four files.
Click save and now you have 4 functional .bat files
The next file I have to explain is run.bat:
This essentially runs ALL the .bat files in your subfolders
meaning all the first/second/thirdcopy.bat files get run and you essentially expedite the process of manually copying each DATA001 or DATA002 file and renaming it on a folder by folder basis.
This in turn, fills your unpacked emb folders with the proper amount of DATAXXX.dds files
(XXX being the 000-005 range)
The last file I have to explain is #Repack emb.bat, this just takes all your folders and individually runs them through embpack_v2.
So now that you know what everything does, here's the order that you should do things
Drag all your freshly repacked dyt.emb s into data/chara/(directory you were originally doing all this for i.e. HUF or HUM or GOK) either in your data2 folder in cpk (if you use the unpacking method) or the "data" directory in your DB Xenoverse 2 folder if you're using xv2patcher.
This was a more organized version of the minilecture I gave on the AGM discord, so if you wish to learn more, lots of things can be learned there.
This was the end result:
But you see, I had to do that for literally every single dyt.emb file that correlated to clothing worn in the game
Now, after some research I found some helpful batch commands.
What does this mean? You will have to individually click and drag your files over to embpack.
Here are the tools I used, they were all built by various sources except for #Extract emb which was written by SK007 : here
Let's go through what is in here:
Now what you shouldn't be seeing in here is embpack_v2, you get that from olganix 's thread
Breaking down what each one does, we see that #Extract emb.bat extracts the contents of all your emb s into their respective folders and distributexml distributes an embFiles.xml into all the subfolders in your main directory, meaning every single folder that you got from extracting all your emb s gets an embFiles.xml.
Why do we need this? This is to update your emb with a list of all the new textures within the emb. In this case it's set to include DATA000 through DATA005, that way you don't get errors when you repack your folder.
This is important: YOU MUST COPY AND RUN YOUR .BAT FILES INSIDE THE DIRECTORY THAT HOUSES ALL THE FOLDERS FROM YOUR DYT.EMBs
[This is where you should copy and paste all your .bat files^]
Next up are distributefirst/second/thirdcopy.bat files, what do they do?
Answer:it copies a .bat called first/second/thirdcopy.bat into ALL the folders in your directory. That .bat file (first/second/thirdcopy.bat) basically takes your already existing DATAXXX.dds file and duplicates it, then renames it into the dds file that your transformation needs. DATA003 always seems to be a copy DATA001 and from what I've seen DATA002 is copied for 004 and 005.
Disclaimer: When you use the first four tools provided (the "distribute" ones), they WILL NOT WORK
You need to make some edits:
This is the common format for your first four .bat files (only the ones that start with "distribute")
for /d %%a in ("yourdirectoryhere\*") do copy "yourdirectoryhere\(first/second/third, etc)copy.bat" "%%a"
pause
You need to right click the .bat and select "edit" from the drop down menu, this should open notepad or whatever editing program your computer defaults to.
Next, you need to go to your directory with all the unpacked emb folders, and right click the last folder in the address bar and hit "copy address as text"
example:
Then, highlight ONLY yourdirectoryhere (without including the backslash) and paste with the copied address text. do this for both yourdirectoryhere entries for all four files.
Click save and now you have 4 functional .bat files
The next file I have to explain is run.bat:
This essentially runs ALL the .bat files in your subfolders
meaning all the first/second/thirdcopy.bat files get run and you essentially expedite the process of manually copying each DATA001 or DATA002 file and renaming it on a folder by folder basis.
This in turn, fills your unpacked emb folders with the proper amount of DATAXXX.dds files
(XXX being the 000-005 range)
The last file I have to explain is #Repack emb.bat, this just takes all your folders and individually runs them through embpack_v2.
So now that you know what everything does, here's the order that you should do things
- Run #Extract emb.bat
- Delete all .emb files in the directory (optional, but it makes things cleaner)
- Run distributexml.bat
- Run distributefirstcopy.bat
- Run distributesecondcopy.bat
- Run distributethirdcopy.bat
- Take a break from executing .bat files and in ONLY your main directory, delete all .bat files that are not run.bat
- Run run.bat
- While still in the main directory, hit control-F or click inside the search bar next to your address bar and type ".bat" and then hit enter, this redirects you to all the .bat files inside all your subfolders.
Now hit control-A and move to recycle bin or just right click and delete.
Your emb folders are now ready to be repacked into .emb's - Copy #Repack emb.bat back into your directory.
- Run #Repack emb.bat
Drag all your freshly repacked dyt.emb s into data/chara/(directory you were originally doing all this for i.e. HUF or HUM or GOK) either in your data2 folder in cpk (if you use the unpacking method) or the "data" directory in your DB Xenoverse 2 folder if you're using xv2patcher.
This was a more organized version of the minilecture I gave on the AGM discord, so if you wish to learn more, lots of things can be learned there.