Hello VRChat Devs and World Creators, I know I am supposed to use the canny to create feature requests however this particular request requires inline images to better explain my idea, So I will be Linking the Canny to This Post and will also link This post to the Canny.
Canny Link: Give UDON & U# access to Instance Information & Group Information | Voters | VRChat
For easier understanding I will be showing what the new Udon Nodes could potentially look like.
Lets start with Instance Information.
InstanceInfo
This node will include:
-
Instance Start time (DateTime)
-
Instance Type (int or enum)
-
IsGroupInstance (bool)
-
GroupName (string) (returns “none” if not a group instance)
-
GroupID (string) (returns “none” if not a group instance)
-
IsClosed (bool) (the only variable that is not constant)
-
HasQueue (bool)
Since none of the values from the node will ever change while a player is in the world, it does not need flow. (Only exception to this being the “IsClosed” Boolean)
Also this will include one event:
- OnInstanceClosed
It’s pretty self explanatory. It fires when the instance closes
Now for the GroupsAPI
The GroupsAPI has more than one node, they consist of the following:
IsUserInGroup
It has two inputs:
-
Player (VRCPlayerAPI)
-
GroupID (string)
And One Output:
- InGroup (bool)
This node will have flow
DoesUserHaveRole
This Node has 2 Modes, RoleName & RoleIndex
It has four inputs
-
Player (VRCPlayerAPI)
-
GroupID (string)
-
RoleName (string) OR RoleIndex (int)
-
TrueIfHigher (bool)
And one output:
- HasRole (bool)
The “TrueIfHigher” boolean will set the output to true if the user has the specified role OR a role higher in the list.
For example:
If the player has the role “Admin” and the node has the RoleName “Mod” with “TrueIfHigher” set to true, The node will output true since “Admin” is higher on the role list than “Mod”
When in the RoleIndex Mode, The Highest role will be 0 (Group Owner)
This Node will have flow.
GetGroupRules
It has one input:
- GroupID (string)
And one output:
- Rules (string)
This node will have flow
GetGroupDescription
It has one input:
- GroupID (string)
And one output:
- Description (string)
This node will have flow.
GetGroupBanner
Did not make a mockup node for this one :(
I’m not sure how you guys would want to implement this, so I will let you decide. I thought of making it return a url to the image but image hot-linking has been disabled recently afaik.
Finally the GroupsAPI will include one Event:
- OnLocalRoleChanged
This event will fire when the Roles of the local player change in any group the player is in.
For Example:
If the local player is in the group “Random Group” and somebody changes the local player’s role (either adds the player to the role or changes the permissions of the role) then the event will fire.
These two go hand in hand so I put them both in one post.
Now let’s go over some examples for how these nodes will benefit world creators.
Determining the Instance Type is super useful as world creators can choose to enable/disable certain features of a world depending on the instance type.
For example:
In a Public instance I would make sure the permissions system is disabled and all staff objects will be disabled, While in a Group Public instance we would enable all the permission systems and enable staff objects.
A notification could appear in front of the player when joining any Group Instance, informing them that they have joined a group instance and Groups can set their own rules. Using the “GetGroupDescription” and “GetGroupRules” Nodes, we can put the rules and description inside the world to make it easier for people to see the rules (cause lets be honest, nobody reads group rules before joining a group public)
The “OnInstanceClosed” Event can be used to turn off an open sign at the entrance of a store or bar.
The “IsUserInGroup” and “DoesUserHaveRole” Nodes can save world creators and group owners a huge amount of time and hassle, because groups can assign roles to players in the group and have those roles affect what abilities they have within the worlds, eliminating the need for world creators to create super convoluted permission systems for manually assigning roles to players.
It can also be useful for things like Patreon/Paid Perks in a world, A lot of people still don’t use/don’t have access to the Creator Economy, or they simply use both. World creators need to set up an external GitHub.io site or a pastebin containing the usernames of paid supporters, and keeping track of people changing usernames and what not is very annoying, Remote string loading also poses the risk of people spoofing URLS to include their name in the list (and yes even though UDON Code Signing has been released, this is still an issue). Being able to access a Main Group for the world and checking if the player has a specific role will eliminate all these issues:
-
It doesn’t matter if a player changes their username as we won’t be comparing usernames from a list anymore.
-
Bad actors cannot spoof URLS since we are no longer loading URLS anymore.
-
Skilled Programmers can set up API applications to automatically add & remove players from roles depending on certain factors (like if they subscribed/unsubscribed)
-
Since we aren’t relying on external services like GitHub or pastebin anymore, we don’t need to worry about services going down or some people not having Untrusted URLS enabled.
This is why I have included the “GroupID” Variable in the GroupAPI nodes, as having access to external groups would make that possible.
Quick note:
I have thought about people potentially abusing the GroupAPI to spy on players and see what groups they are in, but the amount of time this would take as well as the fact that the player actually has to be IN the world for the GroupAPI to check makes me think that people won’t go through all this trouble. Besides, you can see what groups people are in by simply visiting their profile.
If you are really worried about it, you could just make it so if the user has the group hidden from everyone on their profile, it will not show them in the GroupsAPI.
GetGroupBanner can be used for automatic decoration of a group instance, like changing a banner above the entrance to the group’s banner.
Getting the GroupID of the group hosting an instance is crucial not only for the rest of the nodes but also having verification, What I would do is have a list of group ID’s that correspond to groups I know follow the guidelines set in place by us, and that they follow the VRChat TOS. If the current group ID is on the list then I can show a little “Trusted Group” Icon somewhere to inform new users that they can trust the group.