Roadside Research
Install

Details

Last Updated
First Uploaded
Downloads
884
Likes
0
Size
136KB
Dependency string
Deja-UpgradeLib-1.0.2
Dependants

Categories

UpgradeLib

A library mod for Roadside Research that lets other mods add purchasable upgrade trees to the game's skill webs. Upgrades appear as clickable nodes alongside vanilla skills, cost either money or research points, and persist across sessions automatically.

For Players

Install this mod if another mod requires it. UpgradeLib does nothing on its own — it provides the framework that other mods use to add upgrade trees.

Save data is stored per save slot in BepInEx/config/UpgradeLib/.

For Mod Developers

Quick Start

  1. Add a reference to UpgradeLib.dll in your .csproj
  2. Add [BepInDependency("com.upgradelib.roadsideresearch")] to your plugin class
  3. Register upgrade trees in your Load() method

Minimal Example

using BepInEx;
using BepInEx.Unity.IL2CPP;
using UpgradeLib;

[BepInPlugin("com.example.roadsideresearch", "ExampleUpgrade", "1.0.0")]
[BepInDependency("com.upgradelib.roadsideresearch")]
public class Plugin : BasePlugin
{
    public override void Load()
    {
        var tier2 = new UpgradeDefinition
        {
            Id = "speed_2",
            Name = "Speed II",
            Description = "Max speed bonus: 20%.",
            CostType = CostType.Money,
            Cost = 1000f
        };

        var root = new UpgradeDefinition
        {
            Id = "speed_1",
            Name = "Speed I",
            Description = "Max speed bonus: 10%.",
            CostType = CostType.Money,
            Cost = 500f,
            Title = "Speed Upgrades",
            Children = { tier2 }
        };

        UpgradeAPI.RegisterTree(root);
    }
}

API

Method Description
UpgradeAPI.RegisterTree(root) Register a new upgrade tree
UpgradeAPI.RegisterInTree(title, node) Add a node to an existing tree
UpgradeAPI.IsPurchased(id) Check if an upgrade is owned
UpgradeAPI.CanPurchase(id) Check if an upgrade is available to buy
UpgradeAPI.GetAllNodes() Get all registered nodes

Features

  • Tree-based upgrades — root nodes with chained children forming prerequisite chains
  • Two cost types — Money (economy webs) and Research (alien webs)
  • Automatic persistence — purchase state saves/loads per save slot
  • Property inheritance — children inherit icons, colors, and cost type from parents
  • Vanilla icon matching — borrow icons from vanilla skills by name
  • OnPurchased callbacks — fire on purchase and on game load for re-applying effects
  • Cross-mod support — mods can add nodes to trees registered by other mods
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.