REPO Mod Library
A mod library with developer friendly syntax with the goal of simplifying writing repetitive and ugly code.
About this mod Author’s original text
R.E.P.O Mod Library
Overview
The R.E.P.O Mod Library is a mod library for the game R.E.P.O, designed to provide a comprehensive set of utility functions and shared data management for modding the game. Created by Lillious &.Zer0, this library offers extensive control over player mechanics, game state tracking, and system interactions.
Compatibility
- Supports the latest version of R.E.P.O
- Compatible with MelonLoader v0.7.0 modding framework
- Compatibility may vary with BepInEx modding framework using the BepInEx.MelonLoader.Loader plugin
- Currently still in early development, so expect missing features and bugs
Key Features
The R.E.P.O Mod Library provides a comprehensive set of utilities that enable:
Scene Management
- Multi-scene Architecture: Support for different game environments including main menu, lobby, shop, arena, and truck lobby with state tracking
- Level Management: Tools for managing and accessing both gameplay and menu levels
- Map Control: Direct access to map objects and their controllers for environmental manipulation
Player Systems
- Movement Mechanics: Configurable movement speeds for walking, sprinting, and crouching
- Energy System: Customizable energy mechanics with adjustable maximum capacity and sprint drain rates
- Gravity Manipulation: Special movement abilities including anti-gravity effects and custom gravity settings
Enemy Control
- Enemy Management: Functions to count, freeze, or disable enemies across the level
- Controller Access: Ability to manipulate enemy controllers for gameplay adjustments
System Architecture
- Manager Framework: Centralized access to critical game systems including:
- Stats tracking
- Run management
- Graphics settings
- Gameplay rules
- Asset management
- Audio control
- Network functionality
- Steam Integration: Support for Steam player identification
Game State Utilities
- State Tracking: Comprehensive tracking of game state across different scenes and modes
- Level Generation: Access to level generation systems for dynamic content creation
Player Data
- Player Information Persistence: Mechanisms to maintain player data across different game states
- Player Stats Customization: Tools for modifying player capabilities and performance
Installation
- Install this nuget package to your project
- import the library into your mod
Usage Example
using MelonLoader;
using Repo_ExampleMod;
using Repo_Library;
// MelonInfo attribute to define the mod information
[assembly: MelonInfo(typeof(Example), "R.E.P.O Example Mod", "1.0.0", "Example")]
// MelonGame attribute to specify the game the mod is for
[assembly: MelonGame("semiwork", "REPO")]
// Namespace for the mod
namespace Repo_ExampleMod
{
public class Example: MelonMod
{
private readonly Library Repo_Lib = new Library();
// Override the unity update method
public override void OnUpdate()
{
// Check if player is in game
if (!Repo_Lib.IsInGame()) return;
// Get the player controller
PlayerController playerController = Repo_Lib.GetPlayerController();
// Check if player is sprinting
if (Repo_Lib.IsSprinting(playerController))
{
// Set the sprint energy drain to 0
Repo_Lib.SetSprintEnergyDrain(playerController, 0f);
// Set the player's energy to the max energy
Repo_Lib.SetPlayerCurrentEnergy(playerController,
Repo_Lib.GetPlayerMaxEnergy(playerController));
}
}
}
}
Documentation
The following provides information about the utility functions available in the game system. These functions are categorized based on their purpose and functionality.
Action Events
| Function | Description |
|----------|-------------|
| OnEnemyDeath | Event triggered when an enemy dies | GameObject enemy |
public override void OnInitializeMelon()
{
Library.OnEnemyDeath += (enemy) =>
{
MelonLogger.Msg("Enemy Died: " + enemy.name);
};
}
| OnItemDestroyed | Event triggered when an item is destroyed | GameObject item |
public override void OnInitializeMelon()
{
Library.OnItemDestroyed += (item) =>
{
MelonL
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.