Skip to content
This repository has been archived by the owner on Sep 12, 2020. It is now read-only.

First Plugin

Robin Möller edited this page Aug 4, 2020 · 11 revisions

Installing Synapse in your project

To Start with Synapse they are 2 Ways:

The first recommended option is to use the SynapseSL Nuget packet. To install it (in Visual Studio) click Project -> Manage NuGet Packages -> Browse -> Type in the search: SynapseSL -> Install. Now you are finished and can use Synapse in your project.

The Second way of installing Synapse is to install a SCP:Secret Laboratory server and download the Synapse.zip and SynapseModLoader.zip and search for all dependencies you need yourself.

The First Line of Code

Now that Synapse is installed in your project we can start with developing a Plugin!

In order to do this you must add using Synapse.Api.Plugin at the top of your MainClass which inherit from Synapse.Api.Plugin.Plugin and contains the override void OnEnable() method. Now we are finished already with a Synapse Plugin which does nothing but works! But Synapse also wants to know the Plugin. Thats why we add the Attribute Synapse.Api.Plugin.PluginDetails to the Head of the MainClass.

Doing that should resolve in a Plugin that is looking like this:

using Synapse.Api.Plugin;

namespace Example
{
    [PluginDetails(
        Author = "Dimenzio",
        Description = "My Awesome First Plugin!",
        Name = "First-Plugin",
        SynapseMajor = 1,
        SynapseMinor = 0,
        SynapsePatch = 0,
        Version = "1.0.0"
        )]
    public class Example : Plugin
    {
        public override void OnEnable()
        {
            Log.Info("Hello World!");
        }
    }
}

The Method OnEnable will be called by Synapse when your plugin gets loaded.

Next-Step is to look into the Events to hook them and create your first plugin. :)

Clone this wiki locally