Skip to content

Plugin Development

Monitor edited this page Nov 3, 2024 · 1 revision

Warning

The publicly shipped API is not stable and prone to breaking changes with no prior notice.

Warning

The documentation for this page may be outdated because of frequent updates. Check the API source code to be kept up to date.

Note

This article assumes the reader has a basic understanding of C# and .NET projects in addition to having an environment set up for development.

Configurations

Configurations are wrappers for different methods of patching in Pandora Behavior Engine. The entire patching process for Skyrim Special Edition is done by one patcher, but there are two different configurations in the menu (Normal and Debug).

With the latest version (2.5.0-beta) of Pandora Behaviour Engine, it is now possible to develop plugins to add new configurations to the engine.

Setup

  1. Create a .NET class library, either by command line or using Visual Studio. This will be the plugin.
  2. Add Pandora API to the solution, either by the package or cloning and adding the project.
  3. In the .csproj for the plugin project, make sure the following is present as a property.
  <PropertyGroup>
        ...
	<DisableTransitiveProjectReferences>true</DisableTransitiveProjectReferences>
  </PropertyGroup>
  1. In the same project file, ensure that the following properties are added under the Pandora API reference:
<Private>False</Private>
<ExcludeAssets>runtime</ExcludeAssets>
  1. Example:
  <ItemGroup>
     ...
    <ProjectReference Include="..\Pandora API\Pandora API.csproj">
		<Private>False</Private>
		<ExcludeAssets>runtime</ExcludeAssets>
    </ProjectReference>
  </ItemGroup>
  1. Create a plugin.json file and add it to the project. Under Properties > Build Action ensure it is set to either Copy always or Copy if newer.

  2. Create the following properties and the values in the plugin.json file.

{
  "name": "Example Plugin",
  "author": "Monitor221hz",
  "version": "1.2.3",
  "path": "Example Plugin.dll"
}

Note

path is the path to the plugin relative to the build folder (usually just the name of the plugin file).

Quickstart

  1. In the default .cs file, create a class inheriting from IEngineConfigurationPlugin.
  2. Implement the MenuPath. This is the nested that the configuration will have when it is injected into the configuration selection menu.
  3. Implement the rest of the necessary properties, including the factory, configuration, and patcher.

Testing

  1. In your local Pandora Behaviour Engine repository, create a Plugins folder in the Pandora Behaviour Engine project.
  2. Create a new folder (recommended to be named same as the plugin).
  3. Create a plugin.json file inside the new folder (this will get ignored by git)
  4. Put in the absolute or relative path to the plugin .dll file.
  5. Run Pandora via Visual Studio or your preferred IDE. The plugin should then be injected and selectable in the configuration menu.

Usage

Copy the contents of the plugin build into a new folder in the Plugins folder of Pandora, then run Pandora normally.

Clone this wiki locally