Difference between revisions of "How to add new game (UMM)"

From Nexus Mods Wiki
Jump to: navigation, search
Line 1: Line 1:
Reserved
+
 
 +
== How to ==
 +
 
 +
The [[:Category:Unity_Mod_Manager|UnityModManager]] can support most of games on the Unity engine, you just need to create rules for how the [[:Category:Unity_Mod_Manager|UMM]] will interact with&nbsp;game.<br/> Find 'UnityModManagerConfig.xml' configuration file and add the code for the new game.
 +
<pre><GameInfo Name="Some Game">
 +
<Folder>GameFolder</Folder>
 +
<ModsDirectory>Mods</ModsDirectory>
 +
<ModInfo>Info.json</ModInfo>
 +
<GameExe>somegame.exe</GameExe>
 +
<EntryPoint>[UnityEngine.UIModule.dll]UnityEngine.Canvas.cctor:Before</EntryPoint>
 +
<StartingPoint>[Assembly-CSharp.dll]App.Awake:After</StartingPoint>
 +
<UIStartingPoint>[Assembly-CSharp.dll]MainMenu.Start:After</UIStartingPoint>
 +
</GameInfo></pre>
 +
 
 +
Only all fields need to be replaced by your actual data.
 +
 
 +
== Some details ==
 +
 
 +
''Name ''- Game name.<br/> ''Folder ''- Name of game folder, for example, as in steam. UMM will try to find path to game by this name.<br/> ''ModsDirectory ''- Mods folder.<br/> ''ModInfo ''- The info file from which to start scripts.<br/> ''GameExe ''- Game launch file. Required for Doorstop method.<br/> ''EntryPoint ''- The path to function where UMM will be installed. Required for Assembly method.<br/> ''StartingPoint ''- The path to function where the mods will be loaded. Required for Doorstop and Assembly method.<br/> ''UIStartingPoint ''- The path to function where to start UMM UI. Optional.<br/> ''OldPatchTarget ''- For new games is not needed.
 +
 
 +
== How to find the Point ==
 +
 
 +
Open the ''Assembly-CSharp.dll'' file (located in the ''Game_Data\Managed''&nbsp;game folder) via&nbsp;the&nbsp;'''[https://github.com/0xd4d/dnSpy Dnspy]''' tool.<br/> Look for a function that runs as early as possible. Most often their class is called App, Main, Menu.<br/> You should have as '''[Assembly-CSharp.dll]App.Awake:After'''<br/> ''App ''- Class (add namespace if present).<br/> ''Awake ''- Function.<br/> '':After&nbsp;:Before'' - Run before or after.
 +
 
 +
== Finally ==
 +
 
 +
If the UMM UI appears when starting game, it means it works.<br/> Send the new code to the '''[https://www.nexusmods.com/site/mods/21/?tab=forum&topic_id=7406516 forum]''' and with next update it will be added to UMM.
 +
 
 
[[Category:Unity Mod Manager]]
 
[[Category:Unity Mod Manager]]

Revision as of 13:13, 17 February 2019

How to

The UnityModManager can support most of games on the Unity engine, you just need to create rules for how the UMM will interact with game.
Find 'UnityModManagerConfig.xml' configuration file and add the code for the new game.

<GameInfo Name="Some Game">
	<Folder>GameFolder</Folder>
	<ModsDirectory>Mods</ModsDirectory>
	<ModInfo>Info.json</ModInfo>
	<GameExe>somegame.exe</GameExe>
	<EntryPoint>[UnityEngine.UIModule.dll]UnityEngine.Canvas.cctor:Before</EntryPoint>
	<StartingPoint>[Assembly-CSharp.dll]App.Awake:After</StartingPoint>
	<UIStartingPoint>[Assembly-CSharp.dll]MainMenu.Start:After</UIStartingPoint>
</GameInfo>

Only all fields need to be replaced by your actual data.

Some details

Name - Game name.
Folder - Name of game folder, for example, as in steam. UMM will try to find path to game by this name.
ModsDirectory - Mods folder.
ModInfo - The info file from which to start scripts.
GameExe - Game launch file. Required for Doorstop method.
EntryPoint - The path to function where UMM will be installed. Required for Assembly method.
StartingPoint - The path to function where the mods will be loaded. Required for Doorstop and Assembly method.
UIStartingPoint - The path to function where to start UMM UI. Optional.
OldPatchTarget - For new games is not needed.

How to find the Point

Open the Assembly-CSharp.dll file (located in the Game_Data\Managed game folder) via the Dnspy tool.
Look for a function that runs as early as possible. Most often their class is called App, Main, Menu.
You should have as [Assembly-CSharp.dll]App.Awake:After
App - Class (add namespace if present).
Awake - Function.
:After :Before - Run before or after.

Finally

If the UMM UI appears when starting game, it means it works.
Send the new code to the forum and with next update it will be added to UMM.