ArchiveXL: Patching appearances

Modifying game items with minimal conflicts

Summary

Published: July 23 2024 by Zhincore Last documented update: July 23 2024 by Zhincore

This guide will teach you how to use ArchiveXL's Resource Patching feature to add/modify appearances of existing items without conflicting too much with other mods or even game's updates!

Concepts discussed here can be applied to many other areas in the game. See the general guide for more info: ArchiveXL: Resource patching

Prerequisites

Step 1: Delete the work of others

For resource patching you only ship what you've made. Open your .ent/.mesh/.app files and delete appearances and materials that were there from vanilla. Keep your custom ones, make sure your appearances have a unique name!

You can select multiple items in a list and then right-click and then Delete Selection.

When deleting materials, the names might get messy. That's because mats get names from the materialEntriesarray, try to remember what materials are yours and don't forget to delete vanilla entries too. Also update the index of materialEntries if needed! (counting begins from 0)

You mostly can and probably should delete any other fields that you don't want to change. For example, in .mesh files, if you don't change the mesh itself, you should right-click renderResourceBlob and choose "Reset Object", same with lodLevelInfo. That way the files only contain your changes and the rest is taken from vanilla game.

Step 2: Move your files out of the way

You should make a special folder for your mod, outside of the vanilla structures. Common pattern is your_name\mod_name\ (e.g. zhincore\new_gun_appearance).

Example folder structure of my mod.

Move all your patch files to your folder, but remember where you took them!

For finding the old paths easier, feel free to just copy your files to their new place for now and delete the old ones after step 3.

Step 3: Configure ArchiveXL

Create an .archive.xl file in your resources folder if you haven't already (reuse it if you have one). It should be named your_mod_name.archive.xl (best if you match it with your project name so the normal .archive is named the same).

My .archive.xl file.

Open the file in your favorite text editor and add the following lines:

resource:
  patch:
    <source_file_path>:
      - <target_file_path>

Replace <source_file_path> with the relative path to your patch file, e.g. modder\mod_name\gun_appearance.app. And replace <target_file_path> with the relative path to the original file, e.g. base\weapons\firearms\rifle_assault\militech_ajax\w_rifle_assault__militech_ajax.app.

In WolvenKit's Project Explorer you can right-click a file and choose "Copy relative path" and just paste in into your .xl file. You don't have to write the paths manually!

You can repeat these lines for all the files you want to patch (just don't duplicate the first two lines).

And you should be good to go! Install your mod and test it.

Last updated