You are viewing a potentially older version of this package.
View all versions.
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.
| Date uploaded | 11 hours ago |
| Version | 1.1.0 |
| Download link | Omniscye-Empress_ShopLoaderAPI-1.1.0.zip |
| Downloads | 1099 |
| Dependency string | Omniscye-Empress_ShopLoaderAPI-1.1.0 |
This mod requires the following mods to function
BepInEx-BepInExPack
BepInEx pack for Mono Unity games. Preconfigured and ready to use.
Preferred version: 5.4.2100README
Empress ShopLoaderAPI v1.1.0
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 thecom.Empress.ShopAPI.cfgfile. - Built-in RNG Failsafe: To prevent game-breaking overlaps, my API ensures only one custom shop is loaded per level. If multiple shops are enabled, the API uses Random Number Generation to select one.
- Seamless Integration: My API automatically injects your shop into the
LevelGeneratorand handles theResourceCachefor both singleplayer and multiplayer pools.
For Developers
⚠️ Critical Requirement: The Truck, Spawn Points, & Screens
Since version 1.1.0, this API overrides the default Shop Start Room. Because of this, you must follow these rules to prevent the game from crashing:
- Use the Module Shop as your Base: When creating your shop, use the Module Shop prefab as your foundation. It contains the working shop interior, extractor components, items ect.
- COPY THE TRUCK: The Module Shop prefab does not include a truck by default. You MUST open a standard Shop Start Room, copy the Truck parent object, and paste it into your custom shop prefab.
- Why? The Truck handles the game's Spawn Points, Truck Screens, and critical level logic. If you do not have the Truck object in your prefab, the game will find zero spawn points and crash.
Implementation Guide
- Add EmpressShopAPI.dll as a reference in your IDE project.
- Add
[BepInDependency("com.Empress.ShopAPI")]to your plugin metadata. - Call
ShopAPI.RegisterShopin yourAwakemethod.
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")]
public class MyShopPlugin : BaseUnityPlugin
{
private void Awake()
{
string bundlePath = Path.Combine(Path.GetDirectoryName(Info.Location), "my_shop_bundle");
AssetBundle bundle = AssetBundle.LoadFromFile(bundlePath);
if (bundle != null)
{
GameObject myShopPrefab = bundle.LoadAsset<GameObject>("MyShopPrefabName");
if (myShopPrefab != null)
{
// Register your prefab (ensure it has the TRUCK object inside!)
ShopAPI.RegisterShop(myShopPrefab, "YourName/MyCoolShop");
}
}
}
}
Credits
- Omniscye / Empress