mNo edit summary |
WIP: expanding with examples |
||
Line 15: | Line 15: | ||
{{Template:Variable_Name_ProtoFlux}} | {{Template:Variable_Name_ProtoFlux}} | ||
== Reading == | |||
The store can be read similar to other data outputs because it is data, but be aware of the need to use a [[ProtoFlux:Continuously Changing Relay|Continuous Relay]] if you want to watch the value to detect changes. Otherwise its value will only be queried when one of the downstream nodes pulls for it (for example an impulse). TODO: validate | |||
TODO: example reading with relay | |||
TODO: example reading without relay | |||
== Writing == | |||
Writing to the store can be accomplished with the [[ProtoFlux:Write|Write]] node. | |||
TODO: example with write node | |||
== Scoping == | |||
A Store is scoped to the user. This is broader than the [[ProtoFlux:Local|Local]] but narrower than the [[ProtoFlux:Data Model Store|Data Model Store]]. Compared to other programming languages, it is most similar to a global variable. | |||
TODO: example of referencing a store from different locations | |||
== See Also == | == See Also == |
Revision as of 15:08, 14 April 2025
This article or section is a Stub. You can help the Resonite Wiki by expanding it.
This page is missing content because it needs many more examples, since this node is quite a complex topic. TODO: Maybe explain this in reference to variables in programming?
A Store is a variable that is not networked and not part of the data model. Each user can have a unique value for themselves inside of a Store and it is not specific to any context, which means it can be used across many objects and ProtoFlux scripts or even as part of a drive. This is similar to what happens when you use a ValueUserOverride on a field, however it does behave slightly differently: It will not update its value automatically when written to from other sources, and you will usually need to use a Continuous Relay with Stores to make them update in the same way that a data model field would.
The visual on this page is not a good representation of the node's appearance in game at the moment.
The node in game has a string in the center that can be edited like a text field. This text field actually just renames the slot of the protoflux node, and will populate with the node's name when unpacked. This is useful for naming your variables, and should have no downsides. As such, never assume this node will have their slot name contain this node's type or something similar.
Reading
The store can be read similar to other data outputs because it is data, but be aware of the need to use a Continuous Relay if you want to watch the value to detect changes. Otherwise its value will only be queried when one of the downstream nodes pulls for it (for example an impulse). TODO: validate
TODO: example reading with relay
TODO: example reading without relay
Writing
Writing to the store can be accomplished with the Write node.
TODO: example with write node
Scoping
A Store is scoped to the user. This is broader than the Local but narrower than the Data Model Store. Compared to other programming languages, it is most similar to a global variable.
TODO: example of referencing a store from different locations
See Also
- Contexts
- ProtoFlux:Data Model Store for the network synchronized version of this node
- ProtoFlux:Local for the locally scoped version of this node