Creating a Plugin

This will go over the first steps of creating a plugin from scratch.

In Boo

Starting the project

Starting is easy. In the game folder, open up a terminal. On windows, you can do this by holding down shift, and right clicking in the window, then clicking “Open command line here”. Then, run the following command to start in dev-mode (replace myplugin with the name of the your plugin, and WorldName with the name of your world):

 empeld.exe --dev --plugins essentials,myplugin --world WorldName

You can see a full list of arguments by running

 empeld.exe -h

In CSharp

Setting up a Project

  1. Start by opening up your IDE and creating a new C# library project
  2. Add a reference to pluginbase.dll, essentials.dll, and OpenTK.dll in the project. Make sure copy-local is False (or unchecked)
  3. Add the following attribute line to your AssemblyInfo.cs (Or equivalent file, or create the file if none exists)

[assembly: EmpeldPlugin]

Suggested Development

Setting up Running

It is recommended that you do a few additional steps while setting up your project to make it easier to work on.

  1. Make the output path of your dll to be the plugins folder in the empeld install directory
  2. Set the running application to be empeld.exe
    1. Set the startup params to either:
      1. –dev
      2. –plugins essentials,myplugin -a myusername:mypassword -bgserver -join localhost
        1. This will make sure your plugin is loaded, your logged in, and you're running in client-server mode
  3. Create a 'content' folder next to your mode
    1. Make sure to copy (or link) this content folder to your plugins folder, with the same name as your mod

You can see Arguments for a full list of supported arguments.

Distributing

When it comes time to share your plugin, you need to give out two pieces:

  1. The compiled dll, eg myplugin.dll
  2. The zipped resources of your content folder with the same name myplugin.zip

See Next