For Farthest Frontier players, since this is a unity game, so it has the possibility to be modded with MelonLoader and this guide will explain how.
Step 1 : Downloading required tools
You need to download 3 things :
- MelonLoader [github.com]
- Il2CppDumper [github.com]
- Visual Studio 2022 (with .NET Framework 4.7.2) any edition (community edition is enough)
The first tool will help us to load our mod into Farthest.
The second tool will dump some DLLs we need to have from Unity.
The last one will compile our mod into DLL format file. (I will not detail here how to install Visual Studio 2022, there are many videos on YT for you :))
Step 2 : Installing MelonLoader
So now, we have to install our tools. For MelonLoader, you should have downloaded the installer from previous step.
Launch the installer and you shoud see that :
Now click on “Select” button and open your exe file :
Click on “Install”.
You should see now a bunch of new folders/files into your main folder :
Congrats ! You installed the loader for mods !
Step 3 : Dumping Unity Dlls
Now we absolutely need to get those DLLs to reference them in our modding project in Visual Studio.
So, extract zip folder of “Il2CppDumper” and open the “Il2CppDumper.exe”:
You should have a console opened asking you to open a file :
Open the “GameAssembly.dll” file as shown above. The program will ask you to open a second file. This second one is located in “Farthest Frontier\Farthest Frontier_Data\il2cpp_data\Metadata” and is called “global-metadata.dat”. After this second file opened, the program should have extracted the DLLs:
Note : You !!! WILL HAVE TO REPEAT THIS STEP TO KEEP YOUR MOD UPDATED !!!
A new folder has been created in “Il2CppDumper.exe” folder called “DummyDll”
This folder contains all DLLs we need for Visual Studio :
Step 4 : Making mod
First thing we need to do is to create our modding project with Visual Studio :
Be sure you selected DLL with . NET Framework, it won’t work otherwise !
You now have a new sample project with basic class :
Let’s add DLLs from MelonLoader + dumped from Farthest.
To do that, right click on “References” and add the following DLLs :
- Assembly-CSharp
- MelonLoader
- UnityEngine
- UnityEngine.CoreModule
- UnityEngine.InputLegacyModule
Those DLLs are located at :
- Assembly-CSharp : inside folder named “DummyDll” (Step 3 : Dumping Unity Dlls)
- MelonLoader : inside folder named “MelonLoader” (Step 2 : Installing MelonLoader)
- UnityEngine : inside folder named “DummyDll” (Step 3 : Dumping Unity Dlls)
- UnityEngine.CoreModule : inside folder named “DummyDll” (Step 3 : Dumping Unity Dlls)
- UnityEngine.InputLegacyModule : inside folder named “DummyDll” (Step 3 : Dumping Unity Dlls)
You have to add at least those 5 Dlls to your mod project. Notice that there are more Dlls in “DummyDll”. Here the most important is “Assembly-CSharp”. It contains most data of your game. Of course, you can add other Dlls if you want to add specific things related to Unity.
Now expand the “Properties” with icon tool above “References”. It contains a file named “AssemblyInfo.cs”. Open it and add this :
using System.Reflection;using System.Runtime.InteropServices;using MelonLoader;using ModTuto;// …[assembly: MelonInfo(typeof(Class1), “Test”, “0.0.0”, “ϞϢϘ”) ]//MelonInfo(typeof(ClassOfMod), “Game Mod Name”, “Version”, “Author”)[assembly: MelonGame(“Crate Entertainment”, “Farthest Frontier”)] //MelonGame(“Studio”, “Game”)]
Now add some sample features in our mod :
using UnityEngine;using MelonLoader;namespace ModTuto{//The class called by MelonLoader. This class has to inherit of MelonMod main classpublic class Class1 : MelonMod{public override void OnUpdate(){//This is one of Melon API function we can use to add features : https://melonwiki.xyz/#/modders/quickstart//Here only a key to exit the game and another to spawn a villager on cursor positionif (Input.GetKeyDown(KeyCode.T)){Application.Quit();}if (Input.GetKeyDown(KeyCode.V)){MelonLogger.Msg(“V pressed”);GameManager gameManager = GameObject.Find(“GameManager”).GetComponent<GameManager>();if (gameManager != null){Vector3 mousePosition = Input.mousePosition;Vector3 terrainWorldPointUnderScreenPoint = gameManager.terrainManager.GetTerrainWorldPointUnderScreenPoint(mousePosition);gameManager.villagerPopulationManager.SpawnVillagerImmigration(terrainWorldPointUnderScreenPoint, true);}}}}}
Let’s install our mod ! Build the Dll file and drop it into “Mods” folder :
Now you can press ‘T’ to leave the game or ‘V’ to spawn villager on cursor position !
If you wanna explore what you can do, you will have to search inside “Assembly-CSharp” !
Related Posts:
- Farthest Frontier Extended Camera Mod Guide
- Farthest Frontier How to Get More Builders
- Farthest Frontier How to Fix Black Screen
- Farthest Frontier Field and Farming Guide
Hi.
Thanks for great tutorial.
I am just trying it out and wanted to get building objects. How can we get an building object?
Hi,
thanks for your cool tutorial. Unfortunately i get an error, which i have been trying to debug and research for a few hours now.
My Project wont build:
Error CS0012 The type ‘Object’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘System.Private.CoreLib, Version=6.0.0.0, …
The error is for the Method from the Unity dll files… I have installed and uninstalled all kinds of .NET Framework (2.0.0 – 6.0.0) and rebooted. I have installed the new Unity and the Visual Studio plugin. I have tried so many things…
I even tried Visual Studio Community 2017 as suggested elsewhere.
I would appreciate it tons, if u had any insight regarding this. Thanks again for your efforts to share this tutorial with us!
I found out what the issue was. I accidentally downloaded the .net-6-release of IL2CPP, which generates the undesired dll files. Once i chose the correct release, everything went fine.
Thanks again for your tutorial. Worked like a charm.
I have had another problem. Again with the DLL Files created by IL2CPP. They seem to not generate all the necessary symbols.
For instance they generate the field ResourceManager.fishingShacksRO. But that is not usable. A MethodIsMissingException is thrown at runtime when trying to access that. Your example code worked with the DLLs though!
But fortunately the whole IL2CPPDumper process is not necessary, because MelonLoader already dumps and generates all the necessary DLL files and places them under:
…Steam\steamapps\common\Farthest Frontier\MelonLoader\Managed
and
…Steam\steamapps\common\Farthest Frontier\MelonLoader
With these DLL files i was able to create an advanced Mod that puts event listeners on fishingShacks to be notified for depletion of resources. My next step is to figure out how to turn that into an ingame notification.
Without your tutorial i would not have gotten this far, though.
Thanks
What version of IL2CPPDumper did you download? I also downloaded net6 version and it gave me errors, I have tried win version and still getting errors.