Bind a function to the OnChat event. This function will be called every time a new chat message is received on the local channel.
Parameter
Type
Description
Space.Network.Chat.OnChat(OnChatFunction)
--this script takes every new chat message and displays it in a UIText uiText = Space.Host.GetReference("text").UIText --Add this Text object as reference in Scripting RuntimeOnChatFunction=function(SChatMessage)uiText.Text = SChatMessage.Sender ..": " .. SChatMessage.Message endSpace.Network.Chat.OnChat(OnChatFunction)
JoinChat
void JoinChat (string name)
Join a chat channel.
Parameter
Type
Description
Space.Network.Chat.JoinChat("Test room")
--this script will make the player join a chat when entering a trigger collider and leave it when leaving--[Requires this object to have a "Trigger" collider]thisObject = Space.Host.ExecutingObjectthisPlayer = Space.Scene.PlayerAvatarOTS=function(gameObject)if gameObject.Avatar ~=niland thisPlayer == gameObject.Avatar then Space.Network.Chat.JoinChat("PrivateChatZone")endendOTE=function(gameObject)if gameObject.Avatar ~=niland thisPlayer == gameObject.Avatar then Space.Network.Chat.LeaveChat("PrivateChatZone")endendthisObject.OnTriggerStart(OTS)thisObject.OnTriggerExit(OTE)
GetXMPPName
string GetXMPPName (string name)
Get XMPP name.
Parameter
Type
Description
Space.Network.Chat.GetXMPPName("Test room")
LeaveChat
void LeaveChat (string name)
Leave a chat channel.
Parameter
Type
Description
Space.Network.Chat.LeaveChat("Test room")
--this script will make the player join a chat when entering a trigger collider and leave it when leaving--[Requires this object to have a "Trigger" collider]thisObject = Space.Host.ExecutingObjectthisPlayer = Space.Scene.PlayerAvatarOTS=function(gameObject)if gameObject.Avatar ~=niland thisPlayer == gameObject.Avatar then Space.Network.Chat.JoinChat("PrivateChatZone")endendOTE=function(gameObject)if gameObject.Avatar ~=niland thisPlayer == gameObject.Avatar then Space.Network.Chat.LeaveChat("PrivateChatZone")endendthisObject.OnTriggerStart(OTS)thisObject.OnTriggerExit(OTE)
void JoinVoice (string channel, int priority=5, int spatial=0)
Join a voice chat channel.
Parameter
Type
Description
Space.Network.Chat.JoinVoice("PrivateVoiceZone")
--this script will make the player join a voice channel when entering a trigger collider and leave it when leaving--[Requires this object to have a "Trigger" collider]thisObject = Space.Host.ExecutingObjectthisPlayer = Space.Scene.PlayerAvatarOTS=function(gameObject)if gameObject.Avatar ~=niland thisPlayer == gameObject.Avatar then Space.Network.Chat.JoinVoice("PrivateVoiceZone")endendOTE=function(gameObject)if gameObject.Avatar ~=niland thisPlayer == gameObject.Avatar then Space.Network.Chat.LeaveVoice("PrivateVoiceZone")endendthisObject.OnTriggerStart(OTS)thisObject.OnTriggerExit(OTE)
JoinGridVoice
void JoinGridVoice (string channel, int priority=5, int spatial=0)
JoinGridVoice is the same as JoinVoice except with a grid wide parameter. (white-label only)
--this script will make the player join a Grid voice channel when entering a trigger collider and leave it when leaving--[Requires this object to have a "Trigger" collider]thisObject = Space.Host.ExecutingObjectthisPlayer = Space.Scene.PlayerAvatarOTS=function(gameObject)if gameObject.Avatar ~=niland thisPlayer == gameObject.Avatar then Space.Network.Chat.JoinGridVoice("PrivateGridVoiceZone")endendOTE=function(gameObject)if gameObject.Avatar ~=niland thisPlayer == gameObject.Avatar then Space.Network.Chat.LeaveVoice("PrivateGridVoiceZone")endendthisObject.OnTriggerStart(OTS)thisObject.OnTriggerExit(OTE)
LeaveVoice
void LeaveVoice (string channel)
Leave a voice chat channel
Parameter
Type
Description
Space.Network.Chat.LeaveVoice("PrivateVoiceZone")
--this script will make the player join a voice channel when entering a trigger collider and leave it when leaving--[Requires this object to have a "Trigger" collider]thisObject = Space.Host.ExecutingObjectthisPlayer = Space.Scene.PlayerAvatarOTS=function(gameObject)if gameObject.Avatar ~=niland thisPlayer == gameObject.Avatar then Space.Network.Chat.JoinVoice("PrivateVoiceZone")endendOTE=function(gameObject)if gameObject.Avatar ~=niland thisPlayer == gameObject.Avatar then Space.Network.Chat.LeaveVoice("PrivateVoiceZone")endendthisObject.OnTriggerStart(OTS)thisObject.OnTriggerExit(OTE)