How To Use Cloud Variables

From Resonite Wiki

As the Cloud Variables page itself is quite information dense, this tutorial will serve as a quick guide to create, write and read these variables, 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.

What You Need

  • Expected Prerequisites (Access to Resonite with an account, logged in, internet access, etc)
  • Freely Available Cloud Variable Storage Space (everyone has 256 available, more if you have a group)

Setup

There is a little bit of setup on the user's part. But once setup, you dont have to worry about it anymore until we get into the ProtoFlux side of things.

Resonite Bot

An item that has an easy way to create a cloud variable.
An item that has an easy way to create a cloud variable.

The commands for working with cloud variables, using the Resonite Bot. There is a whole list of commands and replaceable words for each command, so we are just going to use the long line versions where possible to get everything setup easily. For the whole set of commands, check the Cloud Variable Commands list.

We are going to use: /createUserVar <path> <type> <default value> <read perms> <write perms> <list perms>. And as an example, we want a string to store information, and anyone of our friends can access this table of information. The command below is our input for the Resonite Bot, feel free to change this to your liking (such as different types or permissions).

  • /createUserVar MyVariable string:8192 <defaultval> variable_owner_unsafe variable_owner_unsafe anyone

Sometimes we want to remove a variable that we no longer need, or we want to clear out the table of values by deleting it and recreating it. To delete a variable, for example, the one we just made:

  • /deleteUserVar MyVariable
Creating or deleting a cloud variable takes time, about 30 min each. Take this time to make some coffee or to get some lunch while you wait.

ProtoFlux

Now that the variable is created, lets use it immediately.

Write

An example that shows how to write a cloud variable using ProtoFlux.
An example that shows how to write a cloud variable using ProtoFlux.

To write to the cloud variable, set up and spawn out the ProtoFlux node Write Cloud Variable. (See image for how it should be connected).

  • Path should be the name of the variable along with the User ID prefixed to it: U-AmasterAmaster.MyVariable
  • VariableOwnerId should be the variable owner's User ID, basically anyone that wants to use this data table in the cloud: U-AmasterAmaster. Does not have to be yourself as well, it can be anyone's ID.
  • Value is any content you want to write in there, as long as it matches the type.

Read

An example that shows how to read a cloud variable using ProtoFlux.
An example that shows how to read a cloud variable using ProtoFlux.

To read from the cloud variable, set up and spawn out the ProtoFlux node Read Cloud Variable. (See image for how it should be connected).

  • Path should be the name of the variable along with the User ID prefixed to it: U-AmasterAmaster.MyVariable
  • VariableOwnerId should be the variable owner's User ID, basically anyone that wants to use this data table in the cloud: U-AmasterAmaster. Does not have to be yourself as well, it can be anyone's ID.

Conclusion

Cloud variables should not be as hard as they are, but with enough time and setup, as well as knowledge to how these variables work, you can use them in your projects without the confusion attached to them.