User:Discode/Modding Getting Started: Difference between revisions
(Created page with " This a guide on how to setup the development environment and a quickstart guide to modding using an example. == Getting Started == [https://visualstudio.microsoft.com/downloads/ Download Visual Studio 2019 or 2022] Make sure to install .NET desktop development. It should say ".NET Framework 4.7.2 development tools" is included on the right. thumb|Visual Studio Installer|500px|right Create a new folder where you would like to store...") |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
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] | ||
Make sure to install .NET desktop development. It should say ".NET Framework 4.7.2 development tools" is included on the right. | Make sure to install '''.NET desktop development'''. It should say ".NET Framework 4.7.2 development tools" is included on the right. | ||
[[File:Visual Studio Installer.png|thumb|Visual Studio Installer|500px|right]] | [[File:Visual Studio Installer.png|thumb|Visual Studio Installer|500px|right]] | ||
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. | |||
== Helpful Resources == | |||
* [https://github.com/kuronekotei/ElinMOD/tree/main Elin Mod Examples] | |||
* [https://github.com/MinusGix/ElinExampleMod Elin Mod Template] | |||
* [https://weaselofdeath.github.io/ElinModdingDocumentation/index.html Elin Modding Documentation] | |||
== Sources == | |||
Using [https://translate.google.com/?sl=auto&tl=en&op=websites "Google Translate] on: | |||
* [https://docs.google.com/document/d/e/2PACX-1vQQ35ofQBT5yILPeZ4c5uMkmGOPMrT12f1vTvfi2dFgrt1T70lr8yMOpRAwZ_3cMvUNRsVR0Cf3qabh/pub "Simple Guide to Elin Mods and the Steam Workshop (Japanese)"] | |||
* [https://docs.google.com/document/d/e/2PACX-1vSTUbE4WqcTODq-lFCX_hMK1Mqb5cTlrdY2E94PlqGQvtDcxwMEtfYteRhkZrpZreGAFV-JgOB-qs6b/pub "Simple Mod Creation Guide using Unity. (Japanese)"] | |||
* [https://docs.google.com/document/d/e/2PACX-1vSu2UfqCJl5095uOlem2Y3al20JotndDJcB3wjh82O2nQJ4yx8fC__IfUF6M_QRoWbb0Di9mdDnM3_Q/pub "Trying Out a Simple Script Mod.(Japanese)"] | |||
* [https://docs.google.com/document/d/e/2PACX-1vR3GPx71Xnjfme6PtdqNnS5GnxlOFr2A8KdzH8bYTEwEOCgeVYROi3YaMQ2_h4qsySU_BORHKXPUi9i/pub "Adding Characters or Items by Importing Excel Data.(Japanese)"] | |||
* [https://docs.google.com/document/d/e/2PACX-1vQarTe5F0AfMXSlEPkpDpncci-pDI5U6p2VYGhOoR0ZZfalic6FBBwCrd3KbIY_l7Nlt7Rv01XE4yk7/pub "Various Experiments with Mods(Japanese)"] |
Latest revision as of 01:24, 23 November 2024
This a guide on how to setup the development environment and a quickstart guide to modding using an example.
Getting Started
Project Setup
Download Visual Studio 2019 or 2022
Make sure to install .NET desktop development. It should say ".NET Framework 4.7.2 development tools" is included on the right.
Create a new folder where you would like to store your mods, name it whatever you want.
Create 3 folders inside this folder named: Elin, BepInEx and Mods.
Navigate to your Elin folder. (You can find your Elin folder by going to Steam, right clicking Elin>Properties, and under Installed Files, click "Browse".)
Under /Elin/Elin_Data/BepInEx/core, copy these files to the BepInEx folder you made:
- 0Harmony.dll
- BepInEx.Core.dll
- BepInEx.Core.xml
- BepInEx.Unity.dll
- BepInEx.Unity.xml
Under /Elin/Elin_Data/Managed/, copy these files to the Elin folder you made:
- Elin.dll
- Plugins.BaseCore.dll
- Plugins.UI.dll
- Reflex.dll
- UnityEngine.dll
- UnityEngine.CoreModule.dll
If a .dll is missing in a project you're trying to build, simply go to your game's folder and look for them.
Now run Visual Studio, create a new project: Class Library (.Net Framework)
Set the location to the Mods folder you created
Check the box that says Place solution and project in the same directory.
Set the Framework as .NET Framework 4.7.2
After creating your project, go to your Solution Explorer, right click References, click Add References.
In the Reference Manager, browse to the 3 folders you created and add all the .dlls from the Elin and BepInEx folder you made.
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:
<?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>
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 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.
Helpful Resources
Sources
Using "Google Translate on: