# Modding EtG: Creating a Mod

Although this video is outdated as it specifies how to set up a mod for Mod The Gungeon (the old mod loader), it is still useful to set up the Visual Studio for Gungeon modding.

{% embed url="<https://www.youtube.com/watch?v=XAHTSP8Xlrg&t=11s>" %}

## Setup

Enable .NET 3.5 in your operating system by going to Control Panel > Programs and Features > Turn Windows Features on or off, and select ".NET Framework 3.5 (includes 2.0 and 3.0)"

![](https://1229800202-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQAkTlyeVttU3CJdmYk%2F-MQ_E5pJ5tpNJXZuV1i7%2F-MQ_IjEsv-sDOOwYIZOd%2Fimage.png?alt=media\&token=6b8b24f8-81eb-4c80-8b16-839124509002)

Install Visual Studio 2022 Community at [https://visualstudio.microsoft.com/downloads/ ](https://visualstudio.microsoft.com/downloads/)                                                         for your workloads, select “.NET desktop development” and “Game Development with Unity”&#x20;

![](https://lh4.googleusercontent.com/4GsZca6mlZRMSFBtQCC5gfOjBUuWEw8bVcqP4cJ8FXXwluJmM2JAYm-WVzDPsA3dusUn32TQPQ67fRlCKk5ILWZ3I0oYnlbi3lS4jO5bgMQlAEH1UzgwLq1TdjL2ef2gYrBnubK9)

&#x20;**For the individual components, choose these:**

&#x20;![](https://lh3.googleusercontent.com/17JBUMufMrH4isAtbJpfsrKKw8RG5kz0PRYrmcEfDKgsUuQ0se5Usbg0kvEcJGI51yZl0OBLDCYKkBzH6EQVoxYMXKPuN37LT6vS0Cgnfns3pY_OpCZ5Ys4M8f9rhsthkOh3P6hr)\
\
Now install and launch Visual Studio. Again, a proper guide for it can be located in Kyle's video at the top of the page.

\
Once that is done, go to this link (<https://github.com/SpecialAPI/BepInExExampleModItems>), and download the files by clicking on the "Code" tab and pressing "Download ZIP".

<figure><img src="https://1229800202-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQAkTlyeVttU3CJdmYk%2Fuploads%2F0TXwT8nztbNOXDnVKfky%2Fimage.png?alt=media&#x26;token=bbf34c2f-783c-45d2-a0b5-10af0c5bf6e9" alt=""><figcaption></figcaption></figure>

Once you have downloaded it, unzip the file and place the folder into your "repos" folder \
\&#xNAN;**(Usually found at C:\Users\YourName\source\repos)**<br>

Your file structure should now resemble something like this.\
Note that you can rename the folder your project files are in, it doesn't have to be \
"BepInExExampleModItems-main"

<figure><img src="https://1229800202-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQAkTlyeVttU3CJdmYk%2Fuploads%2FGxVIrxc2n0mdq33MUrxc%2Fimage.png?alt=media&#x26;token=36e5405f-6936-416f-a0c8-f237a9e2c313" alt=""><figcaption></figcaption></figure>

Double-click the file called "Mod.sln". This will open your mod project's code. When you first open it, it is near-guaranteed that you will see a **lot** of errors, so do not panic. You will need to toggle some stuff for the errors to clear away.

To start, right-click the "References" tab on your side and select "Manage NuGet packages".

<figure><img src="https://1229800202-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQAkTlyeVttU3CJdmYk%2Fuploads%2FAVYuSls7VDCoDWgRBIAn%2Fimage.png?alt=media&#x26;token=3c2f0114-850e-42df-a8d6-8b8a88e22b37" alt=""><figcaption></figcaption></figure>

Select the "Browse tab".

<figure><img src="https://1229800202-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQAkTlyeVttU3CJdmYk%2Fuploads%2Fldf3F2TfHrtkcydQ2EfK%2Fimage.png?alt=media&#x26;token=644d4319-3ffc-411f-8caf-d3d9e25b08e3" alt=""><figcaption></figcaption></figure>

Select the gear on the right side. (**Circled in green**)

<figure><img src="https://1229800202-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQAkTlyeVttU3CJdmYk%2Fuploads%2FIjsh2aU7Y6ed4kw7xA5l%2Fimage.png?alt=media&#x26;token=9c4f17eb-e6d0-4ab7-8440-fa52f03af218" alt=""><figcaption></figcaption></figure>

A window like this should open up now.<br>

<figure><img src="https://1229800202-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQAkTlyeVttU3CJdmYk%2Fuploads%2Fi8X3EOXQMWroST7qRf7e%2Fimage.png?alt=media&#x26;token=7ab6de74-c628-455f-b013-04f6227de956" alt=""><figcaption></figcaption></figure>

Click the green plus button to create a new package, rename the new package to "BepInEx", and change the "Source" tab to this link:  <https://nuget.bepinex.dev/v3/index.json>\
\
If you do not have a package that contains this link (<https://api.nuget.org/v3/index.json>), create a new package called "nuget.org" and use this link in the "Source" tab.

Once you have done that, Click **Ok**.\
Set your "package source" to "All".<br>

<figure><img src="https://1229800202-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQAkTlyeVttU3CJdmYk%2Fuploads%2FECt3vAwLbqVpINxjjALQ%2Fimage.png?alt=media&#x26;token=a24efc7c-3230-4d06-8e52-de04f8ed3805" alt=""><figcaption></figcaption></figure>

If you have everything done right, you should now have no errors.

Now, go back to your module class.

<figure><img src="https://1229800202-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQAkTlyeVttU3CJdmYk%2Fuploads%2FOEjy2ZxJnde6oCqjRuJl%2Fimage.png?alt=media&#x26;token=bfa8d805-7033-4d21-b669-78677fe036ba" alt=""><figcaption></figcaption></figure>

Change "**MOD NAME**" to whatever the name of your mod is.

Note, **Version** should ALWAYS consist of ONLY 2 decimal points (for example, 1.1.4) as anything more OR less will not be accepted.

Now, replace the relevant parts of **GUID**.  Note to NOT use any special characters or capital letters.\
each part of the GUID string represents a different thing.\
"**creator"**: replace this with the creator's name, aka your name / whatever you refer yourself to online.\
"**etg"**: do NOT change this, this represents the name of the game that is being modded, aka Gungeon.\
"**modname"**: the name of your mod. \
\
**TEXT\_COLOR** is a hex value of whatever color you want your mod's text to be in the F2 console when it is loaded into the game.

Your strings should look like this.

<figure><img src="https://1229800202-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQAkTlyeVttU3CJdmYk%2Fuploads%2FT2e0fXwEloFJtofWyJP2%2Fimage.png?alt=media&#x26;token=540da8ea-d783-475d-827f-f2884bbce1f6" alt=""><figcaption></figcaption></figure>

An issue that can occur if you do not change your mod's build name is that it will conflict with other mods. To fix this, go to the "Project" tab at the top and select "Mod Properties" at the very bottom.<br>

<figure><img src="https://1229800202-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQAkTlyeVttU3CJdmYk%2Fuploads%2FH9t0tkAKBdS2vHe6E24y%2Fimage.png?alt=media&#x26;token=75575a09-db37-4dc4-baf8-98943b8f3eb4" alt=""><figcaption></figcaption></figure>

Now, change the Assembly name and the Default namespace to a new name (preferably have both be identical)<br>

<figure><img src="https://1229800202-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQAkTlyeVttU3CJdmYk%2Fuploads%2FkkR77u7pokzhHu95pCaT%2Fimage.png?alt=media&#x26;token=d29a1164-a1a6-4506-a19d-e0d344df58ea" alt=""><figcaption></figcaption></figure>

Remember to save your project after with Ctrl + S. ALSO change any namespaces from your old default namespace name to the NEW one you just set. If you do not do this your mod will likely not build.<br>

If your mod already contains an example item as well, go to the example items file, and change the file path there to have your new Default Namespace name (However I would personally name the Assembly and Default Namespace the same thing for convenience) instead of the old one.

<figure><img src="https://1229800202-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQAkTlyeVttU3CJdmYk%2Fuploads%2FCj0wzcaV9L4VdP6WgTO3%2Fimage.png?alt=media&#x26;token=0b6d04ef-ad05-48da-a6bf-c374d4b3cc03" alt=""><figcaption></figcaption></figure>

\
To build your mod, go to the "Build" tab on the top of your screen and press "Build Solution"\
(The hotkey **Ctrl + Shift + B or Ctrl  + B** will do the same thing)<br>

<figure><img src="https://1229800202-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQAkTlyeVttU3CJdmYk%2Fuploads%2F44gh4qxwETyGGtDPw5Hm%2Fimage.png?alt=media&#x26;token=f3135a8a-ea6f-4069-a12f-be5a7d030647" alt=""><figcaption></figcaption></figure>

To be able to run your mod, navigate to the "plugins" folder in Gungeons BepInEx files. (If you are using a mod manager like r2modman, go to settings and select "Browse Profile Folder", and navigate to the plugins folder from there.)\
**Create a new folder in the plugins folder** (the name doesn't really matter but for organization call it the name of your mod). You will be placing your **mods .dll** there (the DLL is the file that will have all your code and stuff for your mod).\
To find the DLL, go back to your mods project folder and open the "bin" folder.\ <br>

<figure><img src="https://1229800202-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQAkTlyeVttU3CJdmYk%2Fuploads%2FTzcxWJPavd5M9js1TpIz%2Fimage.png?alt=media&#x26;token=a825eba0-7bef-47d0-bc25-726769df78cd" alt=""><figcaption></figcaption></figure>

From there, open the Debug folder. This folder will have a LOT of DLL files, so make sure to only copy the one you will need. Build your project if you haven't already, and find the file that has the name of whatever you set your mods Assembly name to.

<figure><img src="https://1229800202-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQAkTlyeVttU3CJdmYk%2Fuploads%2FV82moyyekgsn7EQzEQ8f%2Fimage.png?alt=media&#x26;token=8f60b875-017f-476f-be44-3b0c420ef247" alt=""><figcaption></figcaption></figure>

Copy this .dll to wherever your mod folder (**The one you made to put your mod's .dll in within the plugins folder**) and place the .dll into that folder. Since your mod uses Alexandria and MTGAPI as dependencies, make sure to download those **properly** as well. Now, run the game. (If you are using a mod manager make sure to run the game Modded.)

If you did everything right your mod should log the start-up message into the F2 console.

<br>

<figure><img src="https://1229800202-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQAkTlyeVttU3CJdmYk%2Fuploads%2FywQc8s4qzKjVsyvh8ONF%2Fimage.png?alt=media&#x26;token=581d18cd-daaa-40cd-845f-b25a81093faf" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mtgmodders.gitbook.io/etg-modding-guide/getting-started/setting-up-visual-studio.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
