Risk of Rain 2

Risk of Rain 2

106 ratings
Unlock playable Bandit/HAN-D/Monsters
By khbat
This guide shows how to hack the game's DLLs to unlock unavailable characters like the Bandit or HAN-D, or even play as monsters or bosses.

This guide may not work anymore in future patch, but the general idea should stay the same.

Also if you don't want to bother doing it yourself, use this mod https://thunderstore.io/package/Mattomanx77/BanditMod/

If you are interested in modding, join the Risk of Rain 2 Modding discord server[discord.gg]
   
Award
Favorite
Favorited
Unfavorite
Getting stuff ready
dnSpy
First, download dnSpy[github.com], make sure to download the binaries not the source code.

Now we need to get some files ready.

Assembly-CSharp.dll
Go to your steam library, right click on Risk of Rain 2 > Properties > Local Files > Browse Local Files.
Then navigate to "Risk of Rain 2\Risk of Rain 2_Data\Managed\". Find "Assembly-CSharp.dll" and backup that file (copy paste it somewhere safe).
This step is important, if you mess something up you will have to restore the original DLL.

Profile xml file
Navigate to <Steam path>\userdata\<User id>\632360\remote\UserProfiles\
<Steam path> depends on your installation, for me it's C:\Program Files (x86)\Steam\.
There you will find and xml file that contains your Risk of Rain profile, we will edit it to unlock characters later.
Setting the game as modded
IMPORTANT
Come back to this after you have finished the rest of the guide, i'm just putting it here so you don't miss it

Search for the RoR2Application class, Ctrl+F "isModded" and go the its definition, right click it and go to Right Click > Edit Method (C#)... and set it to true


Tips
Usually when a class don't want to compile an throws weird errors, try editing methods instead.
Adding the Bandit
Looking for SurvivorCatalog
Open dnSpy, then drag and drop Assembly-CSharp.dll in dnSpy.

IMPORTANT You need to drag and drop the Assembly-CSharp.dll in "Risk of Rain 2\Risk of Rain 2_Data\Managed\", not the backup you made.

You should have something like this:

Now click on the search button next to the Start button

In the search bar, type SurvivorCatalog, double-click the first result.
Now the SurvivorCatalog class should be opened, it's a file with some code, we are going to edit the code to add the Bandit.

Fixing broken code
Right click anywhere in the SurvivorCatalog tab and click on Edit Class (C#)...
A new window should appear and you can now edit the code.

Scroll down to line 139, you should have this:


Now select everything from line 139 to line 145 and replace it with this:
while (enumerator.MoveNext()) { SurvivorDef survivor = new SurvivorDef(); survivor = enumerator.Current; ViewablesCatalog.Node survivorEntryNode = new ViewablesCatalog.Node(survivor.survivorIndex.ToString(), false, node); survivorEntryNode.shouldShowUnviewed = ((UserProfile userProfile) => !userProfile.HasViewedViewable(survivorEntryNode.fullName) && userProfile.HasSurvivorUnlocked(survivor.survivorIndex) && !string.IsNullOrEmpty(survivor.unlockableName)); }

Adding bandit to idealSurvivorOrder
While still in the edit class window, scroll down to line 165, you will find something called "idealSurvivorOrder", add SurvivorIndex.Bandit at the end of the list, it should look like this:


Adding bandit to SurvivorCatalog
Scroll up to line 75, you will find
SurvivorCatalog.survivorDefs = new SurvivorDef[7];
Every time you will add a survivor, you will need to increment that number (right now it's 7)
Since we only have 6 survivors, we will not increase the number of survivorDefs, the size is 7 probably because a survivor was removed before release and the devs forgot to decrease the array size.

After that we have 6 SurvivorCatalog.RegisterSurvivor, to add one for the bandit, copy everything from line 115 to line 122 (mercenary) and paste it right after.
  • Change SurvivorIndex.Merc to SurvivorIndex.Bandit
  • Change MercBody to BanditBody
  • Change MercDisplay to BanditDisplay (probably useless since bandit doesn't have a display prefab)
  • Change MERC_DESCRIPTION to BANDIT_DESCRIPTION (also useless, description tokens can be added in "Risk of Rain 2\Risk of Rain 2_Data\Language\EN_US\CharacterBodies.txt" if you want to)
  • You can change primaryColor which is the color of the UI elements when selecting a survivor among other things
  • Change Characters.Mercenary to Characters.Bandit

In the end it should look like:


Then, click on the compile button:

If it doesn't compile, you did something wrong.

Then go to File > Save Module... > OK

Unlocking the Bandit
Now navigate to that profile xml file from earlier, open it with a text editor and scroll to the bottom, you will see where the unlocked characters are, add the Bandit like this:
<unlock>Characters.Bandit</unlock>

If you did everything correctly, the bandit should be available:


If the game doesn't work, restore the original DLL file and try again.
Adding HAN-D
Adding HAN-D to SurvivorIndex
Adding HAN-D will be the same as adding Bandit, however he is missing from the SurvivorIndex list so we can't add him to SurvivorCatalog yet.

Search for SurvivorIndex enum and double click it, it should be like this:


Right click > Edit Class (C#)... and add HAND after Toolbot like this:

Then click Compile.

Tips
If right clicking SurvivorIndex doesn't give you the "Edit Class" option, try right clicking SurvivorIndex in the Assembly Editor on the left.

Now for some reason it doesn't directly get added to SurvivorIndex, and you will get an error if you try to compile SurvivorCatalog, you first need to save the dll, File > Save Module... > OK and close and reopen dnSpy.

Now back to SurvivorCatalog, add HAN-D to idealSurvivorOrder:


Increase survivorDefs array size to 8:


And add a RegisterSurvivor for HAN-D:


You don't need to unlock HAN-D in the xml file, he will get removed if you launch the game anyway, we will talk about this later when we add playable mobs.

You can now play as HAN-D:
Adding Monsters
A note about SurvivorIndex
When you add something to SurvivorIndex, dnSpy will add numbers values to the elements, you have to keep the Count element the last.
For example I added HAND, Lemurian and ImpBoss, it should look like this:

When you compile the order will change but that's not important.

Also don't change the order of the elements, otherwise it will mess with the SurvivorCatalog class.

Adding Lemurian and ImpBoss
First the idealSurvivorOrder:


Then RegisterSurvivor:


Don't forget to increase the survivorDefs array size:


Scroll a bit above idealSurvivorOrder, you will find a value called survivorMaxCount, you will need to increase it to add characters slots:


Edit the GetSurvivorDef function so that survivorIndex > SurvivorIndex.<thing> where <thing> is the last survivor that you added, in this case ImpBoss:


If you messed up with the SurvivorIndex order, you have to make sure that this condition (right after the last RegisterSurvivor) looks like this:



Hit compile and save the DLL, now you can add any mob as a playable character


List of bodies in the game
If you want to add anything else, follow the same steps and use one of the bodies perfab in this list:
https://pastebin.com/raw/5MTph2Hw
156 Comments
green bean Jul 6, 2024 @ 10:52am 
EASY WAY: get thunderstore mod manager and download monster mash (and the other essentials)
Stelcoboy Apr 4, 2020 @ 11:06pm 
doesn't seem to work anymore due to changes with the UI in the artifact update, adding bandit/normal playable survivors works, but monsters like lemurian or debug stuff like commandoperformanetest gets converted to a normal commando.
Mett Dec 19, 2019 @ 7:30pm 
While it DOES load you in right for a majority of them, yeah, you can't move or shoot with them anymore, which is really a shame. There's probably a workaround somewhere else...
UnprecedentedStudios Dec 18, 2019 @ 12:03pm 
I don't think this method works anymore. None of the monsters I modded in will move or shoot anymore (Even ones that moved or shot previously like Bandit, Lemurian, etc.)
rex8112 Oct 27, 2019 @ 10:58am 
Thanks
UnprecedentedStudios Oct 27, 2019 @ 8:00am 
Only matchmaking
rex8112 Oct 27, 2019 @ 1:11am 
If I want to join a private lobby with friends, do they have to also set modding to true or does that only affect matchmaking?
UnprecedentedStudios Oct 4, 2019 @ 6:48pm 
@ExtremEnder What worked for me is uninstalling and then reinstalling Risk of Rain 2, then making a backup of the DLL file. I had the same problem before and I solved it by bringing back my backup. If your backup doesn't compile either then it's out of date and the backup needs to be replaced.
EndyWendy Oct 3, 2019 @ 1:16pm 
Hi. The code won't compile even if i don't add anything or change anything. I have no clue how to fix this.
Popup Headlights Jul 18, 2019 @ 12:24am 
Hey my man, i think im running into trouble with adding Assassin. Now for last patch it worked fine, and when the update came I had to re add my own characters, but now I can't seem to unlock the Assassin character. I tried adding him to the XML file but the entry gets removed upon starting the game. Overall, im not sure how I can unlock him again, maybe the devs are cracking down and this is their way to prevent this?