Closed mosamadeeb closed 2 years ago
I do not fully understand the situation where you have an "unknown number of output files"... My idea of the "translation process" has 4 steps:
TF3 is meant to automatize the steps 2 and 4, but not the step 1.
And about the last phrase, that's the way it should work, only with the original unmodified files. That's why I added the possibility to checksum every asset.
Anyway, I'll make some tests to see if it is possible to extract a NodeContainerFormat without specifying the output file names and if it doesn't have problems repacking it.
Thanks for the explanation. I've been using TF3 just like how you explained it, and I am automating step 1 myself, but so far every format I had to add that contained translatable text didn't actually need reading the format itself to generate the output names, since I could just put all of the text into a single output file.
But in the case of textures, it's different. Texture "sheets" that have multiple textures packed in one texture would require reading each (csb) file to find the number of mini-textures to be extracted (instead of just enumerating a directory). I can still automate this, but since I am trying to fit the generation of step 1 into a python script (separate of TF3), it would be more convenient to let TF3 take care of it instead.
I do understand why the optional checksum feature is there, but in some cases it might be a good idea to allow translating modified files (if the converter supports it). An example would be migrating an existing translation project to TF3, which would require extracting assets from the already modded files. Repeating step 1 for the modded files, where the only difference in the resulting script would be the checksums, does not make much sense.
Anyway, I appreciate that you're going to look into it.
I've merged the PR. Let me know if is it what you needed.
Thanks! That's exactly what I wanted.
And don't worry, I will only use this if I can't really do it any other way.
Is your feature request related to a problem? Please describe. Currently it is not possible to extract an asset from a NodeContainerFormat without explicitly stating the output name for each output file in the game script. If the asset has an unknown number of output files, then the game script needs to have at least the same number of output names.
Describe the solution you'd like The ability to pass a single output directory name. For example, one output name that would be written to as a directory if the asset node (after being extracted) is a NodeContainerFormat.
Additionally, this would allow choosing the output file names from the asset itself.
Additional context CSB/SBB files in old engine Yakuza games define a number of UI elements that are extracted from textures inside a PAR, and the only way to find out the exact number of unique extracted "cutouts" is to iterate through all nodes of the CSB/SBB format.
So unless there is a way to extract/rebuild from a single directory, the game script would only be valid with the original unmodified files (i.e. it won't be possible to extract previously rebuilt assets with the same script).