Skip to content
DestroyedClone edited this page Apr 17, 2022 · 12 revisions

R2API is designed to provide an abstraction layer in order to expose and simplify APIs to allow developers to modify Risk of Rain 2 more easily, while still keeping mod interoperability in mind.

R2API SubModules:

Starting with the December Content Update for Risk of Rain 2, mods will need to explicitly request submodules to be loaded with the R2APISubmoduleDependency attribute. These are loaded under the R2API namespace.

ArtifactCodeAPI

ArtifactCodeAPI allows adding custom artifact codes for the Compound Generator(ROR2Wiki) found on Sky Meadow.

ContentAddition

ContentAddition is an all-inclusive submodule for the system RoR2 uses to load resources: content packs.

CommandHelper

Currently located under Utils.CommandHelper, CommandHelper allows mods to initialize their convars and concommands.

DamageAPI

DamageAPI allows adding custom damagetypes.

DifficultyAPI

DifficultyAPI adds a unified way for difficulty mods to add themselves to the menu.

DotAPI

DotAPI adds a way to add custom DoTs (Damage Over Time).

EliteAPI

EliteAPI adds a way to add custom Elites(ROR2Wiki).

LoadoutAPI

LoadoutAPI is used for adding skills to characters.

LobbyConfigAPI

LobbyConfigAPI adds a unified way to add rules to the pregame lobby.

NetworkingAPI

NetworkingAPI adds methods for sending and receiving netmessages.

OrbAPI

OrbAPI adds custom Orbs.

PrefabAPI

PrefabAPI is used for registering custom prefabs. They are set to not destroy on load, and can be either registered to network or not.

RecalculateStatsAPI

RecalculateStatsAPI allows a simple way of modifying character stats with conditions.

SceneAssetAPI

SceneAssetAPI allows loading assets found in scenes.

SoundAPI

SoundAPI allows custom sounds.

TempVisualEffectAPI

TempVisualEffectAPI adds a method to add temporary visual effect overlays onto characters.

UnlockableAPI

UnlockableAPI adds methods to add unlockables.

R2API Utilities

These are generally located under R2API.Utils namespace.

APISubmodule

Class that handle the loading of the r2api submodules, mod makers should be aware of this class as you need to use the R2APISubmoduleDependency attribute. It also allow to check if a specific submodule is loaded (safety check for your mod)

Notification

Currently located under R2API namespace, this class is for creating generic notifcations.

ChatMessage

Eases up creating (colored) chat messages on mods.

ManualLogSourceExtension

After using R2API.Utils, this allows mods to generate block messages on their Logger provided by BepInEx.

Reflection

After using R2API.Utils, this extends types and objects with cacheable reflection methods. See the Risk of Thunder Wiki.