ProtoFlux: Difference between revisions

From Resonite Wiki
setting up the page for anyone who wants to continue after me
Added a discussions section along with a link to a dedicated github discussions page.
 
(30 intermediate revisions by 11 users not shown)
Line 1: Line 1:
== Overview ==
<languages/>
ProtoFlux, a Node based scripting language designed for Resonite.


With ProtoFlux you can create anything* that you want.


a flying car? a goose called goose micgooseman? anything* is possible!
[[File:Protoflux Logo Color 1080.png|alt=Protoflux|thumb|<translate><!--T:2--> The official ProtoFlux logo</translate>]]


Now, with everything comes a price and that price is spending some time to learn it.
<translate><!--T:3--> ProtoFlux is a Node based scripting language that can be manipulated in 3D space using the [[ProtoFlux Tool]].</translate>


but with this ProtoFlux tutorial, anyone can learn the basics!
{{Quotation|<translate><!--T:4--> ProtoFlux is the crown jewel of our creative tools - the most powerful visual programming language that our experienced team has designed to date, which lets you quickly prototype and build anything from simple interactions to complex games and systems - with full real-time collaboration support and immediate feedback. Build anything from avatar and world interactivity, to complex systems, and games.</translate>|https://resonite.com/features.html}}


in your "resonite-essentials/tools" is a protoflux tool seccond one from the left.
== <translate><!--T:5--> Usage</translate> ==


this protoflux tool allows you to spawn out nodes, wires, connect them together ect.
<translate><!--T:6--> ProtoFlux is represented in the world as nodes that can be selected from the [[ProtoFlux Node Browser]], and spawned from the [[ProtoFlux Tool]]. </translate>


equipping this gives you some new radial menu options for your radial context menu.
<translate><!--T:7--> You can easily spawn a [[ProtoFlux Tool]] from the ''Resonite Essentials'' folder included in your [[Inventory]] to begin scripting with ProtoFlux (The tool itself is found in the Tools folder in the Essentials Folder).</translate>


using these can help you greatly in the world of protoflux.
<translate><!--T:8--> To view a list of nodes, go to [[:Category:ProtoFlux|ProtoFlux Browser Version]] for a style like in game, or go to [[:Category:ProtoFlux:All|Alphabetical list of all nodes]] to see a comprehensive list. Every node page links back to both lists.</translate>
 
<translate><!--T:9--> To begin using Protoflux first spawn then equip the [[ProtoFlux Tool]] from the folder mentioned above. Once equipped, the Protoflux node browser can be found in your [[Context menu]]. To select a node, double click the node with the Protoflux Tool. This will make the name of the node appear above the tool to show it has been selected. Then double click, to spawn the selected node.</translate>
 
<translate><!--T:18--> You can also quick select nodes that already exist by tapping Secondary while pointing at the node.</translate>
 
<translate><!--T:19--> Nodes can be connected by pointing the laser at a node's connection point and holding Primary (Trigger for most controllers, or Left Click), then dragging the wire and letting go of Primary while pointing at another node's connection point. They can then be cut by intersecting the red line that comes out the tip of the [[ProtoFlux Tool]] while holding Primary.</translate>
 
=== <translate><!--T:20--> Interfacing With Components / Slots</translate> ===
 
<translate><!--T:21--> To change or read the properties of a slot's or component's properties, grab with your controller (or right click) while pointing at a given field name with the [[ProtoFlux Tool]] (For example, point at and grab the spot where it says 'Position' on a slot). While grabbing the field with the [[ProtoFlux Tool]], open your [[Context menu]]. This will give you three options.</translate>
 
<translate><!--T:22--> [[Source]]: This will spawn a node that references the source of the property you were holding. This is used to both read the value of the field or to write to it using Protoflux.</translate>
 
<translate><!--T:23--> [[Drive]]: This will spawn a node to allow you to continuously locally write a value to the variable you were holding.</translate>
 
<translate><!--T:24--> [[Reference]]: This will spawn a node to allow you to get the reference to the field of the given value. This is useful for nodes like [[ProtoFlux:Tween Value]] that require a reference to the value it is changing.</translate>
 
 
=== <translate><!--T:10--> Packing / Unpacking Protoflux</translate> ===
 
<translate><!--T:25--> To pack Protoflux, hold Secondary while pointing at a group of Protoflux using the [[ProtoFlux Tool]]. The Protoflux should become light blue, this indicates it has been selected (This also makes the Protoflux that is selected act as one object, allowing you to easily move groups of Protoflux around).</translate>
 
<translate><!--T:26--> Once the Protoflux has been selected, make an empty [[Slot]] using the [[Inspector]]. This will be the slot the Protoflux is packed into. To then pack the Protoflux, grab the slot using the left side of the [[Inspector]] so that it's name is above the [[ProtoFlux Tool]]. While you are grabbing it, open your [[Context menu]] and select Pack Into. Once packed, the Protoflux will still function like normal, but will no longer show its visuals and will apply some optimizations.</translate>
 
<translate><!--T:27--> To then unpack it, grab the same slot you packed it into and open your context menu, while a [[ProtoFlux Tool]] is equipped. There should now be an option to unpack the Protoflux.</translate>
 
 
=== <translate> <!--T:28--> Variables</translate> ===
 
<translate><!--T:11--> In ProtoFlux, there are 3 types of generic variables:</translate>
* [[ProtoFlux:Data Model Store|<translate><!--T:12--> Data Model Store</translate>]]
* [[ProtoFlux:Store|<translate><!--T:13--> Store</translate>]]
* [[ProtoFlux:Local|<translate><!--T:14--> Local</translate>]]
 
<translate><!--T:15--> The simplest type of variable is a Data Model Store. It's automatically synced to all users upon being written to. Most simple scripts can be done entirely with these, but it can impact performance if overused.</translate>
 
<translate><!--T:16--> The natural progression down the list is a Store. It's similar to standard variables in most languages. It does not get synced over the network, which alleviates the overhead of doing so, but could lead to desync.</translate>
 
<translate><!--T:17--> Lastly, we have locals. They're instanced for different execution chains, so if your ProtoFlux is called twice at once, you can read from and write to the variable from both contexts, they will each use a unique instance of the variable that gets discarded when that execution ends.</translate>
 
=== <translate><!--T:29--> Impulses</translate> ===
<translate><!--T:30--> See [[Impulses]]</translate>
 
== Discussions ==
 
* [https://github.com/Yellow-Dog-Man/Resonite-Issues/discussions/1392 ProtoFlux (Documentation Request)]
 
[[Category:Features]]

Latest revision as of 21:14, 19 July 2024


Protoflux
The official ProtoFlux logo

ProtoFlux is a Node based scripting language that can be manipulated in 3D space using the ProtoFlux Tool.

ProtoFlux is the crown jewel of our creative tools - the most powerful visual programming language that our experienced team has designed to date, which lets you quickly prototype and build anything from simple interactions to complex games and systems - with full real-time collaboration support and immediate feedback. Build anything from avatar and world interactivity, to complex systems, and games.

https://resonite.com/features.html

Usage

ProtoFlux is represented in the world as nodes that can be selected from the ProtoFlux Node Browser, and spawned from the ProtoFlux Tool.

You can easily spawn a ProtoFlux Tool from the Resonite Essentials folder included in your Inventory to begin scripting with ProtoFlux (The tool itself is found in the Tools folder in the Essentials Folder).

To view a list of nodes, go to ProtoFlux Browser Version for a style like in game, or go to Alphabetical list of all nodes to see a comprehensive list. Every node page links back to both lists.

To begin using Protoflux first spawn then equip the ProtoFlux Tool from the folder mentioned above. Once equipped, the Protoflux node browser can be found in your Context menu. To select a node, double click the node with the Protoflux Tool. This will make the name of the node appear above the tool to show it has been selected. Then double click, to spawn the selected node.

You can also quick select nodes that already exist by tapping Secondary while pointing at the node.

Nodes can be connected by pointing the laser at a node's connection point and holding Primary (Trigger for most controllers, or Left Click), then dragging the wire and letting go of Primary while pointing at another node's connection point. They can then be cut by intersecting the red line that comes out the tip of the ProtoFlux Tool while holding Primary.

Interfacing With Components / Slots

To change or read the properties of a slot's or component's properties, grab with your controller (or right click) while pointing at a given field name with the ProtoFlux Tool (For example, point at and grab the spot where it says 'Position' on a slot). While grabbing the field with the ProtoFlux Tool, open your Context menu. This will give you three options.

Source: This will spawn a node that references the source of the property you were holding. This is used to both read the value of the field or to write to it using Protoflux.

Drive: This will spawn a node to allow you to continuously locally write a value to the variable you were holding.

Reference: This will spawn a node to allow you to get the reference to the field of the given value. This is useful for nodes like ProtoFlux:Tween Value that require a reference to the value it is changing.


Packing / Unpacking Protoflux

To pack Protoflux, hold Secondary while pointing at a group of Protoflux using the ProtoFlux Tool. The Protoflux should become light blue, this indicates it has been selected (This also makes the Protoflux that is selected act as one object, allowing you to easily move groups of Protoflux around).

Once the Protoflux has been selected, make an empty Slot using the Inspector. This will be the slot the Protoflux is packed into. To then pack the Protoflux, grab the slot using the left side of the Inspector so that it's name is above the ProtoFlux Tool. While you are grabbing it, open your Context menu and select Pack Into. Once packed, the Protoflux will still function like normal, but will no longer show its visuals and will apply some optimizations.

To then unpack it, grab the same slot you packed it into and open your context menu, while a ProtoFlux Tool is equipped. There should now be an option to unpack the Protoflux.


Variables

In ProtoFlux, there are 3 types of generic variables:

The simplest type of variable is a Data Model Store. It's automatically synced to all users upon being written to. Most simple scripts can be done entirely with these, but it can impact performance if overused.

The natural progression down the list is a Store. It's similar to standard variables in most languages. It does not get synced over the network, which alleviates the overhead of doing so, but could lead to desync.

Lastly, we have locals. They're instanced for different execution chains, so if your ProtoFlux is called twice at once, you can read from and write to the variable from both contexts, they will each use a unique instance of the variable that gets discarded when that execution ends.

Impulses

See Impulses

Discussions