User Tools

Site Tools



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 API - The UMF API gives you access to various functions that makes modding easier, and is also required in order for the mod to be started.
  • Modding Guides - A list of guides to assist you in creating mods for UMF.
  • Harmony - Harmony is a useful library provided with UMF that lets you overwrite and inject code in MEMORY into existing classes and functions.
  • Example Mods - A list of open source UMF mods you can use as examples to better learn coding with UMF.
  • Source Mods - UMF can compile and run mods at runtime directly from .cs files.
  • UMF Patch - An IL-based UMF scripting patch system used as a last resort to let you automatically overwrite code in dll files on disk when Harmony can't access it in any way.
  • Mod Installer - The UMF Mod Installer (URI Handler) lets you create one click Install links for your mods.
  • UMF Hosting - This will show you the steps to having your mod added to mod list on this website.

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)

This topic does not exist yet

You've followed a link to a topic that doesn't exist yet. If permissions allow, you may create it by clicking on Create this page.

modcreation.txt · Last modified: 2024/04/24 23:22 by