Omniscye-Empress_ShopLoaderAPI icon

Empress ShopLoaderAPI

A developer focused API for R.E.P.O. that simplifies custom shop loading with automatic networking, RNG selection, and BepInEx config integration.

Last updated a day ago
Total downloads 1284
Total rating 2 
Categories Tools Libraries Client-side Server-side
Dependency string Omniscye-Empress_ShopLoaderAPI-1.0.1
Dependants 2 other packages depend on this package

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100
nickklmao-REPOConfig-1.2.3 icon
nickklmao-REPOConfig

Edit mod configs in-game!

Preferred version: 1.2.3

README

Empress ShopLoaderAPI v1.0.1

A developer focused API for R.E.P.O. that simplifies custom shop loading with automatic networking, RNG selection, and BepInEx config integration.

Developers Only: This is an API for loading your custom shops. You still need to create your own shop Prefab. This API handles the loading, networking, and integration for you.

Features & Configuration

  • Automatic Config Generation: My API automatically generates a configuration entry for

  • ALL shops that use it. Users can find these under [Registered Shops] in the com.Empress.ShopAPI.cfg file to toggle them ON or OFF or use RepoConfig and use the button on the games main menu for ease of access to toggle.

  • Built-in RNG Failsafe: To prevent game-breaking overlaps, my API ensures only one custom shop is loaded per level. If a user has multiple shops enabled, the API uses Random Number Generation to select one.

  • Seamless Integration: My API automatically injects your shop into the LevelGenerator and handles the ResourceCache for both singleplayer and multiplayer pools.


For Developers

To create your own custom shop mod, follow these steps:

  1. Add EmpressShopAPI.dll as a reference in your project in your IDE.

    • Right-click on your project > Add > Reference > Browse and select the DLL.
  2. Add [BepInDependency("com.Empress.ShopAPI")] to your plugin metadata.

  3. Call ShopAPI.RegisterShop in your Awake method.

Implementation & Deployment Guide

using BepInEx;
using UnityEngine;
using Empress_ShopLoaderAPI; // Reference my API namespace
using System.IO;

[BepInPlugin("com.YourName.MyCoolShop", "My Cool Shop", "1.0.0")]
[BepInDependency("com.Empress.ShopAPI")] // Declare my API dependency
public class MyShopPlugin : BaseUnityPlugin
{
    private void Awake()
    {
        // 1. Load your AssetBundle
        // After compiling, place your asset bundle next to the .dll in your plugins folder.
        string bundlePath = Path.Combine(Path.GetDirectoryName(Info.Location), "my_shop_bundle");
        AssetBundle bundle = AssetBundle.LoadFromFile(bundlePath);

        if (bundle != null)
        {
            // 2. Load your Shop Prefab from the bundle
            GameObject myShopPrefab = bundle.LoadAsset<GameObject>("MyShopPrefabName");

            if (myShopPrefab != null)
            {
                // 3. Register it with my API
                // The second string must be a unique ID for your shop (Author/ShopName)
                ShopAPI.RegisterShop(myShopPrefab, "YourName/MyCoolShop");
            }
        }
    }
}

/* DEPLOYMENT INSTRUCTIONS: Once your mod is compiled, put your Asset Bundle file directly next to your mod's .dll file inside your mod folder (inside the BepInEx plugins folder). The code above will find it automatically using the Empress API! */

Credits

Made by Omniscye/Empress