Trepang2

Trepang2

Not enough ratings
How To Create Custom Animated Weapons/Equipment Skins in Trepang2
By UltraMadBoomer
**THIS GUIDE IS CURRENTLY BEING REWORKED**

Hello! In this guide, I'll be showing how to create custom materials (skins) for various equipment within Trepang2, such as any weapon, for gloves, and other apparel items (pants, shirts, and shoes). For this guide, we will be covering weapon skins, but the same process applies for other equipment. We will be replacing the vanilla material files found in the game files with our own created materials. There are a lot of possibilities in terms of creations using this method! A huge thank you to Dmgvol on the Trepang discord for assisting me with detailed guides and providing advice on issues I’ve encountered.

This guide will continue to be updated in the future, as new game updates are released and the process may change.

I'm pretty new to Unreal Engine game modding, so there likely are better ways of accomplishing certain things. If you feel that there is a better way to do a certain task that I outline, please feel free to let me know in the comments and I can modify the guide accordingly.
2
2
   
Award
Favorite
Favorited
Unfavorite
Introduction
Hello! In this guide, I will show how to create both static versus animated materials and apply onto various equipment in the game, such as weapons, gloves, shirts, pants, and shoes.

A huge thank you to Dmgvol on the Trepang discord for assisting me with detailed guides and advice on issues I’ve encountered. Their amazing mods for Trepang2 (and other games alike) can be found here[www.nexusmods.com], along with their excellent detailed modding guides[github.com] (the guides for Ghostrunner are very similar to Trepang2’s modding process).

Don't forget to join the Trepang Studios discord[discord.com] for more help from talented modders and developers, and if you want to also interact with the great community.

For those who are returning to the guide again, it has been updated for simplicity purposes and as an attempt to collectively demonstrate the necessary workflow for static versus animated skin materials. If you feel something is missing, feel free to comment below!
Disclaimer
Note that I don’t own any of the assets described in this guide. I am in no way affiliated with Trepang Studios or the development of Trepang2. I am simply creating modifications to learn more about Unreal Engine. I don’t condone misuse of the tools mentioned in this guide. Please don’t use the developers assets for your own commercial projects without permission, and don’t upload resources from the game onto other websites for profit. Be careful of how you use materials and where you upload them to.
I. Static Materials (No Texture Wrapping)
This section will cover how to replace existing weapon skin textures with another custom texture, without performing any texture wrapping. As an example, we will be replacing the default Kintsugi skin pattern on the VHS2 AR with a custom blue Kintsugi pattern. Custom textures for apparel (e.g: gloves, shirts, pants, and shoes) are discussed in a different section of this guide.

For this part, we will need the following software (all of which are free):

FModel will allow us to extract the necessary files from Trepang2 to create our material within Unreal Engine. With this tool, we can extract weapon textures and materials, even weapon models.

Unreal Engine 4.27 will allow us to cook our texture/material files and prepare them for integration into the game.

UnrealPakTool will convert and compress our Unreal Engine project files into one file of .pak format, which is required in order to include our mod within Trepang2.
I. Step 1 - Extracting Required Resources
After you have downloaded and installed the required tools, we can start by extracting the base textures we may need for our custom skin. If you will be using your own texture and don't want to use any of the in-game ones, you can skip to "I. Step 3 - Preparing Mod File Structure" of this section to proceed.
  • 1.1. Open the FModel executable (FModel.exe) and locate Trepang2 within the list of detected games.
    If you don't see Trepang2 under the “Detected Game” drop-down menu, you will need to click on the arrows underneath “ADD UNDETECTED GAME”. Locate the directory of Trepang2 on your PC (for Steam versions, it is under ~/Steam/steamapps/common/Trepang2). It may be different for other platforms (such as GOG), you will need to locate the game files on your own in this case. Set the “UE Versions” drop-down list to “GAME_UE4_28”. Click “OK” when you are done. If you made a mistake and selected something else, you can always click on “Directory”, then “Selector” to re-open the directory selector window.



  • 1.2. Locate the base textures within "CPPFPS-WindowsNoEditor.pak" under "GAME ARCHIVES".
    Double-click on "CPPFPS-WindowsNoEditor.pak", and expand the "CPPFPS" folder, then expand the "Content" folder. For the Kintsugi textures, navigate to the following directory: Weapon > Skins > Base > Materials, and in the top-left of the FModel window, click on the "Packages" tab. At this point, you should see a list of some .uasset files, which contain the base textures that make up some (not all) of the weapon skins. Look for the files that reference Kintsugi, which are more specifically "T_Kintsugi_Mask.uasset" and "T_Kintsugi_N.uasset".




  • 1.3. Save the necessary base textures for our custom skin.
    Right-click on "T_Kintsugi_Mask.uasset" within the FModel window and select "Save Texture (.png)". Do the same for "T_Kintsugi_N.uasset". If everything is successful, the textures should be saved locally on your computer in PNG format. The saved textures should be located in the same path as depicted in FModel: [wherever FModel.exe is located] > Output > Exports > CPPFPS > Content > Weapon > Skins > Base > Materials

I. Step 2 - Editing Texture Images
  • 2.1. Open and edit the extracted base textures in GIMP (or whatever image editor you choose).
    In GIMP, open (CTRL+O) and navigate to the FModel extract directory ([wherever FModel.exe is located] > Output > Exports > CPPFPS > Content > Weapon > Skins > Base > Materials). Open "T_Kintsugi_Mask.png".

    Select the “Fuzzy Select” tool, and click on any part of the white lines. This will outline nearly every line within the texture, and from here we can easily paint them to be any color we want. Click on the “paintbrush” tool and on the foreground color element, select whichever color you wish to use. In the original modified texture, I used a lighter blue color. Under the “Windows” menu tab, hover over “Dockable Dialogs'' and click on “Tool Options”. With the “paintbrush” tool selected from the toolbox, change the brush size to a very large value, and begin coloring across the texture. Since we used the “fuzzy select” tool, you won’t need to worry about accidentally coloring outside of the lines, so you can just hold left-click across the entire texture.



    As mentioned previously, this guide will remain as simple as possible. You can make the custom texture as complex and different as you desire!
    Deselect the current line selection by hitting SHIFT+CTRL+A at the same time. We're done with editing the texture.

    We will need to export this as a PNG again; under “File”, select “Export As…” and give it a different name (such as T_Kintsugi_Mask_Custom.png). We can save it where the original FModel extracted textures are, within Output > Exports > CPPFPS > Content > Weapon > Skins > Base > Materials for convenience. Click on “Export” within the “Export Image” window, once you have navigated to the FModel extracted materials directory and have provided a name. Within the following settings window, simply click “Export”.

    You can close out of GIMP (you don’t need to save the project file unless you feel inclined). Next, we will be importing our textures and creating our custom material in Unreal Engine.
I. Step 3 - Preparing Mod File Structure
  • 3.1. Launch Unreal Engine 4.27.2 and create a new project for Trepang2 texture modding.
    Select the “Games” project category and use the “Blank” template. Keep all project settings unchanged, but give your project a name, such as T2_BlueKintsugiAR (name here does not matter). I recommend keeping the default directory selected (but if you absolutely need to change it, keep note of the directory path). Click on “Create Project”.

    When the Unreal editor window opens, click under “Edit” in the top-left, and click on “Project Settings”. In the “Search Details” search bar, type in “share”. Uncheck “Shared Material Native Libraries” and “Share Material Shader Code”. You will need to restart the Unreal Engine program to apply the changes. Next, we will need to get the UE project file directories to match Trepang2’s game file directories (as shown in FModel). You can easily do this by referring to the FModel extracted file path; everything after “CPPFPS” (i.e.: Content > Weapon > Skins > Base > Materials).



  • 3.2. Import custom textures into your UE 4.27.2 project.
    Once your UE project is re-opened, right-click within the “Content Browser” window at the bottom, and create a new folder. Name this folder “Weapon”. Within the “Weapon” folder, create a new folder named “Skins”. Within the “Skins” folder, create a new folder named “Base”. Within the “Base” folder, create a new folder named “Materials”. Click and drag your custom PNG texture, and any additional textures necessary into UE's content browser, while in the Content > Weapon > Skins > Base > Materials folder. This path that you have created is the same as shown in FModel, from where we initially extracted the base texture.
    NOTE: Do NOT create an additional "Content" folder... your UE project's content browser already has a root folder of "Content".



  • 3.3. Create the weapon skin material in your UE 4.27.2 project.
    Open FModel once again. Navigate to the "Weapon" folder under "Content", then navigate into your desired weapon's corresponding "Skins" folder. For example, the AR material files are located in the following path: CPPFPS > Content > Weapon > AssaultRifle > Skins > Material. This specific directory contains the weapon materials (i.e: weapon skins) for the VHS2 AR. Since we are creating our own custom weapon skin, we will need to overwrite the game's material file with our project's material file for the skin we wish to replace.

    In our case, we are interested in the Kintsugi skin, which is listed as "M_Weapon_AR_Skin_Kintsugi". This name is very important; we will need to name our project's Kintsugi material in the exact same way as shown in FModel and here.

    As we've done with the custom texture (in step 3.2), we need to replicate the path in our project to the material folder as shown above. This path is: Weapon > AssaultRifle > Skins > Material.
    In the existing "Weapon" folder, create a new folder and name it "AssaultRifle". Within the AssaultRifle folder, create a new folder and name it "Skins". Within the Skins folder, create a new folder and name it "Material".



    In the content browser at the Content > Weapon > AssaultRifle > Skins > Material folder, right-click and select "Material" under "Create Basic Asset". Name this new material "M_Weapon_AR_Skin_Kintsugi", paying attention to the spelling of the original material name, as shown in FModel.

I. Step 4 - Designing in the Material Editor
  • 4.1 Open the new material in Unreal Engine to access the material editor.
    Double-click on the newly created M_Weapon_AR_Skin_Kintsugi material. In the details panel at the bottom-left of the material editor/node graph editor window, scroll down to the “Usage” section, and check the “Used with Skeletal Mesh” checkbox.



  • 4.2 Import the desired custom texture(s) into the material editor.
    Ensure the material editor window is in windowed mode, and move it so that it doesn't obstruct the content browser section of the main Unreal Engine window. Soon in this step, we will be dragging and dropping textures from the base textures directory into the material editor, as this is the quickest method to do so.

    Drag in the custom texture (in our project's case, T_Kintsugi_Mask_Custom) from the content browser of the main project into the material editor window. Once you do this, a "Texture Sample" node will appear. Repeat this same process for T_Kintsugi_N (and any other textures you will be using in your weapon skin).



  • 4.3 Hook up the texture sample nodes to the appropriate material pins within the material editor.
    For each texture sample's RGB output pins, click and drag to connect the texture to the specific material pin. In our example, we will connect T_Kintsugi_Mask_Custom (blue kintsugi texture) to the "Base Color" pin, and T_Kintsugi_N to the "Normal" pin.



  • 4.4 Apply and save the material within the material editor window.
    After saving, you can close out of the material editor window, and return to the main window.

I. Step 5 - Convert Mod Files to PAK Format
  • 5.1 Save all current changes to your Unreal Engine project.
    You will not be able to proceed otherwise. Under "File", click on "Save All" (or hit CTRL+SHIFT+S).

  • 5.2 Cook the project content in your Unreal Engine project.
    Under "File" again, click on "Cook Content for Windows". You may hear a chirping noise, indicating that the process has begun. This may take some time, so just be patient until you see a notification and hear another noise within Unreal Engine, meaning that the cooking was successful.



    Navigate to your Unreal Engine project's cooked directory, which by default should be: Documents > Unreal Projects > [your UE project's name] > Saved > Cooked > WindowsNoEditor > [your UE project's name] > Content. You should see the same folders as we've previously created within Unreal Engine. We will find our material file and base textures that we used within the material, however with a file extension of .uasset and .uexp. In our example, we can find uasset and uexp files for M_Weapon_AR_Skin_Kintsugi, T_Kintsugi_Mask_Custom and T_Kintsugi_N (both with a ubulk file as well) within their respective folders. Return to the "Content" directory within File Explorer if you aren't currently there.



  • 5.3 Package the mod folders within one file using UnrealPakTool.
    In the same location that you have unzipped the UnrealPakTool, create a new folder with the name of your choice, but with “_P” as the last characters (such as: BlueKintsugiARGuide_P). Open the new folder and create a new folder within named “CPPFPS”. Within the “CPPFPS” folder, create a new folder named “Content”. Within “Content”, paste the folder contents of your UE project's cooked directory folder: Documents > Unreal Projects > [your UE project's name] > Saved > Cooked > WindowsNoEditor > [your UE project's name] > Content.



    Now, within the same path where "UnrealPak-With_Compression.bat" is located, click and drag your mod folder (in our example, BlueKintsugiARGuide_P) onto "UnrealPak-With_Compression.bat". Below is an example using another weapon skin mod I have created.



    A command prompt window will appear, and once it indicates to do so, you may close the window. You will end up with a .pak file and filelist.txt (ignore the KintsugiAnim_P and the Working folder in the image below):



  • 5.4 Move the mod folder into Trepang2's pak directory.
    Finally, all that needs to be done is copy and paste this new .pak file into Trepang2’s pak directory. For this tutorial, we will copy our BlueKintsugiARGuide_P.pak file into the game's pak directory. In a new File Explorer window, move to the Trepang2 game directory, then CPPFPS > Content > Paks (on Steam versions, the path would look like this: ~/Steam/steamapps/common/Trepang2/CPPFPS/Content/Paks).

I. Step 6 - Testing the Custom Weapon Skin Material
Moment of truth, time to see if all that effort paid off. Start up Trepang2 and equip the Assault Rifle. Change your current skin to the Kintsugi skin on the AR. You should see the custom material applied across the body of the AR.
If not, check to see if your mod’s folder names (+file names) are EXACTLY the same and match the paths shown in FModel. Review the necessary Unreal Engine settings mentioned within this guide.

If you want to apply this material across other weapons, you can duplicate the M_Weapon_AR_Skin_Kintsugi material in your Unreal project, and rename the copy to your desired weapon’s material as displayed through FModel (see Step 3.3 again). Ensure to extract the base materials for your desired weapon, include it in the project, replicate the path to your desired weapon’s material file in Unreal Engine, move the copied material to the corresponding weapon folder, and cook the content once again.



As you may notice, we are missing the base VHS2 AR textures and this Kintsugi custom material doesn't apply very nicely across the weapon... this is the issue with non-wrapped custom textures. Regardless, this method can be used for smaller custom textures and patterns, it is the simplest method for creating a custom static skin. In the next section, we will explore the same process, however, with texture wrapping applied.
II. Static Materials (Texture Wrapping)
THE FOLLOWING SECTION IS A WORK IN PROGRESS.

As mentioned in the previous section, here we will discuss how to properly fit a static texture across your desired weapon in Trepang2.

In addition to the free software as listed in "I. Static Materials (No Texture Wrapping)", there are other software needed to achieve texture wrapping:

Quixel Mixer will generate our wrapped texture based on our desired weapon model and its materials, as well as allowing us to make some adjustments to our texture.

Blender, along with the PSK import plugin will allow us to import our desired weapon model as a PSK format, then export to FBX format using Blender.
Step 1: Download Prerequisite Tools
To begin, we will need to download five primary tools (all of which are free): FModel, Blender 4.0 (and the corresponding plugin), Quixel Mixer, Unreal Engine 4.27.2, and UnrealPakTool.
uAssetGUI is also another great tool for modding UE games, but we will NOT be using it in this guide.

Download FModel from here:
https://fmodel.app/

Download Blender 4.0 + PSK import plugin from here:
https://www.blender.org/download/
AND
https://github.com/DarklightGames/io_scene_psk_psa/releases/tag/6.1.0

Download Quixel Mixer from here:
https://quixel.com/mixer

Download UnrealPakTool from here: https://github.com/Dmgvol/GR_Guides/blob/main/Tools/UnrealPak.zip
- Click on the three dots at the top right of the page and select “Download” under “Raw File Content”.

FModel will allow us to extract the necessary files from Trepang2 to create our material within Unreal Engine. With this tool, we can extract weapon textures and materials, even weapon models.
Blender 4.0, in conjunction with the 3rd party "io_scene_psk_psa" plugin by cmbasnett[github.com] and shiftycats[github.com] will allow us to be able to import the extracted .psk object model into Blender and then export it as a .fbx file.
Quixel Mixer will allow us to perform UV texture mapping so that our material fits appropriately across the desired object model. In this tutorial, we will be extracting the VHS2 assault rifle model using FModel and apply our new texture layer over the base gun textures.
Unreal Engine 4.27 will allow us to implement our custom animated material using the base textures, using the UV-wrapped textures exported from Quixel Mixer.
UnrealPakTool will convert and compress our Unreal Engine project files into one file of .pak format, which is required in order to include our mod within Trepang2.

You will need to download the Epic Games Launcher in order to download Unreal Engine 4.27.2. This version is ideal as the in-game engine version is also 4.27. The download and installation process is simple enough, so I won’t be including it here.

We will also be downloading a free image editor, GIMP, for editing the base textures. Ultimately, it isn’t necessary to use an image editor at all, but we will in order to change the weapon skin’s color in the material blending. You can download GIMP from here: https://www.gimp.org/downloads/
Step 2: Extract Required Files
After installing all of the required tools, we can begin with extracting the game files and textures that we will need to create our custom material.
Open the FModel executable (FModel.exe), and you will be met with a directory selector pop-up, asking you to locate Trepang2 on your system (if it is indeed your first time using the application).
If you don't see Trepang2 under the “Detected Game” drop-down menu, you will need to click on the arrows underneath “ADD UNDETECTED GAME”. Locate the directory of Trepang2 on your PC (for Steam versions, it is under ~/Steam/steamapps/common/Trepang2). It may be different for other platforms (such as GOG), you will need to locate the game files on your own in this case. Set the “UE Versions” drop-down list to “GAME_UE4_28”. Click “OK” when you are done. If you made a mistake and selected something else, you can always click on “Directory”, then “Selector” to re-open the directory selector window.


FModel Directory Selector Window

Once you have done this, you should see “CPPFPS-WindowsNoEditor.pak” under “GAME ARCHIVES” on the left side of the FModel window. Double-click on this. Navigate further into the “Content” folder, then “Weapon”. This folder contains the resources we will need to edit the Kintsugi weapon skin base textures and the weapon-specific material.
Move into the “Skins” folder, then “Base”. Select the “Materials” item and click on the packages tab located at the top-left side of the FModel window.


FModel Base Texture Packages Location

Within the packages tab, you should see a list of .uasset files. These contain all of the base textures that most weapon skins rely on. Since we are working on Kintsugi, we will only look at the files that reference “Kintsugi” here.


FModel Kintsugi Base Textures

For both of these files, right-click within FModel and select “Save Texture (.png)”.
You should see a message in the output at the bottom of the window letting you know that each file was saved successfully.

Now, we need to locate the material file from the weapon you wish to apply the skin onto. For this guide, we will be applying our material on the assault rifle. Navigate back to the “Folders” tab at the top-left and move to the “AssaultRifle” folder, then “Skins”, followed by “Material”. Click on the packages tab again, and look at files with reference to Kintsugi. There will be a file named “M_Weapon_AR_Skin_Kintsugi”. You do not need to extract this file, but remember this name, as we will need to overwrite this file with our own created material.


FModel AR Kintsugi Material File Location

If you double-click on the M_Weapon_AR_Skin_Kintsugi file, a 3D viewer will open and you can visually see how the material looks. Close out of this viewer, and look at the code that is displayed in the FModel window. Under “TextureParameterValues”, you will be able to see the referenced base textures that are used to create the Kintsugi material. At the top of the AR Kintsugi material code, you should see "M_Weapon_Skin_2ndLayerBase" under the "Parent" property; this file contains the base materials required for the VHS2 assault rifle. Click on the "ObjectPath" value for this file (i.e.: CPPFPS/Content/Weapon/Skins/Base/Materials/M_Weapon_Skin_2ndLayerBase) and FModel should automatically open this file for you (if not, navigate their manually using the file path mentioned above).
A 3D viewer showcasing the base materials/textures for the VHS2 assault rifle should appear, all you need to do is right-click on the name of the material in the window and click on "Save". It may take some time, do not close out of the window. This should save the base assets required to create this material, which is what we need to preserve the base layer of the VHS2 assault rifle in-game. Close out of the 3D Viewer window.


FModel 3D Viewer 2ndLayerBase Material Save

We should now have all of the base textures needed for our custom animated material. You can verify the base assets within FModel's "Exports" folder as shown below. The Kintsugi weapon skin textures should be extracted under Output > Exports > CPPFPS > Content > Weapon > Skins > Base > Materials.


FModel Extracted Assets Folder Locations

The picture below shows the base AR textures, that we will be applying our custom material ONTO. Ensure that you have these three files in the same path. You should also have some additional files, "vhs2_skin_wear_main.png", and others. We will be using most of these within our custom material.


FModel 3D Viewer 2ndLayerBase Extracted Assets

Now, let's extract the actual model of the VHS2 assault rifle (or whatever weapon model you choose to work with). The VHS2 assault rifle model can be found in CPPFPS > Content > Weapon > AssaultRifle, then click on the "Packages" tab in the top left.


FModel VHS2 AR Model Location

Locate "rig_assaultRifle.uasset" and double-click to open it. Once again, the Unreal 3D viewer will open with the VHS2 AR model fully textured, as it appears in the game. Right-click on the "rig_assaultRifle" name in the top-left and click on "Save" to extract the AR 3D model and its associated base texture files. The Unreal viewer program may freeze, but just wait. Once you receive the confirmation that the asset has been saved successfully, you can close out of the 3D viewer and FModel.


FModel 3D Viewer VHS2 AR Model Asset

Unfortunately, we aren't exactly ready to create our custom material just yet. When we saved "rig_assaultRifle" within the 3D viewer and FModel, it saved it as a .psk file, instead of a .obj or .fbx file. Since we want to eventually perform the mapping of UV maps in Quixel Mixer for our custom material, we will need to convert this rig_assaultRifle.psk file into .fbx or .obj. You can use any 3D modelling software that supports .psk files... or install a plugin for Blender that allows you to import .psk files (refer to step 1 for the download link).
Step 3: Editing Texture Images
We previously discussed using an image editing software, such as GIMP, for changing the color of the textures. You can skip this section if you are not interested in modifying any of the base textures, but we will cover this as it is needed for recreating the animated Kintsugi skin. As an alternative, you can also change certain texture elements within Unreal Engine, as we are creating our material later on.

Open up GIMP (I am using version 2.10.30), and under File, click on Open. Navigate to the location of the extracted Kintsugi textures (i.e.: [wherever FModel.exe is located} > Output > Exports > CPPFPS > Content > Weapon > Skins > Base > Materials[/i]) and open T_Kintsugi_Mask.png. You may notice that the webbed lines on the texture are white instead of yellow/gold; don’t worry, we can change this ourselves within GIMP.
Select the “Fuzzy Select” tool, and click on any part of the white lines. This will outline nearly every line within the texture, and from here we can easily paint them to be any color we want. Click on the “paintbrush” tool and on the foreground color element, select whichever color you wish to use. In the original modified texture, I used a darker yellow color. Under the “Windows” menu tab, hover over “Dockable Dialogs'' and click on “Tool Options”. With the “paintbrush” tool selected from the toolbox, change the brush size to a very large value, and begin coloring across the texture. Since we used the “fuzzy select” tool, you won’t need to worry about accidentally coloring outside of the lines, so you can just hold left-click across the entire texture. You can put as much detail as you would like.


GIMP Changing Kintsugi Phase 1 Texture Color

Once you are done, you can hit SHIFT+CTRL+A to deselect everything. Some thinner lines may be uncolored, you can fill them in as you wish.

This will be the initial (phase 1) texture of the animated material. We will need to export this as a PNG again; under “File”, select “Export As…” and give it a different name (such as T_Kintsugi_Mask_P1.png). We can save it where the original FModel extracted textures are, within Output > Exports > CPPFPS > Content > Weapon > Skins > Base > Materials for convenience. Click on “Export” within the “Export Image” window, once you have navigated to the FModel extracted materials directory and have provided a name. Within the following settings window, simply click “Export”.

Now we will need to create the final (phase 2) texture of the animated material. The idea is that we want the animated material to gradually transition from the phase 1 texture to the phase 2 texture. You could add more phases to create more complex materials, but we will only need 2 for this guide.
Once again, select the “fuzzy select” tool and click within any one of the lines. Now, create a new layer by pressing SHIFT+CTRL+N, and name the new layer whatever you’d like. With the new layer selected, press G to select the “gradient” tool and hit CTRL+G to bring up a toolbar list of available gradient patterns by default. In the toolbar, select the “Neon Yellow” gradient. From the bottom-left corner of the texture, click and drag to the upper-right corner and let go of the left click. Press ENTER to confirm the gradient application, ensuring that you have the new layer selected in the layers panel (bottom-right by default).


GIMP Changing Kintsugi Phase 2 Texture Color

Once you are done, you can hit SHIFT+CTRL+A to deselect everything. Export this using the same method for phase 1. I will name this texture T_Kintsugi_Mask_P2.png and save it in the same location.

You can close out of GIMP (you don’t need to save the project file unless you feel inclined). Next, we will be importing our textures and creating our animated material in Unreal Engine.
Step 4: Preparing Mod File Structure
Launch Unreal Engine 4.27.2 and create a new project. Select the “Games” project category and use the “Blank” template. Keep all project settings unchanged, but give your project a name, such as T2_AnimSkin (name here does not matter). I recommend keeping the default directory selected (but if you absolutely need to change it, keep note of the directory path). Click on “Create Project”.

When the Unreal editor window opens, click under “Edit” in the top-left, and click on “Project Settings”. In the “Search Details” search bar, type in “share”. Uncheck “Shared Material Native Libraries” and “Share Material Shader Code”. You will need to restart the Unreal Engine program to apply the changes. Next, we will need to get the UE project file directories to match Trepang2’s game file directories. You can easily do this by referring to the FModel extracted file path; everything after “CPPFPS” (i.e.: Content > Weapon > Skins > Base > Materials).

Once your UE project is re-opened, right-click within the “Content Browser” window at the bottom, and create a new folder. Name this folder “Weapon”. Within the “Weapon” folder, create a new folder named “Skins”. Within the “Skins” folder, create a new folder named “Base”. Within the “Base” folder, create a new folder named “Materials”. We will need to import our newly created textures into this location. Open the FModel extracted materials folder (Output > Exports > CPPFPS > Content > Weapon > Skins > Base > Materials) and drag in T_Kintsugi_N.png, along with the phase 1 and phase 2 textures (T_Kintsugi_Mask_P1.png, and T_Kintsugi_Mask_P2.png, respectively). We will not need the original T_Kintsugi_Mask.png texture, since we have created a copy with our own changes.


UE Importing Base Textures for Custom Material

Since we will also need to overwrite the M_Weapon_AR_Skin_Kintsugi.uasset file (as mentioned in Step 2), we will also need to replicate its directory within the game files.


FModel AR Kintsugi Material File Location

Navigate back to the Content > Weapon folder within the content browser, and create a new folder named “AssaultRifle”. Within the “AssaultRifle” folder, create a new folder named “Skins”. Within the “Skins” folder, create a new folder named “Material”. Right click on the content browser in this location (Content > Weapon > AssaultRifle > Skins > Material), and under “Create Basic Asset”, click on “Material”. Name this material file “M_Weapon_AR_Skin_Kintsugi” (exactly as the game’s material file is named).


UE Creating Custom Material

Since we will need to incorporate the base VHS2 AR textures and UV map, we will need to also import those with the appropriate file structure.
Within the Content > Weapon > AssaultRifle folder, right click on the content browser and create a new folder named "Materials". From FModel's corresponding "Exports" sub-directory ([FModel folder name] > Output > Exports > CPPFPS > Content > Weapon > AssaultRifle > Materials), drag in the three vhs2 texture files (i.e: vhs2_albedo.png, vhs2_mrh.png, vhs2_normal.png).


UE Importing Base AR Textures

Within the Content > Weapon > AssaultRifle > Skins folder, right click on the content browser and create a new folder named "Texture". From FModel's corresponding "Exports" sub-directory ([FModel folder name] > Output > Exports > CPPFPS > Content > Weapon > AssaultRifle > Skins > Texture), drag in the UV map file (i.e: vhs2_skin_wear_main.png).


UE Importing Base AR Skin UV Map

We are now ready to start designing our custom animated material.
Step 5: Designing the Custom Material in the Material Editor
Double-click on the newly created M_Weapon_AR_Skin_Kintsugi material. In the details panel at the bottom-left of the material editor/node graph editor window, scroll down to the “Usage” section, and check the “Used with Skeletal Mesh” checkbox.


UE Skeletal Mesh Details Setting

Also in the details panel, change the "Blend Mode" drop-down option to "Masked", instead of "Opaque". This will ensure that we can apply our Kintsugi material over top of the base VHS2 textures that we have previously extracted.


UE Blend Mode Masked Details Setting

Ensure the material editor window is in windowed mode, and move it so that it doesn’t obstruct the “Content Browser” section of the main window. We’ll be dragging and dropping the textures from the base textures directory into the material editor.

In the Content Browser, move into the Content > Weapon > Skins > Base > Materials folder, and simply drag the three texture files (i.e.: T_Kintsugi_Mask_P1, T_Kintsugi_Mask_P2, T_Kintsugi_N) into the material editor window’s node graph.

Next, from the Content > Weapon > AssaultRifle > Materials folder, drag in "vhs2_albedo" and "vhs2_normal" into the material editor's window node graph (you can also include "vhs2_mrh" if you want, but overall it shouldn't impact the base material much).

Finally, move into the Content > Weapon > AssaultRifle > Skins > Texture folder and drag in "vhs2_skin_wear_main" into the material editor's window node graph. This will serve as our "opacity mask", which will essentially be an indicator as to where the material will be applied across the VHS2 AR weapon.

To get the base VHS2 AR texture, hook up the "vhs2_albedo" texture sample to the "Base Color" pin.

There are a lot of ways to design a material in Unreal Engine. In this case, creating an animated material may involve applying mathematical functions such as Sine and Linear Interpolation in order to effectively transition between our texture phases. This can get very technical and as a result, I won't go into detail. I have created this material by referring to the Unreal Engine documentation and watching videos about material creation. It was a lot of trial and error, but ultimately it was helpful for learning how to use the material editor. The node graph of the material that I've created is shown below, and you can copy it, but I encourage you to play around with the values and see what results you get. I still do this and this is how I'm learning about Unreal Engine's incredible material creation system. I have also included comments on my node graph so that it may hopefully help you understand what controls which aspect of the animated Kintsugi material.

Essentially for this guide, all you need to know is to create a node, simply right-click on an empty area in the node graph editor, and use the search bar to find the corresponding function node from my image. Click on the newly spawned node, and you will be able to see its associated parameters under the “Details” tab in the bottom-left of the material editor window. Connect two nodes by left-clicking and dragging to the appropriate node’s pin (connections are represented as the white lines throughout the node graph). Solid color references (as shown in the image with the white square and “1,1,1”) are referred to as “Constant3Vector” nodes. You can press 3 and left-click at the same time to easily create a Constant3Vector node, instead of searching for it.


UE Animated Kintsugi Material Node Graph (Click on Image to Zoom In)
Note: If the node graph image above is still unclear after clicking on the image, open the image in a new tab by clicking on the URL on top of the opened image.

You can set the Lerp node's "const alpha" parameter to whatever you'd like, this will essentially control how much of the breathing effect is implemented into the Kintsugi material. Play around with it and see what results you feel look the best.
When you are done, click on the “Apply” and “Save” buttons at the top of the window. Close the material editor window. Hit CTRL+SHIFT+S to save all.

Congratulations, we have successfully created an animated material, and we are ready to cook our project files.

Step 6: Convert Mod Files to PAK Format
On the main Unreal Engine window (the window with the content browser), click on “File”, and click on “Cook Content for Windows”. Wait until the cooking process completes.

Once it has completed, open File Explorer and navigate to your Unreal Engine projects folder (if you didn’t change this, this will be within your Documents folder, under “Unreal Projects”). Find the project you have created for this guide and open it (i.e.: T2_AnimSkin as I named it earlier). From your project’s folder, move into Saved > Cooked > WindowsNoEditor > T2_AnimSkin {or your project’s name here} > Content, and copy the “Weapon” folder (we will only have this one folder in this scenario, but in the future, you would want to copy ALL of the folders that are within this directory)

In the same location that you have unzipped the UnrealPakTool, create a new folder with the name of your choice, but with “_P” as the last characters (such as: KsugiAnimMat_P). Open the new folder and create a new folder within named “CPPFPS”. Within the “CPPFPS” folder, create a new folder named “Content”. Within “Content”, paste the “Weapon” folder, from your Unreal Engine 4 project’s cooked files.


Windows Mod Folder Structure

Left-click and drag the _P mod folder (e.g.: KsugiAnimMat_P) and release it over the “UnrealPak-With-Compression.bat” file.


Windows UnrealPakTool Usage

A command prompt window will appear, and once it indicates to do so, you may close the window. You will end up with the following files (ignore the KintsugiAnim_P and the Working folder in the image below):


Windows UnrealPakTool Usage Resulting Files

Finally, all that needs to be done is copy and paste this new KsugiAnimMat_P.pak file into Trepang2’s pak directory. In a new File Explorer window, move to the Trepang2 game directory, then CPPFPS > Content > Paks (on Steam versions, the path would look like this: ~/Steam/steamapps/common/Trepang2/CPPFPS/Content/Paks).


Windows Adding PAK File to Trepang2’s Game Files

With that, we are ready to see if our weapon skin works in-game.
Step 7: Testing The Custom Animated Material
Moment of truth, time to see if all that effort paid off. Start up Trepang2 and equip the Assault Rifle. Change your current skin to the Kintsugi skin on the AR. You should see the animated material applied across the body of the AR.
If not, check to see if your mod’s folder names (+file names) are EXACTLY the same and match the paths shown in FModel. Review the necessary Unreal Engine settings mentioned within this guide.


Our Animated Kintsugi Weapon Skin
Note: I had to compress and edit this GIF a ton, so the effect looks a lot faster than it actually is. Also, the material's opacity mask (i.e: vhs2_skin_wear_main) may cause the muzzle and ejector to be invisible, try editing the opacity mask (paint white over a black portion) in an image editor to determine which section controls those two. Ultimately, it depends on how much detail you want in your materials.

If you want to apply this material across other weapons, you can duplicate the M_Weapon_AR_Skin_Kintsugi material in your Unreal project, and rename the copy to your desired weapon’s material as displayed through FModel (see Step 2 again). Ensure to extract the base materials for your desired weapon, include it in the project, replicate the path to your desired weapon’s material file in Unreal Engine, move the copied material to the corresponding weapon folder, and cook the content once again.
Questions?
Leave a comment on this guide with your question about any step of the guide and I can try to help you out. For questions about other aspects of Trepang2 modding, I recommend joining the Trepang Studios discord[discord.com] and sending your message in the #trepang-modding channel, where you can get help from some talented individuals.

This guide may be updated in the future, so be sure to check back if you are planning on creating skins.
Guide Changelog
December 12th 2023 - Implementing the use of Quixel Mixer as a step for UV mapping of base textures, to be used for the custom material in Unreal Engine

January 1st 2024 - Reworking overall guide for simplicity
1 Comments
Unselles Apr 7 @ 3:55pm 
MRH is for metallic and roughness (can't tell what H is for). Not including this texture will significantly downgrade the look of the weapon.

For anyone wondering how to plug it in, just drag the R channel into Metallic and G to Roughness. Just make sure to set the texture to Masks beforehand.