Added example steps for the Dynamic Variable Input. |
This page is no longer a stub (but feel free to edit and add more dynamic sections for tutorials on dynamic variables). |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
As the '''[[Dynamic Variables]]''' page itself is quite information dense, this tutorial will serve as a quick guide to create, write and read these variables and components, and is also designed to get you started immediately with them, in a step by step process. This should also be simpler to understand in comparison to the main page. | As the '''[[Dynamic Variables]]''' page itself is quite information dense, this tutorial will serve as a quick guide to create, write and read these variables and components, and is also designed to get you started immediately with them, in a step by step process. This should also be simpler to understand in comparison to the main page. | ||
Line 34: | Line 32: | ||
* The [[ProtoFlux:Dynamic Variable Input|Dynamic Variable Input]] node. (Must be under a slot with a [[Component:DynamicVariableSpace|DynamicVariableSpace]]) | * The [[ProtoFlux:Dynamic Variable Input|Dynamic Variable Input]] node. (Must be under a slot with a [[Component:DynamicVariableSpace|DynamicVariableSpace]]) | ||
* A [[Slot]] that contains a [[Component:DynamicVariableSpace|DynamicVariableSpace]]. | * A [[Slot]] that contains a [[Component:DynamicVariableSpace|DynamicVariableSpace]]. | ||
* A [[Component:DynamicValueVariable|DynamicValueVariable]] or [[Component:DynamicReferenceVariable|DynamicReferenceVariable]] component. | |||
=== Setup === | === Setup === | ||
Line 49: | Line 48: | ||
---- | ---- | ||
== Dynamic | == Dynamic Read And Write Variables & Dynamic Spaces == | ||
Use this when you have component values you want to dynamically | Use this when you have component values you want to dynamically read and write from anywhere. | ||
=== What You Need === | === What You Need === | ||
* Either a [[ | * Either a [[ProtoFlux:Read Dynamic Variable|Read Dynamic Variable]] or a [[ProtoFlux:Write Dynamic Variable|Write Dynamic Variable]] node. (The slot to check needs to be under a slot with a [[Component:DynamicVariableSpace|DynamicVariableSpace]]) | ||
* A [[Slot]] that contains a [[Component:DynamicVariableSpace|DynamicVariableSpace]]. | * A [[Slot]] that contains a [[Component:DynamicVariableSpace|DynamicVariableSpace]]. | ||
* A [[Component:DynamicValueVariable|DynamicValueVariable]] or [[Component:DynamicReferenceVariable|DynamicReferenceVariable]] component. | |||
=== Setup === | === Setup === | ||
[[File:Dynamic Variable Read And Write Example.png|alt=An example of using the Dynamic Variable Read and Write nodes.|thumb|An example of using the Dynamic Variable [[ProtoFlux:Read Dynamic Variable|Read]] and [[ProtoFlux:Write Dynamic Variable|Write]] nodes.]] | |||
# Spawn any [[Slot]] to use as your space (the example uses a box), then set up the [[Component:DynamicVariableSpace|DynamicVariableSpace]] component on your slot. | |||
## Pick a name for this space. (The example uses <code>Example</code>) | |||
# Spawn the [[ProtoFlux:Read Dynamic Variable|Read Dynamic Variable]] or [[ProtoFlux:Write Dynamic Variable|Write Dynamic Variable]] node. | |||
## Setup the path for this node. (The example uses <code>Example/MyBox</code>) | |||
## Attach a slot hierarchy to check through. (This example uses the box itself that has the space) | |||
# Make a child object of that slot, then add the [[Component:DynamicValueVariable|DynamicValueVariable]] or [[Component:DynamicReferenceVariable|DynamicReferenceVariable]] component. (The exmaple uses [[Component:DynamicReferenceVariable|DynamicReferenceVariable]]) | |||
## Setup the name for this component. (The example uses <code>Example/MyBox</code>) | |||
# The nodes '''Do Not''' need to be under the slot that has the space to work. (The example uses [[Redprint|Red Print]] to show this example.) | |||
[[Category:Tutorial]] | [[Category:Tutorial]] |
Latest revision as of 09:42, 17 July 2024
As the Dynamic Variables page itself is quite information dense, this tutorial will serve as a quick guide to create, write and read these variables and components, and is also designed to get you started immediately with them, in a step by step process. This should also be simpler to understand in comparison to the main page.
Since you can use dynamic variables in many different configurations, this tutorial will be split up based on what your needs and requirements are.
Triggers & Receivers
Use this when you just want to send a signal across different code groups (and also sometimes with data)
What You Need
- The Dynamic Impulse Trigger & Dynamic Impulse Receiver nodes.
- (Optional) Slot hierarchy.
Setup
- Spawn both Dynamic Impulse Trigger & Dynamic Impulse Receiver nodes with the ProtoFlux Tool.
- Add a tag for both nodes to send and listen for. We are using
Example
for both nodes. - Add a Slot hierarchy for the trigger node.
Dynamic Input Variables & Dynamic Spaces
Use this when you have a value that can be grabbed and used anywhere.
What You Need
- The Dynamic Variable Input node. (Must be under a slot with a DynamicVariableSpace)
- A Slot that contains a DynamicVariableSpace.
- A DynamicValueVariable or DynamicReferenceVariable component.
Setup
- Spawn any Slot to use as your space (the example uses a box), then set up the DynamicVariableSpace component on your slot.
- Pick a name for this space. (The example uses
Example
)
- Pick a name for this space. (The example uses
- Spawn the Dynamic Variable Input node.
- Setup the name for this node. (The example uses
Example/MyBox
)
- Setup the name for this node. (The example uses
- Make a child object of that slot, then add the DynamicValueVariable or DynamicReferenceVariable component. (The exmaple uses DynamicReferenceVariable)
- Setup the name for this component. (The example uses
Example/MyBox
)
- Setup the name for this component. (The example uses
- Pack the Dynamic Variable Input node under the child slot (or anywhere under the slot that has the DynamicVariableSpace), and it should work. (The example uses Red Print to do this.)
Dynamic Read And Write Variables & Dynamic Spaces
Use this when you have component values you want to dynamically read and write from anywhere.
What You Need
- Either a Read Dynamic Variable or a Write Dynamic Variable node. (The slot to check needs to be under a slot with a DynamicVariableSpace)
- A Slot that contains a DynamicVariableSpace.
- A DynamicValueVariable or DynamicReferenceVariable component.
Setup
- Spawn any Slot to use as your space (the example uses a box), then set up the DynamicVariableSpace component on your slot.
- Pick a name for this space. (The example uses
Example
)
- Pick a name for this space. (The example uses
- Spawn the Read Dynamic Variable or Write Dynamic Variable node.
- Setup the path for this node. (The example uses
Example/MyBox
) - Attach a slot hierarchy to check through. (This example uses the box itself that has the space)
- Setup the path for this node. (The example uses
- Make a child object of that slot, then add the DynamicValueVariable or DynamicReferenceVariable component. (The exmaple uses DynamicReferenceVariable)
- Setup the name for this component. (The example uses
Example/MyBox
)
- Setup the name for this component. (The example uses
- The nodes Do Not need to be under the slot that has the space to work. (The example uses Red Print to show this example.)