13
edits
No edit summary |
|||
Line 2: | Line 2: | ||
This a guide on how to setup the development environment and a quickstart guide to modding using an example. | This a guide on how to setup the development environment and a quickstart guide to modding using an example. | ||
== Getting Started == | == Getting Started == | ||
=== Project Setup === | |||
[https://visualstudio.microsoft.com/downloads/ Download Visual Studio 2019 or 2022] | [https://visualstudio.microsoft.com/downloads/ Download Visual Studio 2019 or 2022] | ||
Line 46: | Line 47: | ||
[[File:ReferenceManager.jpg|thumb|Create a new project|500px|center]] | [[File:ReferenceManager.jpg|thumb|Create a new project|500px|center]] | ||
Make sure they're checked marked to the left on each .dll's name. | Make sure they're checked marked to the left on each .dll's name. | ||
=== Adding XML File === | |||
In Visual Studio, right click the name of your project under '''Solution Explorer>Add>New Item'''. | |||
Click '''Data''' on the left and add an '''XML File''', name it '''package.xml'''. | |||
Add this to '''package.xml''': | |||
<nowiki> | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<Meta> | |||
<title>newElinModd</title> | |||
<id>new_Elin_Mod</id> | |||
<author>author</author> | |||
<loadPriority>100</loadPriority> | |||
<description> | |||
Test Mod | |||
</description> | |||
<version>0.23.30</version> | |||
</Meta> | |||
</nowiki> | |||
On the Solutions Explorer, left click '''package.xml'''. Then on the right side of Visual Studio, on the '''Properties''' window, set '''Copy to Output Directory''' to '''Copy always'''. | |||
This project is now setup to make mods. Save it as a template when you make another mod. | |||
=== QOL Settings === | |||
==== Set References' Copy Local to False==== | |||
Highlight all references except '''Analyzers''' under '''Solution Explorer'''. | |||
On the right window of Visual Studio is '''Properties''', change '''Copy Local''' to '''False'''. | |||
==== Set Release's Output path to a mod test folder==== | |||
Navigate to your game's folder: '''/Elin/Package/''' and create a folder with a name of your choice e.g '''Mod_Test'''. | |||
In Visual Studio, right click the name of your project under Solution Explorer, go to Properties and change the '''Output path''' to your '''/Elin/Package/Mod_Test''' (The folder you created.) | |||
==== Enable BepInEx Console ==== | |||
Navigate to your game's folder: '''/Elin/BepInEx/config'''. | |||
Open '''BepInEx.cfg''' with Notepad. | |||
Find '''[Logging.Console]''' | |||
Set '''Enabled = true''' | |||
Now you can use '''System.Console.WriteLine("yourStringHere");''' in your mods and obtain an output. | |||
== Example == | |||
We are now going to try building the [https://drive.google.com/file/d/1whSLZxRreKidE8VdnXwWTU_6aFG0Rh0o/view SimpleMod_example]. | |||
Download and extract it. | |||
Add a new class to your project and copy the contents of '''/SimpleMod_Example/Assets/SimpleMod/NerunTest.cs'''. | |||
Build and it should show up wherever you designated in the '''Output path'''. | |||
Verify the .dll and .xml are in the folder at '''/Elin/Package/YourFolder'''. | |||
Run Elin. | |||
The mod should be enabled by default but you can check through the mod window. | |||
Now test it by entering different zones. Nerun should pop up and tell you the zone's name. |
edits