Skip to content

Working with directories

chocmake edited this page Jun 8, 2018 · 10 revisions

working-with-directories


Contents


The initial structure

To keep things organized and make it easier to keep track of what we're doing create a new directory elsewhere on your drive, some place where you expect to work on the modded files, and within it create two sub-directories: Original and Modded.

original and modded directories created

Note: it's important to place these directories not too deep in the drive (ie: within too many existing sub-directories), since when modding there can be a lot of nested directories when unpacking files, and Windows File Explorer only supports a maximum path depth of 260 characters. If you create your main modding directory too deep in the drive at worst you may experience some files silently fail to unpack/re-pack correctly.

After that, within the directory named Original, manually re-create the structure that the files we identified in the last section were contained within originally, starting from Assets all the way down, with empty sub-directories. Then copy the files we identified into the matching locations within our newly created structure.

original - structure re-created - model path

original - structure re-created - texture path

We'll now unpack the FPK file contained in the Original directory, since we only want the FMDL model file that it contains in addition to its directory structure:

  1. Unpack col_common_tpp.fpk by dragging and dropping the file on GzsTool.exe.
  2. Within the newly unpacked col_common_tpp_fpk sub-directory delete all the other directories and files besides Assets\tpp\item\cbx\Scenes\cbx0_main1_def.fmdl.
  3. Also delete the col_common_tpp.fpk.xml that was created beside the unpacked FPK directory, and the col_common_tpp.fpk we used to unpack since they're no longer needed.

FPK unpacking

We can now copy the model and its directory structure into the Modded directory we created:

  1. Navigate all the way back up to Original\Assets\tpp\ and copy the pack directory (which contains the FMDL file deep within it).
  2. Navigate up again this time to the Modded directory and within it create the following directories: Assets\tpp.
  3. Inside tpp paste the pack directory you had copied from Original.

copying original pack directory to modded

Great! On to the next step.


Choosing a custom texture path

It's time to chose the 'custom' part of the texture path!

In the copy of Assets within the Modded directory think of a directory structure you'd like your texture to use. It can have your own unique structure, or can be based on the original texture path with something like custom text appended to the filename (eg: _mod).

For this guide I'll be using the following custom directory structure. It's here that I'll be saving the re-textured FTEX files in the next step.

Assets\Mods\choc\SupplyBoxVariants\

custom path used in guide location

Only a couple rules are necessary for a custom texture path:

  • The modded file must be contained inside Assets. Anywhere is fine, just needs to be within it.
  • The path/filename must only contain alphanumeric characters (A-Z, 0-9) with no spaces, only underscores.

Note: if the original texture isn't contained within Assets but located within the root directory (the directory one up), you would still need to place the modded version somewhere within Assets, even if it's just directly within it.


Next

Creating the texture file

Next we'll create the re-texture itself!