Skip to content
NP Editor Docs
This is not the latest version — view the latest

Distribution and versioning

You share a plugin as a single folder. The recipient puts that folder in the plugin folder and enables it in the Plugin Manager. This page covers the files to put in the folder, how to choose the version number and the sdk range, the compatibility promise the SDK keeps, and security.

  1. Increment version in plugin.json (see “Your version number” below).
  2. Build with dotnet build -c Release.
  3. From the build output folder, pick only the files in the “Files to include” table below, put them in a new folder (for example road_tools) and zip it.
  4. Give recipients the following steps.
    1. Unzip and put the road_tools folder in the plugin folder (Tools > Open plugin folder).
    2. Click Tools > Plugin Manager…. The new plugin appears as “Approval needed”.
    3. If you trust it, check Enable on that row. The first time, click Trusted — load in the External plugins confirmation window.
  • Before you publish, check it yourself the way a new user would: unzip into an empty plugin folder, then Rescan → check Enable and confirm that it enables.
  • If you use NuGet packages, EnableDynamicLoading copies the dependency dlls into the build output. Include those dlls and <name>.deps.json.
  • Keep the target at net8.0. The .NET runtime inside the editor is 8, so it cannot load a dll built for a newer target.
  • Put large data of your own (presets · tables) in a subfolder such as data\ and locate it with host.PluginDir. The paths stay correct even if the whole plugin folder moves.
  • Keep user settings in host.Settings. Even if someone installs over the plugin folder, the settings stay in %APPDATA%\NPEditor\plugin_settings\.
FileInclude?Description
plugin.jsonYesDirectly in the folder
Your dllYesThe dll path in plugin.json
Other dlls you use (NuGet packages and so on)YesNext to your dll. Also include the .deps.json from the build output.
.pdbOptionalLine numbers appear in the exception stacks you log yourself (host.Log(e.ToString())).
NP.Editor.Sdk.dllNoThe editor’s copy is used. Exclude it in the csproj with Private=false.
Large dataOptionalKeep it in the folder and locate it with host.PluginDir.
road_tools\
├─ plugin.json
├─ RoadTools.dll
├─ RoadTools.deps.json
├─ RoadTools.pdb
└─ data\
└─ presets.json

The editor also reads plugins placed in the plugins\ folder under the editor install folder. If the user plugin folder has the same id, that one comes first.

Increment version in plugin.json following semver (major.minor.patch). It appears in the Version column of the Plugin Manager.

What changedPart to incrementExample
Bug fixes onlypatch1.2.0 → 1.2.1
Added features (save format and commands unchanged)minor1.2.1 → 1.3.0
Changed command names · world logic types · settings keys · save formatmajor1.3.0 → 2.0.0
  • World logic Type and field Name values are saved in the map’s scene.json. If you change them, rules in old maps become “Unknown type”.
  • Do not change the id. Settings files, shortcuts the user changed and approval records are saved by id.

Set sdk to the minimum version of the features you actually use.

What you usesdkEditors it runs on
SDK 1.0 features only^1.0All of SDK 1.0 – 1.x
Settings · Draw · AddShortcut^1.1SDK 1.1 – 1.x
AddSceneEvent^1.2SDK 1.2 – 1.x (editor 0.9.0 or later)
Scene · View · ActorList^1.3SDK 1.3 – 1.x (editor 0.9.1 or later)
Account^1.4SDK 1.4 – 1.x (editor 0.9.12 or later)
AddShowFlag · AddStatusItem · AddWorldReplaceGuard^1.5SDK 1.5 – 1.x (editor 0.9.18 or later, including 0.10.2)
  • If you set it too high, users of older editors cannot use the plugin.
  • If you set it too low, loading on an older editor fails because of missing members (“Version mismatch”).
  • Do not use ranges without an upper bound (>=1.0). The plugin could load in a broken state on the next major.
PromiseDetails
Within the same majorTypes and members are only added. They are never renamed or removed.
New fieldsAdded as trailing fields with default values. Old code compiles unchanged.
Breaking changesThe major is incremented (2.0). ^1.x plugins stop safely with “Version mismatch” and the editor keeps running.
BehaviorThe meaning of registration points does not change within the same major.

Per-version changes are in the SDK changelog.

A plugin is code that runs on this computer with the same permissions as the editor, without signature checks.

PreventedNot prevented
An exception in plugin code → only that plugin is disabled (isolation)Infinite loops · stack overflows · process exit
Cleanup of registrations, drawings and the camera for a disabled pluginReading · writing · deleting files
A new plugin folder that has not been allowed is not loadedNetwork access
  • A new plugin folder loads only after the user checks Enable in the Plugin Manager. Even if another program drops a dll into the plugin folder, it does not run by itself.
  • Plugin code loads only after sign-in and the license check are done.
  • The tools called by the AI inside the editor (AI Studio) cannot write to the plugin folders, the install folder or %APPDATA%\NPEditor, and cannot create executable files (.dll · .exe and so on). There is no AI tool that enables plugins.
  • Install only plugins you built yourself or got from a source you trust. When you share a plugin, also share the source or where it came from.
  • Do not put secret keys or tokens in a plugin. A dll is easy to decompile.
  • Do not use reflection by name on editor internals (non-public types · members). In the installed build, non-public names are changed (obfuscated), so such code breaks only in the installed build. Request missing features as SDK registration points.
  • Incremented version in plugin.json.
  • sdk is the minimum version of the features used.
  • The folder does not contain NP.Editor.Sdk.dll.
  • It enables with Rescan → checking Enable when placed in an empty plugin folder.
  • Menus and panels are not duplicated or left behind after enable → disable → enable.

The detailed list is under “Pre-release checklist” in Troubleshooting.