User:Paradox19/Amazing Tutorials: Difference between revisions

From Resonite Wiki
m fix typo - permission enums
revamp permission table. im tired so this is probably horribly wrong.
Line 26: Line 26:


=== Okay let's get started with making a cloud variable ===
=== Okay let's get started with making a cloud variable ===
Basically, just send <code>/createUserVar variable_space.variable type default_value variable_owner_unsafe variable_owner definition_owner_only</code> to the [[Resonite Bot|Resonite bot]]. Of course, replace <code>variable_space</code> and <code>variable</code> with your variable name. Like: <code>my_super_epic_app.Colour</code> where <code>my_super_epic_app</code> is the namespace (basically the asset where this is used) and <code>Colour</code> is the variable.
Basically, just send <code>/createUserVar variable_space.variable type default_value variable_owner_unsafe variable_owner definition_owner</code> to the [[Resonite Bot|Resonite bot]]. Of course, replace <code>variable_space</code> and <code>variable</code> with your variable name. Like: <code>my_super_epic_app.Colour</code> where <code>my_super_epic_app</code> is the namespace (basically the asset where this is used) and <code>Colour</code> is the variable.


<code>type</code> is the type for this variable, since cloud variables are statically typed. '''''Don't screw this up else you'll need to recreate the variable.''''' ''That's why they're statically typed.''
<code>type</code> is the type for this variable, since cloud variables are statically typed. '''''Don't screw this up else you'll need to recreate the variable.''''' ''That's why they're statically typed.''
Line 37: Line 37:
run <code>/setUserVarPerms path action perm_type</code> where path is your <code>variable_space.variable</code>, action is <code>read</code>, <code>write</code> OR <code>list</code> (you should never need to set <code>list</code> to anything other than <code>definition_owner</code> because idk) and <code>perm_type</code> is any of the perm types. The table below details the different permission types.
run <code>/setUserVarPerms path action perm_type</code> where path is your <code>variable_space.variable</code>, action is <code>read</code>, <code>write</code> OR <code>list</code> (you should never need to set <code>list</code> to anything other than <code>definition_owner</code> because idk) and <code>perm_type</code> is any of the perm types. The table below details the different permission types.


(<code>use</code> means to do the specified action, so <code>read</code>, <code>write</code>, or <code>list</code>)
(<code>use</code> means to do the specified action, so <code>read</code>, <code>write</code>, or but NOT <code>list</code>)
 
=== Most common perm types ===
{| class="wikitable"
{| class="wikitable"
|+
|+
Line 43: Line 45:
!perm type
!perm type
!description
!description
!limits
|-
|-
|Most restricted
|most restricted
|definition_owner_only
|definition_owner_only
|only YOU (the person who made the variable) can use it in USERSPACE
|only YOU (the person who made the variable) can use it in USERSPACE
|Not available for list perms*
|-
|-
|
|
|definition_owner_only_unsafe
|definition_owner_only_unsafe
|only YOU (the person who made the variable) can use it ANYWHERE
|only YOU (the person who made the variable) can use it ANYWHERE
|Not available for list perms
|-
|-
|
|
|variable_owner
|variable_owner
|only the person who SET the value can use it in USERSPACE (this is what I recommend for WRITING)
|only the person who SET the value can use it in USERSPACE (this is what I recommend for WRITING)
|
|-
|-
|
|
|variable_owner_unsafe
|variable_owner_unsafe
|only the person who SET the value can use it ANYWHERE (this is what I recommend for READING)
|only the person who SET the value can use it ANYWHERE (this is what I recommend for READING)
|
|-
|-
|Least restricted
|least restricted
|anyone
|anyone
|anyone can use this for ANYONE (so not recommended)
|anyone can use this for ANYONE (so not recommended)
|
|}
<nowiki>*</nowiki> For list permissions, please use <code>definition_owner</code>, don't ask me why.
=== More abstract permissions (user definition only) ===
''I'm not covering cloud variables for groups here. I don't know how those work.''
{| class="wikitable mw-collapsible mw-collapsed"
|+
!
!perm type
!description
!limits
|-
|most restricted
|definition_owner_only_contacts
|allows contacts of the person who made the variable to use this permission in USERSPACE
|
|-
|
|definition_owner_only_contacts_unsafe
|allows contacts of the person who made the variable to use this permission ANYWHERE
|
|-
|
|variable_owner_only_contacts
|''Your guess is as good as mine.''
|
|-
|least restricted
|variable_owner_only_contacts_unsafe
|''Your guess is as good as mine.''
|
|}
|}
Wow! Does the regular [[Cloud Variables|cloud variable]] wiki need to be as complicated as it is?
Wow! Does the regular [[Cloud Variables|cloud variable]] wiki need to be as complicated as it is?

Revision as of 21:24, 27 May 2024

This article is satire, it doesn't represent reality and is designed to provide humor or entertainment.

Not to be confused with Tutorials, those are actually helpful.

This page documents overly simplified tutorials by Paradox19. You can use these methods but they're definitely not the best.

Disclaimers

  • This page does not use proper Wiki Style, this is by design due to the satire nature of this article.
  • You can use the methods outlined here to accomplish tasks, but they are not recommended
  • This is way too many disclaimers for one page

Cloud variables for dummies

This does not cover cloud variables for groups.

Cloud variables are weird. They allow for communicating between sessions and persistent data.

Misconception(s)

"erm, im tryna make something that syncs between userspace and world space but the rate limits are gonna screw me over???"

Nope! The rate limits only apply to PERSISTENT data stores. Cloud variables are first synced between sessions, which have no rate limits, and THEN synced to the cloud for persistent data.

(Persistence: From Wikipedia, the free encyclopedia: persistence refers to the characteristic of state of a system that outlives (persists more than) the process that created it) Basically, if something's persistent it's saved.

So as an example, my custom world loading indicator uses cloud variables but I don't have to worry about the rate limits there since my main goal isn't persistence - it's inter-session communication.

Okay let's get started with making a cloud variable

Basically, just send /createUserVar variable_space.variable type default_value variable_owner_unsafe variable_owner definition_owner to the Resonite bot. Of course, replace variable_space and variable with your variable name. Like: my_super_epic_app.Colour where my_super_epic_app is the namespace (basically the asset where this is used) and Colour is the variable.

type is the type for this variable, since cloud variables are statically typed. Don't screw this up else you'll need to recreate the variable. That's why they're statically typed.

default_value is the default value you want this variable to have when it is initialised for anyone.

The final stuff is the permission settings I usually recommend to people, if for SOME REASON you need to WRITE to a cloud variable in world space (you should never need to do this) then replace variable_owner with variable_owner_unsafe

"oops i need to change the permissions as i screwed up"

run /setUserVarPerms path action perm_type where path is your variable_space.variable, action is read, write OR list (you should never need to set list to anything other than definition_owner because idk) and perm_type is any of the perm types. The table below details the different permission types.

(use means to do the specified action, so read, write, or but NOT list)

Most common perm types

perm type description limits
most restricted definition_owner_only only YOU (the person who made the variable) can use it in USERSPACE Not available for list perms*
definition_owner_only_unsafe only YOU (the person who made the variable) can use it ANYWHERE Not available for list perms
variable_owner only the person who SET the value can use it in USERSPACE (this is what I recommend for WRITING)
variable_owner_unsafe only the person who SET the value can use it ANYWHERE (this is what I recommend for READING)
least restricted anyone anyone can use this for ANYONE (so not recommended)

* For list permissions, please use definition_owner, don't ask me why.

More abstract permissions (user definition only)

I'm not covering cloud variables for groups here. I don't know how those work.

perm type description limits
most restricted definition_owner_only_contacts allows contacts of the person who made the variable to use this permission in USERSPACE
definition_owner_only_contacts_unsafe allows contacts of the person who made the variable to use this permission ANYWHERE
variable_owner_only_contacts Your guess is as good as mine.
least restricted variable_owner_only_contacts_unsafe Your guess is as good as mine.

Wow! Does the regular cloud variable wiki need to be as complicated as it is?

"okay so im no longer using one so how do i delete it?"

First off, even if you're no longer using one, someone else might be with a fork of your project so expect something to break.

Anyway, just run: /deleteUserVar path and it'll be removed within half an hour