R2API

版本 v5.0.5·更新於 2023-06-06

A modding API for Risk of Rain 2

模組介紹 作者原文

R2API – a modding API for Risk of Rain 2

About

R2API is a modding framework for other mods to work in, providing centralized and simplified APIs for Risk of Rain 2.

This helps keep mods compatible with each other.

At its core, R2API should not change how the game behaves without any other mod installed.

The only change is to keep mods out of quickplay and prismatic trials by request of the Hopoo Games team.

Installation

Check out this page from the R2Wiki on how to install mods

Developing mods using R2API

Since the R2API 5.0.0 version update, mod creators should ideally only reference the packages they need in their C# projects and their packages.

In the dependency array of their manifest, they should reference the R2API packages from the RiskofThunder team, for example: RiskofThunder-R2API_LobbyConfig-1.0.0

In their C# projects, they should only get the corresponding R2API submodules dll they need.

On top of the BaseUnityPlugin, you should add a BepInDependency, for example [BepInDependency(DirectorAPI.PluginGUID)]

For then adding the dependency on the C# Project level, you can do that in a multitude of ways, depending on your workflow:

  • Nuget Package Manager:
  • You can access this in Visual Studio by right clicking your project within the Solution Explorer, and installing packages through that manager directly:
  • The packages are available under the RiskofThunder nuget account, and you can find them through the search bar by typing R2API.
  • Manually adding nuget:
  • We have a wiki page that also explains it
  • Edit your.csproj file, and in your ItemGroup (something like this), add PackageReference lines for each R2API module you depend on:
  • You can find these lines for each package on the Risk of Thunder nuget account.
  • Download the dlls directly:
  • Add them through the Solution Explorer, right clicking your project, Add -> Project Reference, and selecting the wanted.dll files.
  • If you use Unity:
  • You can download the dlls, and drag and drop the modules' dll directly into your Unity Project under any folders that are under the root Assets/ folder.

A lot of documentation is in the included xmldocs, and further information may be on the dedicated R2API wiki.

Do not hesitate to ask in the modding discord too!

Changelog

Older changelogs for this package can be found on GitHub.

'5.0.0'

  • R2API modules are now split into their own package.

Mod creators should ideally only reference the packages they need in their C# projects and their packages. Please refer to the Developing mods using R2API section for more info.

If you are a mod user, there should be no difference whatsoever with this update.

If you find any issues, please tell us in the the modding discord or the GitHub repository

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

RiskofThunder-HookGenPatcherRiskofThunder-R2API_ContentManagementRiskofThunder-R2API_NetworkingRiskofThunder-R2API_RecalculateStatsbbepis-BepInExPackRiskofThunder-R2API_DamageTypeRiskofThunder-R2API_DifficultyRiskofThunder-R2API_Orb

檔案與校驗

檔案名稱
R2API-5.0.5.zip
檔案大小
12.7 KiB
SHA-256
e3e1142c8346378b6ad6c27aaf6c3b5634840d5396e8ba18918f1406e01a946a
入庫時間
2026-10-06 19:06