m fix category page. oh boy the first fixup |
Getting started - fixup and add more information i forgot |
||
Line 11: | Line 11: | ||
# Download [https://visualstudio.microsoft.com/vs/community/ Visual Studio Community edition], which allows for easier programming and compilation of plugins. ''However, you can use your favourite code editor as long as you know how to compile C# into a <code>.dll</code>'' | # Download [https://visualstudio.microsoft.com/vs/community/ Visual Studio Community edition], which allows for easier programming and compilation of plugins. ''However, you can use your favourite code editor as long as you know how to compile C# into a <code>.dll</code>'' | ||
#* During installation, ensure to select .NET desktop development which will give you the .NET Framework development tools, which are required to compile a plugin | #* During installation, ensure to select .NET desktop development which will give you the .NET Framework development tools, which are required to compile a plugin | ||
# Create a new project using the <code>Class Library</code> template (please ensure it is the C# option). Guidelines follow: | # Create a new project using the <code>Class Library</code> template (please ensure it is the C# option). Guidelines follow: | ||
## The project name ''should'' be the name of your plugin, same with the ''solution name''. It is recommended to not check the box for ''Place solution and project in the same directory'', as you may have multiple parts to your plugin, such as a [[How_To_Write_Plugins/ProtoFlux_Binding|ProtoFlux Binding]] generator. | ## The project name ''should'' be the name of your plugin, same with the ''solution name''. It is recommended to not check the box for ''Place solution and project in the same directory'', as you may have multiple parts to your plugin, such as a [[How_To_Write_Plugins/ProtoFlux_Binding|ProtoFlux Binding]] generator. | ||
## Select the default framework, we'll be manually editing this later. | ## Select the default framework, we'll be manually editing this later. | ||
# Add references to the following libraries by right clicking on <code>Dependencies</code>, clicking <code>Add Project Reference</code> and then <code>Browse</code>. | # Add references to the following libraries by right clicking on <code>Dependencies</code>, clicking <code>Add Project Reference</code> and then <code>Browse</code>. | ||
## FrooxEngine.dll - Found in Resonite/Resonite_Data/Managed/FrooxEngine.dll | ## FrooxEngine.dll - Found in Resonite/Resonite_Data/Managed/FrooxEngine.dll | ||
## Elements.Core.dll - Found in Resonite/Resonite_Data/Managed/Elements.Core.dll | ## Elements.Core.dll - Found in Resonite/Resonite_Data/Managed/Elements.Core.dll | ||
# Change the referenced framework to <code>net48</code>. To do this: | # Change the referenced framework to <code>net48</code>. To do this: | ||
## Double click on your namespace, this will be under your solution | ## Double click on your namespace, this will be under your solution | ||
## Change the line <code><nowiki><TargetFramework>whatever_you_selected_earlier</TargetFramework></nowiki></code> to <code><nowiki><TargetFramework>net462</TargetFramework></nowiki></code> and saving the file | ## Change the line <code><nowiki><TargetFramework>whatever_you_selected_earlier</TargetFramework></nowiki></code> to <code><nowiki><TargetFramework>net462</TargetFramework></nowiki></code> and saving the file | ||
{{Note|The framework <code>net462</code> is going to be changed in the future, this will most likely happen with the switch from Unity to [[Sauce]]|warning}} | # Change Your Assembly Info file to tell [[FrooxEngine]] what type of plugin you are making. | ||
## You will need to add the following line into your Project properties file:<br><code><GenerateAssemblyInfo>false</GenerateAssemblyInfo></code><br>inside of a <code>PropertyGroup</code> | |||
## Create a folder inside your project called <code>Properties</code> | |||
## Create a file called <code>AssemblyInfo.cs</code> which contains the line <code><nowiki>[assembly: DataModelAssembly(t)]</nowiki></code>, where <code>t</code> is a <code>DataModelAssemblyType</code>. | |||
{{Note|The framework <code>net462</code> (step 4) is going to be changed in the future, this will most likely happen with the switch from Unity to [[Sauce]]|warning}} | |||
You're now ready to start writing plugins! | You're now ready to start writing plugins! |
Revision as of 14:05, 15 July 2024
Plugins are used to add more Components and ProtoFlux nodes to Resonite by programming them using C#. They are not to be confused with Mods which do not add things into the Data Model.
- This page is about writing plugins and should not be confused with the Plugin overview page.
Please see the plugin guidelines before getting started, to familiarize yourself on what is and is not allowed.
Getting started
You will need to know the basics of the C# Programming Language to write plugins.
- Download Visual Studio Community edition, which allows for easier programming and compilation of plugins. However, you can use your favourite code editor as long as you know how to compile C# into a
.dll
- During installation, ensure to select .NET desktop development which will give you the .NET Framework development tools, which are required to compile a plugin
- Create a new project using the
Class Library
template (please ensure it is the C# option). Guidelines follow:- The project name should be the name of your plugin, same with the solution name. It is recommended to not check the box for Place solution and project in the same directory, as you may have multiple parts to your plugin, such as a ProtoFlux Binding generator.
- Select the default framework, we'll be manually editing this later.
- Add references to the following libraries by right clicking on
Dependencies
, clickingAdd Project Reference
and thenBrowse
.- FrooxEngine.dll - Found in Resonite/Resonite_Data/Managed/FrooxEngine.dll
- Elements.Core.dll - Found in Resonite/Resonite_Data/Managed/Elements.Core.dll
- Change the referenced framework to
net48
. To do this:- Double click on your namespace, this will be under your solution
- Change the line
<TargetFramework>whatever_you_selected_earlier</TargetFramework>
to<TargetFramework>net462</TargetFramework>
and saving the file
- Change Your Assembly Info file to tell FrooxEngine what type of plugin you are making.
- You will need to add the following line into your Project properties file:
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
inside of aPropertyGroup
- Create a folder inside your project called
Properties
- Create a file called
AssemblyInfo.cs
which contains the line[assembly: DataModelAssembly(t)]
, wheret
is aDataModelAssemblyType
.
- You will need to add the following line into your Project properties file:
You're now ready to start writing plugins! Please see the following pages for in depth guides on how to code individual parts of plugins:
- Creating custom Components
- An introduction to creating custom ProtoFlux nodes
- Creating a ProtoFlux Binding
Please note: you are not limited to these guides, you may use any C# syntax.
Object Reference
Object | Description |
---|---|
Components | Used to create custom components |
ObjectFunctionNode | A ProtoFlux Node which returns a singular object |
ProtoFlux Binding | The binding for a ProtoFlux Node. Without this, a node cannot be loaded into Resonite. |
ValueFunctionNode | A ProtoFlux Node which returns a singular value |
VoidNode | A ProtoFlux Node which doesn't use return to give an output. Used for nodes with multiple outputs.
|