Table of Contents

Requirements




Mod Project Files

  1. Run UMF.ProjectGenerator.exe in \uModFramework\Tools\ and fill in the data, then click Generate Project Files.
    1. Mod name with no spaces or special characters. This is used for the project files, class and assembly name.
    2. Where to save the source code of the mod.
    3. If a game has more than one data/managed folder choose the appropriate one. (32bit/64bit/etc)
    4. Harmony is used to overwrite existing code or inject new code into existing functions.
    5. Unity Scripting is used to add new code to the game, the same as the game already uses. See the Unity Script Reference to learn about how MonoBehaviour GameObjects work.
    6. All References adds all dll files in the Managed folder as References, giving you access to all Unity classes as well as any separate classes the game provides. Only use if you know what you are doing.
  2. Open your project solution by double clicking ModName.sln in the newly opened folder.
  3. Add your code and click Build > Rebuild. (Rebuild will clean your project before each build.)




Decompiling Game Code

In order to modify existing game code or figure out which game code you want to interface with you must decompile the game code using any decompiling program.
Due to the vast superiority of dnSpy we highly recommend you use it to browse the game code.
Once you have installed dnSpy follow these steps:

  1. Run dnSpy once so that it integrates with windows explorer's right click context menu.
  2. Navigate to …\<Game Folder>\<Game Name>_Data\Managed\.
  3. Right click Assembly-CSharp.dll and choose Open with dnSpy.
    • Alternatively you can click File > Open inside the dnSpy and open this file.
  4. Navigate through the Assembly Explorer on the left side until you reach the - namespace (Code not having any namespace).
    • This is where you will find the vast majority of the game code for most games.
    • Some games may use other namespaces for some of it's code.
  5. Use the Assembly Explorer, Search and Analyze tools of dnSpy to discover code relevant to what you want to mod and learn where it is tied to.




Important Links and Info

UMF starts and access mods through Attributes.
Mods can currently be provided as .cs files, .dll files, .zip files(containing .dll files), and .umfmod files(packed and encrypted) by the Mod Packer.
UMF and Mods made with UMF does not re-distribute any code or game files from games or the Unity Engine. Making them both morally and legally safe.
Mods made with UMF can also be freely sold/marketed by the Mod Creator. (Provided they don't violate the UMF License)