Alexius25.ChipLibrary 1.4.0

dotnet add package Alexius25.ChipLibrary --version 1.4.0
                    
NuGet\Install-Package Alexius25.ChipLibrary -Version 1.4.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Alexius25.ChipLibrary" Version="1.4.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Alexius25.ChipLibrary" Version="1.4.0" />
                    
Directory.Packages.props
<PackageReference Include="Alexius25.ChipLibrary" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Alexius25.ChipLibrary --version 1.4.0
                    
#r "nuget: Alexius25.ChipLibrary, 1.4.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Alexius25.ChipLibrary@1.4.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Alexius25.ChipLibrary&version=1.4.0
                    
Install as a Cake Addin
#tool nuget:?package=Alexius25.ChipLibrary&version=1.4.0
                    
Install as a Cake Tool

Chip Creation Guide

Reference Library

Chip Library is available either as a dll or through nuget. You need to reference it in your project to create custom chips.

dotnet add package Alexius25.ChipLibrary

Step 1

Make a class that inherits from ChipBase.cs:

public class TestChipMono : ChipBase
{
    public override bool UsesUpdate => true; // Set to true if you want to use the EquippedUpdate method
    
    public override void OnEquip()
    {
        // Call the base method
        base.OnEquip();
        
        // Code to execute when the chip is equipped
    }

    public override void OnUnequip()
    {
        // Call the base method
        base.OnUnequip();
        
        // Code to execute when the chip is unequipped
    }
    
    public override void EquippedUpdate()
    {
        // Code to execute every frame while the chip is equipped
    }
}

Notes:

  • The ChipBase class itself inherits from MonoBehaviour, so you can use all Unity lifecycle methods (e.g., Start, Update) in your chip class.
  • Override the OnEquip and OnUnequip methods to define behavior when the chip is equipped or unequipped.

Step 2

Create your item prefab:

public static class TestChip
{
    public static void Register()
    {
        var prefab = new CustomPrefab("TestChip", "Test Chip",
            "A test chip for demonstration purposes.");
        prefab.SetEquipment(EquipmentType.Chip);
        prefab.SetGameObject(new CloneTemplate(prefab.Info, TechType.ComputerChip));
        prefab.Register();

        // Register the Class you created previously with the techtype of the item
        ChipHandler.RegisterChip<TestChipMono>(prefab.Info.TechType);
    }
}

Note:

  • You can put these two snippets in the same file if you prefer.

Step 3

Register your chip during the mod initialization:

using BepInEx;
using BepInEx.Logging;

namespace TestChip;

[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
[BepInDependency("com.alexius25.chiplibrary")]
public class Main : BaseUnityPlugin
{
    private new static ManualLogSource Logger { get; private set; }

    private void Awake()
    {
        // set project-scoped logger instance
        Logger = base.Logger;
        
        TestChip.Register();
        Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!");
    }
}

Note:

  • You need to add a dependency on ChipLibrary in your BepInEx plugin attributes. ([BepInDependency("com.alexius25.chiplibrary")]) and users have to install ChipLibrary for your mod to work.

Final Notes

  • An Example mod is available on GitHub for reference.
  • Available Debug Commands can help you test your chip in-game.
  • Events are also available for more advanced functionality; see the Events Documentation for details.
Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.4.0 120 1/17/2026
1.3.0 87 1/17/2026
1.2.0 101 1/17/2026