You are viewing a potentially older version of this package.
View all versions.

Date uploaded | a day ago |
Version | 1.1.0 |
Download link | Zehs-REPOLib-1.1.0.zip |
Downloads | 12133 |
Dependency string | Zehs-REPOLib-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
REPOLib
Library for adding content to R.E.P.O.
Features
- Registering network prefabs.
- Registering valuables.
Usage
Click to expand
Reference REPOLib in your project's .csproj
file.
<ItemGroup>
<PackageReference Include="Zehs.REPOLib" Version="1.*" />
</ItemGroup>
Add REPOLib as a dependency to your plugin class.
[BepInDependency(REPOLib.MyPluginInfo.PLUGIN_GUID, BepInDependency.DependencyFlags.HardDependency)]
[BepInPlugin("You.YourMod", "YourMod", "1.0.0")]
[BepInDependency(REPOLib.MyPluginInfo.PLUGIN_GUID, BepInDependency.DependencyFlags.HardDependency)]
public class YourMod : BaseUnityPlugin
{
// ...
}
Registering a network prefab.
[BepInPlugin("You.YourMod", "YourMod", "1.0.0")]
[BepInDependency(REPOLib.MyPluginInfo.PLUGIN_GUID, BepInDependency.DependencyFlags.HardDependency)]
public class YourMod : BaseUnityPlugin
{
// ...
private void Awake()
{
// ...
AssetBundle assetBundle = AssetBundle.LoadFromFile("your_assetbundle_file_path");
GameObject prefab = assetBundle.LoadAsset<GameObject>("your_network_prefab");
// Register a network prefab.
REPOLib.Modules.NetworkPrefabs.RegisterNetworkPrefab(prefab);
}
}
Registering a valuable.
[BepInPlugin("You.YourMod", "YourMod", "1.0.0")]
[BepInDependency(REPOLib.MyPluginInfo.PLUGIN_GUID, BepInDependency.DependencyFlags.HardDependency)]
public class YourMod : BaseUnityPlugin
{
// ...
private void Awake()
{
// ...
AssetBundle assetBundle = AssetBundle.LoadFromFile("your_assetbundle_file_path");
GameObject prefab = assetBundle.LoadAsset<GameObject>("your_valuable_prefab");
// Register a valuable.
REPOLib.Modules.Valuables.RegisterValuable(prefab);
}
}
Registering a valuable to a specific level.
[BepInPlugin("You.YourMod", "YourMod", "1.0.0")]
[BepInDependency(REPOLib.MyPluginInfo.PLUGIN_GUID, BepInDependency.DependencyFlags.HardDependency)]
public class YourMod : BaseUnityPlugin
{
// ...
private void Awake()
{
// ...
AssetBundle assetBundle = AssetBundle.LoadFromFile("your_assetbundle_file_path");
GameObject prefab = assetBundle.LoadAsset<GameObject>("your_valuable_prefab");
// Valuables Presets:
// "Valuables - Generic"
// "Valuables - Wizard"
// "Valuables - Manor"
// "Valuables - Arctic"
List<string> presets = new List<string> { "Valuables - Wizard" };
// Register a valuable.
REPOLib.Modules.Valuables.RegisterValuable(prefab, presets);
}
}
[!NOTE] Registering a valuable will automatically register it as a network prefab.
[!IMPORTANT] You should only register network prefabs and valuables from your plugins awake function.
[!TIP] You can enable extended logging in the config settings to get more info about valuables being registered, custom network prefabs being spawned, and more.
Contribute
Anyone is free to contribute.
https://github.com/ZehsTeam/REPOLib
Developer Contact
Report bugs, suggest features, or provide feedback:
- GitHub Issues Page: REPOLib
- Email: [email protected]
- Twitch: CritHaxXoG
- YouTube: Zehs
CHANGELOG
v1.1.0
- You can now register valuables to specific levels. (#1)
- Valuables Presets:
Valuables - Generic
,Valuables - Wizard
,Valuables - Manor
,Valuables - Arctic
- Valuables Presets:
v1.0.2
- Small improvement to
NetworkPrefabs.cs
,Valuables.cs
,CustomPrefabPool.cs
,LevelValuablesExtension.cs
, and other. - Added
public static IReadOnlyList<GameObject> RegisteredValuables { get; }
toValuables.cs
v1.0.1
- Updated mod icon.
v1.0.0
- Initial release.