Modder's Guide
There are two forms of mods you can make: Loose files, and Unity asset bundles.
Unity asset bundles are generally the most flexible when it comes to performance, disk usage, and access to more kinds of resources, but loose files are an easier way to get started.
Fairtravel Battle's Modding folder
There is a folder that FTB uses for modding, that stores all mods. You need to run the game at least once for that folder to exist.
The location of that folder is:
Windows
%APPDATA%\..\LocalLow\Flaming Torch Games\Fairtravel Battle\Assets
Linux
~/.config/unity3d/Flaming Torch Games/Fairtravel Battle/Assets
macOS
~/Library/Application Support/com.ftg.fairtravelbattle/Assets
Android
Plug your device into your PC and set the USB mode to File Transfer.
Android/data/com.ftg.fairtravelbattle/files/Assets
Creating mods
Loose files
To work with loose files you essentially place the files in a special folder that Fairtravel Battle reads mod files from.
Inside that folder, you can create a new folder with the name of your mod and put files in it to be visible for the game as part of the mod.
Unity asset bundles
To get started, download the latest version of Unity. The free version is enough. You will use Unity to prepare the modding data to be loaded by Fairtravel Battle. In addition, you must download the latest game data sources. These contain text files you can modify to change the game data.
Creating the Unity Project
Fairtravel Battle loads Asset Bundles created by Unity, so we must set up a new project to build them. Create a new project of any kind using Unity Hub, then create a folder called AssetBundles inside it, and inside that folder, create another folder with the name of your mod. We will use the name coolmod for this guide. You will need to create your folders in a way like AssetBundles/coolmod.
Then, while selecting the coolmod folder, on the bottom right corner of Unity, there should be a text saying Asset Bundle:. Press the button to the right of it, and choose New..., then type coolmod/coolmod.
You must then create an AssetManifest.json file in the coolmod folder.
To do so, create a new text file and copy paste the following into it:
{
"filesList": [
"*"
]
}
And finally, save it as AssetManifest.json.
Generating the asset bundle
After you have your files inside, you need to build the asset bundles. To do so, you'll need to add a script to your project:
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
using System.IO;
public class CreateAssetBundles
{
[MenuItem("Fairtravel Battle/Build AssetBundles")]
static void BuildAllAssetBundles()
{
try
{
Directory.CreateDirectory(string.Format("{0}/StreamingAssets", Application.dataPath));
}
catch(System.Exception)
{
}
BuildPipeline.BuildAssetBundles("Assets/StreamingAssets", BuildAssetBundleOptions.ChunkBasedCompression, EditorUserBuildSettings.activeBuildTarget);
}
}
#endif
This will add a Fairtravel menu option in the unity menu. When you use the Build AssetBundles option, it'll create the asset bundles for you.
Once the asset bundles are generated, they'll be inside the StreamingAssets folder in the project.
Distributing Mods
Loose files
Loose files should be distributed in a zip file. The game will automatically unzip the files!
Unity Asset Bundles
Asset bundles work as either a single file or zip file, although care must be made to ensure only one asset bundle per zip file, since Fairtravel Battle expects to find a MOD_NAME/MOD_NAME file in those cases.
Renaming an asset bundle but keeping the folder format will result in it not being loaded for an unknown reason.
You have to copy the asset bundle into the mod folder specified at the start of this page (a file specifically called coolmod in this example should be in a folder called coolmod, therefore you'd have coolmod/coolmod).
The End
This is the end of this guide. From here on out, you can do other things: