Getting started making mods
There are two forms of mods you can make: Loose files, and Unity asset bundles.
Unity asset bundles are generally the more flexible when it comes to performance, disk usage, and access to more things, but loose files are a fine way to do it as well.
Loose files
To work with loose files you essentially place the files in a special folder that Fairtravel Battle reads mod files from.
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
Please note that these folders don't exist until you run the game at least once!
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.
You have to copy the asset bundle into a specific folder that Fairtravel Battle reads files from.
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
Please note that these folders don't exist until you run the game at least once!
Then copy the asset bundle file (a file specifically called coolmod
in this example) into a folder with the same name (For example, coolmod/coolmod
).
Finalizing the setup
Finally, to activate the mod you can go to the in-game settings and select the mod manager.
Tick the checkbox for the mods you want to use, then press Update
. This will reload the mods, and can be used to test changes without needing to close the game!
Afterwards the main scene will reload and you can test the results of your mod!
The End
This is the end of this guide. From here on out, you can do other things: