Developer Features
Developer Menu
Cluster provides features for creators who are building worlds.
These features can be enabled and used through the developer menu.
For instructions on how to enable and access the developer menu, please see the help page.
Slash commands
The slash commands feature allows you to execute various functions by entering a string starting with /
in the comment field and sending it.
Slash commands can be enabled from the developer menu.
The slash commands you send and their results are not visible to other users.
Some slash commands have parameters.
Commands and parameters must be separated by spaces.
Currently, the following slash commands are available:
/getmyposition
- Shows your current coordinates.
Available only for the world creator.
- Shows your current coordinates.
/getmypos
- Shorthand for
/getmyposition
.
- Shorthand for
/help
- Shows a list of slash commands.
/item destroy itemID
- Delete the item that matches the
itemID
. World Placed Items cannot be deleted.
Available only for the world creator.
- Delete the item that matches the
/item owner itemID
- Get the current owner’s ID of the item that matches the
itemID
. The result will be displayed in the console.
Available only for the world creator.
- Get the current owner’s ID of the item that matches the
/item state itemID
- Get the list of states for the item that matches the
itemID
. The result will be displayed in the console.
Available only for the item creator.
- Get the list of states for the item that matches the
/item state itemID key
- Get the value of the item’s state
key
for the item that matches theitemID
. The result will be displayed in the console.
Available only for the item creator.
- Get the value of the item’s state
/item state itemID key type value
Set the
value
oftype
for the property namedkey
in the state of the item that matches theitemID
.
Available only for the item creator.type
can be set to one of the following strings corresponding to Sendable or null.- number: Set the Number type.
- string: Set the String type.
- bool: Set the Boolean type.
- vec2: Set the Vector2 type.
- vec3: Set the Vector3 type.
- quaternion: Set the Quaternion type.
- playerHandle: Set the PlayerHandle type.
- itemHandle: Set the ItemHandle type.
- array: Set the Array type.
- object: Set the Object type.
For the
value
, see Generation rules for value.
/items
- Get the list of IDs for items with the ScriptableItem in the space. The results will be displayed in the console.
The displayed ID is the same values as ItemHandle.id.
Available only for the world creator.
- Get the list of IDs for items with the ScriptableItem in the space. The results will be displayed in the console.
/respawn
- Respawns yourself.
Available only for the world creator.
- Respawns yourself.
/users
- Get the list of IDs for users in the space. The results will be displayed in the console.
The displayed ID is the same values as PlayerHandle.id.
Available only for the world creator.
- Get the list of IDs for users in the space. The results will be displayed in the console.
/warp x y z
- Warps yourself to the coordinates specified by (x y z).
Available only for the world creator.
- Warps yourself to the coordinates specified by (x y z).
Generation rules for value
The generation rules for value used in /item state itemID key type value
are as follows:
<value>
-><null>
|<number>
|<bool>
|<string>
|<vec2>
|<vec3>
|<quaternion>
|<itemHandle>
|<playerHandle>
|<array>
|<object>
<null>
-> null<number>
-> Number| NaN | Infinity | -Infinity<bool>
-> true | false<string>
-> “<string_element>
”<string_element>
-> String
<vec2>
-> (<number>
<number>
)<vec3>
-> (<number>
<number>
<number>
)<quaternion>
-> (<number>
<number>
<number>
<number>
)<itemHandle>
-> item-<itemId>
<itemId>
-> String from ItemHandle.id
<playerHandle>
-> player-<playerId>
<playerId>
-> String from PlayerHandle.id
<array>
-> [<array_element>
]<array_element>
-> ε |<value>
|<value>
<array_element>
<object>
-> {<object_element>
}<object_element>
-> ε |<object_key>
:<value>
|<object_key>
:<value>
<object_element>
<object_key>
-> String without spaces
Example
/item state 123456789 playerData object {targetPlayer:player-a0a-b1b-c2c-d3d-e4e playerName:"player01" position:(1.5 0 -2.5) equipments:[item-12345 item-67890]}
- Sets an object with the following four properties to the state of the item whose ID is
123456789
with keyplayerData
:- key:
targetPlayer
, value: PlayerHandle of the player with IDa0a-b1b-c2c-d3d-e4e
- key:
playerName
, value:player01
as a string. - key:
position
, value:(1.5, 0, -2.5)
as a Vector3. - key:
equipments
, value: An array with two elements: ItemHandle of the item with ID12345
and ItemHandle of the item with ID67890
.
- key:
- Sets an object with the following four properties to the state of the item whose ID is
Show all logs
When enabled, all logs of scripts that have occurred within your craftspace or space will be shown.
This feature is available on PC/Mac.
Item names are displayed up to 32 characters.
If a large amount of logs are output in a short period of time or if the logs are long, some of the logs may not be displayed.
Editor Extension Features
Creator Kit provides a feature for Unity Editor extension to register callbacks before and after a world is uploaded.
To use this feature, add reference to ClusterVR.CreatorKit.Editor.EditorEvents.asmdef
for your editor C# code, and access WorldUploadEvents
to register callbacks.
WorldUploadEvents
class supports following methods.
Method | Description |
---|---|
RegisterOnWorldUploadStart | Registers callback method to be called when starting to upload the world. Callback method must return true to proceed the upload, and return false if world upload should be stopped. |
RegisterOnWorldUploadEnd | Registers callback method to be called when world upload succeeds or fails. |
The following sample code registers callbacks that log before and after a world is uploaded.
using ClusterVR.CreatorKit.Editor.EditorEvents;
using UnityEditor;
using UnityEngine;
public static class MyWorldUploadEventHandler
{
[InitializeOnLoadMethod]
public static void Initialize()
{
WorldUploadEvents.RegisterOnWorldUploadStart(OnWorldUploadStarted);
WorldUploadEvents.RegisterOnWorldUploadEnd(OnWorldUploadEnded);
}
static bool OnWorldUploadStarted(WorldUploadStartEventData data)
{
Debug.Log($"World upload started, root object count = {data.Scene.rootCount}");
return true;
}
static void OnWorldUploadEnded(WorldUploadEndEventData data)
{
Debug.Log($"World upload ended, success={data.Success}");
}
}