Expose Instance Information for Udon & UdonSharp
TheMaskedMan00
I have created a mockup to better explain my request
In the screenshot It shows a custom node I created called Instance.Info
Instance.info does not have any inputs or flow and only has outputs.
I also included some crude example usage of each variable in the screenshot, however I will list out in better detail here.
InstanceID (string):
Honestly I should have removed this variable as giving udon access to the InstanceID could potentially be risky if some bad actors took advantage of it to "force access" into a world, however it is still in the mockup for show. I don't think it will actually be added.
StartDateTime (DateTime):
This variable simply returns the DateTime that the instance was opened/created, This could be useful for example: "A display showing how long the instance has been running for". I'm not sure if this data actually exists anywhere in the API as I have not checked, While I don't think this variable existing is too important, it would still be nice.
InstanceType (int or enum):
This variable returns the type of the instance, where
0 = Public
1 = Friends+
2 = Friends
3 = Invite+
4 = Invite
5 = Group Public
6 = Group+
7 = Group
and
99 = LocalTest
.
Personally this is the variable I really want added the most, as it would be useful for example:
Displaying a disclaimer explaining the type of instance you are in somewhere on a wall.
Enabling/Disabling Certain Features of a world depending on instance type ex, opening a door or enabling specific objects.
I think the first example is the most important mainly for group instances, I will get to that in the next 2 Variables.
IsGroupInstance (bool) & GroupName(string)
'IsGroupInstance' is pretty self explanatory, it returns true if the current instance belongs to a group, and false if it does not.
'GroupName' returns the name of the group that the instance belongs to.
Example usage:
A player joins a Group Public world owned by the group 'CheeseTime',
When the player joins a disclaimer board appears in front of them that says the following:
"Hello {PlayerName}, Welcome to {WorldName}! Before you enter I just wanted to let you know that this instance is a 'Group Instance' belonging to the group "CheeseTime". If you don't know what 'Group Instances' are then don't worry! All you need to know is that different groups have different rules, and the actions of the group hosting this instance are not monitored by Me (The guy who programmed this world). If the group is doing something you don't like, or are being mean to you, you can report the group or leave and join/Create a Different/New Instance of this World. Have Fun!
TLDR: This instance is owned by the group 'CheeseTime'. {WorldCreatorName(s)} & {WorldName} are not responsible for any actions taken by the group. Have Fun!
[Agree]
"
The board has a button that says agree, and once the user presses the button they are allowed into the world.
I personally would also love this to be feature more than anything.
(Quick sidetrack, I'm not going to remake the Mockup but I thought of a new variable/node while writing this, Basically a node that returns true if the inputted VRCPlayerAPI is part of the group that the instance is owned by, and a node that returns true if the inputted VRCPlayerAPI has a specific permission/role inside the inputted GroupID.)
GroupID (string):
Returns the ID of the group hosting the instance, could be useful for a button in the world that when pressed opens the menu and goes to GroupID.
IsClosed (bool):
returns true if the instance is closed, false if not.
HasQueue (bool):
Returns true if the creator of the instance has set it up to include a queue.
OnInstanceClosed (event):
Fires when the instance closes. useful if you wanna for example close doors once the instance closes for added realism.
Log In
Myrkur
I feel like this would also be useful in combination with other VRChat features, such as disabling or enabling scaling or stickers for example depending on the world instance information, so a world creator could have scaling disabled in public worlds but allow it for any non public instances, were any semblance of competition would be among friends.