Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Tutorial:Plugin creation: Difference between revisions

From Resonite Wiki
Basic Types -> add ExternalDataModelType
m update links
 
(6 intermediate revisions by 4 users not shown)
Line 13: Line 13:
#* <translate>During installation, ensure to select .NET desktop development which will give you the .NET Framework development tools, which are required to compile the plugin</translate>
#* <translate>During installation, ensure to select .NET desktop development which will give you the .NET Framework development tools, which are required to compile the plugin</translate>
# <translate>Create a new project using the <code>Class Library</code> template (please ensure it is the C# option). Guidelines follow:</translate>
# <translate>Create a new project using the <code>Class Library</code> template (please ensure it is the C# option). Guidelines follow:</translate>
## <translate>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_Create_Plugins/ProtoFlux_Binding|ProtoFlux Binding]] generator.</translate>
## <translate>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 [[Tutorial:Plugin creation/ProtoFlux_Binding|ProtoFlux Binding]] generator.</translate>
## <translate>Select the default framework, we'll be manually editing this later.</translate>
## <translate>Select the default framework, we'll be manually editing this later.</translate>
# <translate>Add references to the following libraries by right clicking on <code>Dependencies</code>, clicking <code>Add Project Reference</code> and then <code>Browse</code>.</translate>
# <translate>Add references to the following libraries by right clicking on <code>Dependencies</code>, clicking <code>Add Project Reference</code> and then <code>Browse</code>.</translate>
## FrooxEngine.dll - <translate>Found in</translate> Resonite/Resonite_Data/Managed/FrooxEngine.dll
## FrooxEngine.dll - <translate>Found in</translate> Resonite/FrooxEngine.dll
## Elements.Core.dll - <translate>Found in</translate> Resonite/Resonite_Data/Managed/Elements.Core.dll
## Elements.Core.dll - <translate>Found in</translate> Resonite/Elements.Core.dll
# <translate>Change the referenced framework to</translate> <code>net462</code>. <translate>To do this:</translate>
# <translate>Change the referenced framework to</translate> <code>net9.0</code>. <translate>To do this:</translate>
## <translate>Double click on your project name, this will be under your solution</translate>
## <translate>Double click on your project name, this will be under your solution</translate>
## <translate>Change the line</translate> <code><TargetFramework><translate>whatever_you_selected_earlier</translate></TargetFramework></code> <translate>to</translate> <code><nowiki><TargetFramework>net462</TargetFramework></nowiki></code> <translate>and save the file</translate>
## <translate>Change the line</translate> <code><TargetFramework><translate>whatever_you_selected_earlier</translate></TargetFramework></code> <translate>to</translate> <code><TargetFramework>net9.0</TargetFramework></code> <translate>and save the file</translate>
# <translate>Change Your Assembly Info file to tell [[FrooxEngine]] what type of plugin you are making.</translate>
# <translate>Change Your Assembly Info file to tell [[FrooxEngine]] what type of plugin you are making.</translate>
## <translate>Create a folder inside your project called</translate> <code>Properties</code>
## <translate>Create a folder inside your project called</translate> <code>Properties</code>
## <translate>Create a file called</translate> <code>AssemblyInfo.cs</code> <translate>which contains the line</translate> <code><nowiki>[assembly: DataModelAssembly(t)]</nowiki></code><translate>, where</translate> <code>t</code> <translate>is a [[How_To_Create_Plugins/DataModelAssemblyType|DataModelAssemblyType]].</translate>
## <translate>Create a file called</translate> <code>AssemblyInfo.cs</code> <translate>which contains the line</translate> <code><nowiki>[assembly: DataModelAssembly(t)]</nowiki></code><translate>, where</translate> <code>t</code> <translate>is a [[Tutorial:Plugin creation/DataModelAssemblyType|DataModelAssemblyType]].</translate>


{{Note|<translate>The framework</translate> <code>net462</code> <translate>(step 4) is going to be changed in the future, this will most likely happen with the switch from Unity to [[Sauce]]</translate>|warning}}
<translate>'''You're now ready to start writing plugins!'''</translate>
 
== Templates ==
=== ProtoFlux-Ready ===
* https://github.com/Custom-Extension-Works/PluginTemplate


<translate>'''You're now ready to start writing plugins!'''</translate>
== Guides ==
== Guides ==
=== Components ===
=== Components ===
* [[How_To_Create_Plugins/Creating_Components|<translate>Creating custom Components</translate>]]
* [[Tutorial:Plugin creation/Creating_Components|<translate>Creating custom Components</translate>]]


=== ProtoFlux ===
=== ProtoFlux ===
* <translate>An introduction to</translate> [[How_To_Create_Plugins/Creating_ProtoFlux_Nodes|<translate>creating custom ProtoFlux nodes</translate>]]
* <translate>An introduction to</translate> [[Tutorial:Plugin creation/Creating_ProtoFlux_Nodes|<translate>creating custom ProtoFlux nodes</translate>]]
* <translate>[[How_To_Create_Plugins/ProtoFlux_CC|Calls and Continuations]] in ProtoFlux</translate>
* <translate>[[Tutorial:Plugin creation/ProtoFlux_CC|Calls and Continuations]] in ProtoFlux</translate>
* <translate>[[How_To_Create_Plugins/ProtoFlux_Globals|Creating ProtoFlux Globals]]</translate>
* <translate>[[Tutorial:Plugin creation/ProtoFlux_Globals|Creating ProtoFlux Globals]]</translate>
* [[How_To_Create_Plugins/Creating_ProtoFlux_Bindings|<translate>Creating a ProtoFlux Binding</translate>]]
* [[Tutorial:Plugin creation/Creating_ProtoFlux_Bindings|<translate>Creating a ProtoFlux Binding</translate>]]


=== Misc ===
=== Misc ===
* <translate>[[How_To_Create_Plugins/Creating_Settings|Creating settings]]</translate>
* <translate>[[Tutorial:Plugin creation/Creating_Settings|Creating settings]]</translate>


== <translate>Object Reference</translate> ==
== <translate>Object Reference</translate> ==
Line 49: Line 52:
! <translate>Description</translate>
! <translate>Description</translate>
|-
|-
| [[How_To_Create_Plugins/Custom_Components|Components]]
| [[Tutorial:Plugin creation/Custom_Components|Components]]
| <translate>A custom component</translate>
| <translate>A custom component</translate>
|-
|-
| [[How_To_Create_Plugins/DataModelAssemblyType|DataModelAssemblyType]]
| [[Tutorial:Plugin creation/DataModelAssemblyType|DataModelAssemblyType]]
| <translate>The type of assembly you are making. Used in your</translate> <code>AssemblyInfo.cs</code> <translate>file.</translate>
| <translate>The type of assembly you are making. Used in your</translate> <code>AssemblyInfo.cs</code> <translate>file.</translate>
|-
|-
| [[How_To_Create_Plugins/ExternalDataModelType|ExternalDataModelType]]
| [[Tutorial:Plugin creation/ExternalDataModelType|ExternalDataModelType]]
|  
|  
|-
|-
| [[How_To_Create_Plugins/ProtoFlux_Binding|ProtoFlux Binding]]
| [[Tutorial:Plugin creation/ProtoFlux_Binding|ProtoFlux Binding]]
| <translate>The binding for a ProtoFlux Node. Without this, a node cannot be loaded into Resonite.</translate>
| <translate>The binding for a ProtoFlux Node. Without this, a node cannot be loaded into Resonite.</translate>
|-
|-
Line 70: Line 73:
! <translate>Description</translate>
! <translate>Description</translate>
|-
|-
| [[How_To_Create_Plugins/ActionBreakableFlowNode|ActionBreakableFlowNode]]
| [[Tutorial:Plugin creation/ActionBreakableFlowNode|ActionBreakableFlowNode]]
|  
|  
|-
|-
| [[How_To_Create_Plugins/ActionFlowNode|ActionFlowNode]]
| [[Tutorial:Plugin creation/ActionFlowNode|ActionFlowNode]]
|  
|  
|-
|-
| [[How_To_Create_Plugins/ActionNode|ActionNode]]
| [[Tutorial:Plugin creation/ActionNode|ActionNode]]
| <translate>A node which runs when called using an impulse</translate>
| <translate>A node which runs when called using an impulse</translate>
|-
|-
| AsyncActionBreakableFlowNode
| AsyncActionBreakableFlowNode
| <translate>Async variant of [[How_To_Create_Plugins/ActionBreakableFlowNode|ActionBreakableFlowNode]]</translate>
| <translate>Async variant of [[Tutorial:Plugin creation/ActionBreakableFlowNode|ActionBreakableFlowNode]]</translate>
|-
|-
| AsyncActionFlowNode
| AsyncActionFlowNode
| <translate>Async variant of [[How_To_Create_Plugins/ActionFlowNode|ActionFlowNode]]</translate>
| <translate>Async variant of [[Tutorial:Plugin creation/ActionFlowNode|ActionFlowNode]]</translate>
|-
|-
| AsyncActionNode
| AsyncActionNode
| <translate>Async variant of [[How_To_Create_Plugins/ActionNode|ActionNode]]</translate>
| <translate>Async variant of [[Tutorial:Plugin creation/ActionNode|ActionNode]]</translate>
|-
|-
| [[How_To_Create_Plugins/ObjectFunctionNode|ObjectFunctionNode]]
| [[Tutorial:Plugin creation/ObjectFunctionNode|ObjectFunctionNode]]
| <translate>A ProtoFlux Node which returns a singular object</translate>
| <translate>A ProtoFlux Node which returns a singular object</translate>
|-
|-
| [[How_To_Create_Plugins/ValueFunctionNode|ValueFunctionNode]]
| [[Tutorial:Plugin creation/ValueFunctionNode|ValueFunctionNode]]
| <translate>A ProtoFlux Node which returns a singular value</translate>
| <translate>A ProtoFlux Node which returns a singular value</translate>
|-
|-
| [[How_To_Create_Plugins/VoidNode|VoidNode]]
| [[Tutorial:Plugin creation/VoidNode|VoidNode]]
| <translate>A ProtoFlux Node which doesn't use</translate> <code>return</code> <translate>to give an output. Used for nodes with multiple outputs.</translate>
| <translate>A ProtoFlux Node which doesn't use</translate> <code>return</code> <translate>to give an output. Used for nodes with multiple outputs.</translate>
|-
|-

Latest revision as of 09:12, 26 January 2026

This page may be too technical for most readers to understand. Please help improve it to make it understandable to non-experts, without removing the technical details.

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.

  1. 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 the plugin
  2. Create a new project using the Class Library template (please ensure it is the C# option). Guidelines follow:
    1. 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.
    2. Select the default framework, we'll be manually editing this later.
  3. Add references to the following libraries by right clicking on Dependencies, clicking Add Project Reference and then Browse.
    1. FrooxEngine.dll - Found in Resonite/FrooxEngine.dll
    2. Elements.Core.dll - Found in Resonite/Elements.Core.dll
  4. Change the referenced framework to net9.0. To do this:
    1. Double click on your project name, this will be under your solution
    2. Change the line <TargetFramework>whatever_you_selected_earlier</TargetFramework> to <TargetFramework>net9.0</TargetFramework> and save the file
  5. Change Your Assembly Info file to tell FrooxEngine what type of plugin you are making.
    1. Create a folder inside your project called Properties
    2. Create a file called AssemblyInfo.cs which contains the line [assembly: DataModelAssembly(t)], where t is a DataModelAssemblyType.

You're now ready to start writing plugins!

Templates

ProtoFlux-Ready

Guides

Components

ProtoFlux

Misc

Object Reference

This section is in a state of significant expansion or restructuring. You are welcome to assist in its construction by editing it as well.
Reason: Doesn't list all types relevant for writing plugins.

Basic Types

Object Description
Components A custom component
DataModelAssemblyType The type of assembly you are making. Used in your AssemblyInfo.cs file.
ExternalDataModelType
ProtoFlux Binding The binding for a ProtoFlux Node. Without this, a node cannot be loaded into Resonite.

TODO

ProtoFlux Node Types

Object Description
ActionBreakableFlowNode
ActionFlowNode
ActionNode A node which runs when called using an impulse
AsyncActionBreakableFlowNode Async variant of ActionBreakableFlowNode
AsyncActionFlowNode Async variant of ActionFlowNode
AsyncActionNode Async variant of ActionNode
ObjectFunctionNode A ProtoFlux Node which returns a singular object
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.

TODO

Variable types relevant for Components

Type Description
Sync<T> A synced Value or Enum
SyncList<T>
SyncRef<T> A synced Reference (object)

TODO

Variable types relevant for ProtoFlux Nodes

Type Description

TODO

See also