Testing Multiplayer Alone
source:
!localnetwork
and!exeshortcut
in the Risk of Rain 2 Modding Discord server.
Connecting two local instances of the game
- Add the following line to the
Awake()
function of yourBaseUnityPlugin
subclass:// Remove this line before publishing/releasing your mod! On.RoR2.Networking.NetworkManagerSystemSteam.OnClientConnect += (s, u, t) => {};
- Alternatively, you can install the mod Nuxlar-MultiplayerModTesting instead (read the README for usage)
- Note: only the host mod profile should have this mod enabled. Otherwise, clients will be spawned in as Commando(??)
- Alternatively, you can install the mod Nuxlar-MultiplayerModTesting instead (read the README for usage)
- Launch two instances of the game
- Host a private lobby with one instance
- Open the console on the other instance and input
connect localhost:7777
Create an executable shortcut for modded profiles
You can create a shortcut that points to the Risk of Rain 2 executable that, when clicked, will open an instance that corresponds to a desired r2modman profile. This is especially useful in scenarios where you need two instances of the game open, such as when testing networking locally.
Steps
- Create a shortcut of your Risk of Rain 2 executable
- Windows: right-click
Risk of Rain 2.exe
, then "Create shortcut" in the context menu
- Windows: right-click
- Open the properties of the new shortcut
- Windows: right-click the shortcut, then select "Properties" in the context menu
- Copy your preferred r2modman profile's launch parameters
- Open r2modman
- Select profile
- "Settings" section > "Debugging" tab > "Set launch parameters" option
- Copy the inline code block labelled "Modded"
- Append the launch parameters to the "Target" field of the shortcut's properties
# Example # before "C:\Program Files (x86)\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2.exe" # after "C:\Program Files (x86)\Steam\steamapps\common\Risk of Rain 2\Risk of Rain 2.exe" --doorstop-enabled true --doorstop-target-assembly "C:\Users\user\AppData\Roaming\r2modmanPlus-local\RiskOfRain2\profiles\Default\BepInEx\core\BepInEx.Preloader.dll