Difference between revisions of "World Scripting Reference"

From Virtual World Web Wiki
Jump to: navigation, search
Line 59: Line 59:
 
===System (C# class: SystemFunctions)===
 
===System (C# class: SystemFunctions)===
 
====Methods====
 
====Methods====
:Debug(string message) : void
+
:{{CSharp|void Debug(string message)}}
 
::An alias for Log.WriteDebug
 
::An alias for Log.WriteDebug
:ServerLog(string message) : void
+
:{{CSharp|void ServerLog(string message)}}
 
::Writes a debug message to the server log system (as opposed to the script debug system)
 
::Writes a debug message to the server log system (as opposed to the script debug system)
:GetInstance() : Instance
+
:{{CSharp|Instance GetInstance()}}
 
::Gets a reference to the Instance object representing the current “room” or instance in which the calling script is running.
 
::Gets a reference to the Instance object representing the current “room” or instance in which the calling script is running.
:CreateTimer(function callback, int dueTime, int period) : int
+
:{{CSharp|int CreateTimer(function callback, int dueTime, int period)}}
 
::Creates a timer which will fire once in dueTime milliseconds and then every period milliseconds. When the timer fires, it will call the specified JavaScript callback function. An integer handle to the timer is returned.
 
::Creates a timer which will fire once in dueTime milliseconds and then every period milliseconds. When the timer fires, it will call the specified JavaScript callback function. An integer handle to the timer is returned.
:RemoveTimer(int timerID) : bool
+
:{{CSharp|bool RemoveTimer(int timerID)}}
 
::Removes a timer given a timer handle from CreateTimer.
 
::Removes a timer given a timer handle from CreateTimer.
:BroadcastMessage(int channel, string message, DOMObject source) : bool
+
:{{CSharp|bool BroadcastMessage(int channel, string message, DOMObject source)}}
 
::Sends a JSScriptEVentMessage packet to all connected clients in the room. Client side UI script can process and respond to this message.
 
::Sends a JSScriptEVentMessage packet to all connected clients in the room. Client side UI script can process and respond to this message.
:ListenOnChannel(int channel, function callback) : void
+
:{{CSharp|void ListenOnChannel(int channel, function callback)}}
 
::Begins listening on a given script channel number and defines a JavaScript callback to call when a message arrives from another script.
 
::Begins listening on a given script channel number and defines a JavaScript callback to call when a message arrives from another script.
:BroadcastOnChannel(int channel, string message, DOMObject source) : void
+
:{{CSharp|void BroadcastOnChannel(int channel, string message, DOMObject source)}}
 
::Sends a message on a given channel to all listening scripts. The message an source will be passed to the listening scripts’ callback function registered with ListenOnChannel. These messages are not delivered to connected clients.
 
::Sends a message on a given channel to all listening scripts. The message an source will be passed to the listening scripts’ callback function registered with ListenOnChannel. These messages are not delivered to connected clients.
:FindController(DOMObject target) : DOMController
+
:{{CSharp|DOMController FindController(DOMObject target)}}
 
::If the target object is in a persona document, this method will return the document’s first DOMController.
 
::If the target object is in a persona document, this method will return the document’s first DOMController.
:FindParentController(DOMObject target) : DOMController
+
:{{CSharp|DOMController FindParentController(DOMObject target)}}
 
::Searches up the DOM tree from target looking for the first DOMController.
 
::Searches up the DOM tree from target looking for the first DOMController.
:FindParticipant(DOMObject target) : Participant
+
:{{CSharp|Participant FindParticipant(DOMObject target)}}
 
::If the target object is in a persona document, this method will return the document’s first DOMController.
 
::If the target object is in a persona document, this method will return the document’s first DOMController.
:CreateWebRequest(string requestType, string contentType, string url, function callback, string postData) : void
+
:{{CSharp|void CreateWebRequest(string requestType, string contentType, string url, function callback, string postData)}}
 
::Requests data from the web at the given url. requestType should be GET or POST. If POST, the postData should contain the data to post. contentType is optional and can be null or empty. The callback will be called with two parameters: the response string data, and an integer http status code (200 = success).
 
::Requests data from the web at the given url. requestType should be GET or POST. If POST, the postData should contain the data to post. contentType is optional and can be null or empty. The callback will be called with two parameters: the response string data, and an integer http status code (200 = success).
  
 
===Physics (C# class: PhysicsFunctions)===
 
===Physics (C# class: PhysicsFunctions)===
 
====Methods====
 
====Methods====
:CastSphere(Vector3 origin, Vector3 direction, float radius, float maxdistance) : void
+
:{{CSharp|void CastSphere(Vector3 origin, Vector3 direction, float radius, float maxdistance)}}
 
::Ask patrick
 
::Ask patrick
:FireProjectile(DOMTransform projectile, Vector3 origin, Vector3 direction, float speed, float maxdistance, bool usegravity) : void
+
:{{CSharp|void FireProjectile(DOMTransform projectile, Vector3 origin, Vector3 direction, float speed, float maxdistance, bool usegravity)}}
 
::Ask patrick
 
::Ask patrick
:PathTo(Vector3 position, float speed) : void
+
:{{CSharp|void PathTo(Vector3 position, float speed)}}
 
::Ask patrick
 
::Ask patrick
  
 
===Log (C# class: DebugLog)===
 
===Log (C# class: DebugLog)===
 
====Methods====
 
====Methods====
:WriteVerbose(string message) : void
+
:{{CSharp|void WriteVerbose(string message)}}
:WriteDebug(string message) : void
+
:{{CSharp|void WriteDebug(string message)}}
:WriteInfo(string message) : void
+
:{{CSharp|void WriteInfo(string message)}}
:WriteWarning(string message) : void
+
:{{CSharp|void WriteWarning(string message)}}
:WriteError(string message) : void
+
:{{CSharp|void WriteError(string message)}}
:WriteFatal(string message) : void
+
:{{CSharp|void WriteFatal(string message)}}
 
::These methods write script debug messages to connected clients with LayerOne permissions
 
::These methods write script debug messages to connected clients with LayerOne permissions
  
 
===Chat (C# class: ChatChannelExtended.ChatFunctions)===
 
===Chat (C# class: ChatChannelExtended.ChatFunctions)===
 
====Methods====
 
====Methods====
:GetLocalChannel() : ChatChannel
+
:{{CSharp|ChatChannel GetLocalChannel()}}
 
::Gets a reference to the general chat channel for the current instance.
 
::Gets a reference to the general chat channel for the current instance.
:CreateChannel(string displayName) : ChatChannel
+
:{{CSharp|ChatChannel CreateChannel(string displayName)}}
 
::Creates a new named chat channel for use by the calling script.
 
::Creates a new named chat channel for use by the calling script.
  
Line 115: Line 115:
 
===Rays (C# class: JSGlobalRays)===
 
===Rays (C# class: JSGlobalRays)===
 
====Methods====
 
====Methods====
:Transfer(Participant source, Participant target, float amount) : bool
+
:{{CSharp|bool Transfer(Participant source, Participant target, float amount)}}
 
::Transfers Rays currency between the two accounts represented by the source and target DOMObjects which must each belong to persona documents.
 
::Transfers Rays currency between the two accounts represented by the source and target DOMObjects which must each belong to persona documents.
:Collect(Participant source, float amount) : bool
+
:{{CSharp|bool Collect(Participant source, float amount)}}
 
::Takes the specified amount of Rays currency from the account represented by the source DOMObject which must belong to persona document.
 
::Takes the specified amount of Rays currency from the account represented by the source DOMObject which must belong to persona document.
:Payout(Participant target, float amount) : bool
+
:{{CSharp|bool Payout(Participant target, float amount)}}
 
::Gives the specified amount of Rays currency to the account represented by the target DOMObject which must belong to persona document.
 
::Gives the specified amount of Rays currency to the account represented by the target DOMObject which must belong to persona document.
:GetBalance(Participant target) : float
+
:{{CSharp|float GetBalance(Participant target)}}
 
::Gets the balance in Rays of the account represented by the target DOMObject which must belong to persona document.
 
::Gets the balance in Rays of the account represented by the target DOMObject which must belong to persona document.
  
 
===Adult (C# class: JSGlobalAdult)===
 
===Adult (C# class: JSGlobalAdult)===
 
====Methods====
 
====Methods====
:CreateEngagement(DOMObject target, string startingState, bool autoDispose) : EngagementControl
+
:{{CSharp|EngagementControl CreateEngagement(DOMObject target, string startingState, bool autoDispose)}}
 
::Begins an adult system engagement (shared animation state), using target as the focus or parent object of the engagement and beginning in the state specified by startingState. When autoDispose is true, the engagement will clean itself up when the number of participants falls below critical numbers (usually when the last participant leaves, but in some cases, like hugging, when any one person leaves).
 
::Begins an adult system engagement (shared animation state), using target as the focus or parent object of the engagement and beginning in the state specified by startingState. When autoDispose is true, the engagement will clean itself up when the number of participants falls below critical numbers (usually when the last participant leaves, but in some cases, like hugging, when any one person leaves).
:GetEngagement(DOMObject target) : EngagementControl
+
:{{CSharp|EngagementControl GetEngagement(DOMObject target)}}
 
::Tries to find an engagement control involving the DOMObject specified by target.
 
::Tries to find an engagement control involving the DOMObject specified by target.
  
 
===Cloud (C# class: JSGlobalCloud)===
 
===Cloud (C# class: JSGlobalCloud)===
 
====Methods====
 
====Methods====
:SetApplication(string applicationID) : bool
+
:{{CSharp|bool SetApplication(string applicationID)}}
 
::Associates this script with an application (scope of data storage). A single call to this function is required before most other GameCloud functions will work. Simply pass a Guid as a string.
 
::Associates this script with an application (scope of data storage). A single call to this function is required before most other GameCloud functions will work. Simply pass a Guid as a string.
:SetData(string key, string value) : bool
+
:{{CSharp|bool SetData(string key, string value)}}
 
::Sets the value of an application-scoped data item. This is basic global application string data storage.
 
::Sets the value of an application-scoped data item. This is basic global application string data storage.
:GetData(string key) : string
+
:{{CSharp|string GetData(string key)}}
 
::Gets the value of an application scoped data item.
 
::Gets the value of an application scoped data item.
:DeleteData(string key) : string
+
:{{CSharp|string DeleteData(string key)}}
 
::Deletes the specified application scoped data item.
 
::Deletes the specified application scoped data item.
:RegisterInteraction(string selector, string abilityIdentifier, string groupIdentifier = null) : InteractionMapping
+
:{{CSharp|InteractionMapping RegisterInteraction(string selector, string abilityIdentifier, string groupIdentifier {{=}} null)}}
 
::Wraps up the ViewInfo’s AddInteractionMapping and AddAbility methods into a single call. The abilityIdentifier is the name of a GameCloud registered ability (created in the admin). The groupIdentifier is the optional name of a GameCloud registered entity group used to filter who gets the interaction, and the selector is a CSS-Style selector which identifies nodes which are eligible targets of the interaction.
 
::Wraps up the ViewInfo’s AddInteractionMapping and AddAbility methods into a single call. The abilityIdentifier is the name of a GameCloud registered ability (created in the admin). The groupIdentifier is the optional name of a GameCloud registered entity group used to filter who gets the interaction, and the selector is a CSS-Style selector which identifies nodes which are eligible targets of the interaction.
:SaveData() : void
+
:{{CSharp|void SaveData()}}
 
::Checkpoints your app data. Just in case.
 
::Checkpoints your app data. Just in case.
:GetCurrency(string identifier, bool accountScoped) : CloudCurrency
+
:{{CSharp|CloudCurrency GetCurrency(string identifier, bool accountScoped)}}
 
::Gets or creates a currency for use in your javascript applications. The returned object can be used to transact in this currency, and get balance of accounts.
 
::Gets or creates a currency for use in your javascript applications. The returned object can be used to transact in this currency, and get balance of accounts.
  
 
===HAM (C# class: JSGlobalHAM) (hosted by CreatureManager)===
 
===HAM (C# class: JSGlobalHAM) (hosted by CreatureManager)===
 
====Methods====
 
====Methods====
:IsAvailable() : bool
+
:{{CSharp|bool IsAvailable()}}
 
::Returns true if the creature manager is installed.
 
::Returns true if the creature manager is installed.
:SetAttachment(string attachmentName, DOMObject target, int attachID) : bool
+
:{{CSharp|bool SetAttachment(string attachmentName, DOMObject target, int attachID)}}
 
::Obsolete
 
::Obsolete
:HasAttachment(strin attachmentName, DOMObject target) : bool
+
:{{CSharp|bool HasAttachment(strin attachmentName, DOMObject target)}}
 
::Obsolete
 
::Obsolete
:ClearAttachment(string attachmentName, DOMObject target) : bool
+
:{{CSharp|bool ClearAttachment(string attachmentName, DOMObject target)}}
 
::Obsolete
 
::Obsolete
  
 
===Avatar (C# class: JavascriptAvatar)===
 
===Avatar (C# class: JavascriptAvatar)===
 
====Methods====
 
====Methods====
:PlayAnimation(DOMObject target, string actionID, bool looping) : bool
+
:{{CSharp|bool PlayAnimation(DOMObject target, string actionID, bool looping)}}
 
::Triggers a HAM action item on the specified player, given its actionID as a Guid
 
::Triggers a HAM action item on the specified player, given its actionID as a Guid
:StopAnimation(DOMObject target, string actionID) : bool
+
:{{CSharp|bool StopAnimation(DOMObject target, string actionID)}}
 
::Stops a HAM action from playing on the specified player given its actionID as a Guid
 
::Stops a HAM action from playing on the specified player given its actionID as a Guid
  
 
===Bot (C# class: JavascriptBot)===
 
===Bot (C# class: JavascriptBot)===
 
====Methods====
 
====Methods====
:IsAvailable() : bool
+
:{{CSharp|bool IsAvailable()}}
:PlayAnimation(DOMObject target, string animationName, bool looping) : bool
+
:{{CSharp|bool PlayAnimation(DOMObject target, string animationName, bool looping)}}
 
::Same as above, but for bots in a room rather than player avatars
 
::Same as above, but for bots in a room rather than player avatars
:StopAnimation(DOMObject target, string animationName) : bool
+
:{{CSharp|bool StopAnimation(DOMObject target, string animationName)}}
 
::Same as above, but for bots in a room rather than player avatars
 
::Same as above, but for bots in a room rather than player avatars
  
Line 179: Line 179:
 
===ConfirmationHandle (C# class: ConfirmationHandleExtended)===
 
===ConfirmationHandle (C# class: ConfirmationHandleExtended)===
 
====Properties====
 
====Properties====
:ID : Guid
+
:{{CSharp|Guid ID {get;}}}
:Title : string
+
:{{CSharp|string Title {get;}}}
:Description: string
+
:{{CSharp|string Description {get;}}}
:Buttons : string[]
+
:{{CSharp|string[] Buttons {get;}}}
 
::The list of button labels (eg: yes, no)
 
::The list of button labels (eg: yes, no)
:DefaultButton : int
+
:{{CSharp|int DefaultButton {get;}}}
 
::The zero-based index into Buttons which will be the default button
 
::The zero-based index into Buttons which will be the default button
:IsCompleted : bool
+
:{{CSharp|bool IsCompleted {get;}}}
 
::True if this confirmation request was cancelled or completed
 
::True if this confirmation request was cancelled or completed
:Success : bool
+
:{{CSharp|bool Success {get;}}}
 
::True if the user completed the confirmation request
 
::True if the user completed the confirmation request
:ButtonChoice : int
+
:{{CSharp|int ButtonChoice {get;}}}
 
::The zero-based index into Buttons which was chosen by the user
 
::The zero-based index into Buttons which was chosen by the user
:ReplyTimeout : int
+
:{{CSharp|int ReplyTimeout {get;}}}
 
::The time to wait for the users' reply in milliseconds. -1 to wait indefinitely.
 
::The time to wait for the users' reply in milliseconds. -1 to wait indefinitely.
:TimeRemaining : int
+
:{{CSharp|int TimeRemaining {get;}}}
 
::The time remaining of ReplyTimeout. This property will be -1 if ReplyTimeout is -1, and 0 if the time has expired.
 
::The time remaining of ReplyTimeout. This property will be -1 if ReplyTimeout is -1, and 0 if the time has expired.
 
====Events====
 
====Events====
:Cancelled()
+
:{{CSharp|Cancelled()}}
 
::Fires when the confirmation request has been cancelled (usually because the user logs off or navigates)
 
::Fires when the confirmation request has been cancelled (usually because the user logs off or navigates)
:Completed()
+
:{{CSharp|Completed()}}
 
::Fires when the confirmation request completes with success or failure
 
::Fires when the confirmation request completes with success or failure
 
====Methods====
 
====Methods====
:Cancel() : void
+
:{{CSharp|void Cancel()}}
 
::Cancels the confirmation request
 
::Cancels the confirmation request
:Complete(int buttonChoice) : void
+
:{{CSharp|void Complete(int buttonChoice)}}
 
::Simulates the completion of the confirmation request with a specified button choice.
 
::Simulates the completion of the confirmation request with a specified button choice.
  
 
===CloudCurrency (C# class: CloudCurrencyExtended)===
 
===CloudCurrency (C# class: CloudCurrencyExtended)===
 
====Properties====
 
====Properties====
:ID : Guid
+
:{{CSharp|Guid ID {get;}}}
:Identifier : string
+
:{{CSharp|string Identifier {get;}}}
 
====Methods====
 
====Methods====
:Transfer(Participant source, Participant target, float amount) : bool
+
:{{CSharp|bool Transfer(Participant source, Participant target, float amount)}}
 
::Same as Rays.Transfer except in this cloud currency
 
::Same as Rays.Transfer except in this cloud currency
:Collect(Participant source, float amount) : bool
+
:{{CSharp|bool Collect(Participant source, float amount)}}
 
::Same as Rays.Collect except in this cloud currency
 
::Same as Rays.Collect except in this cloud currency
:Payout(Participant target, float amount) : bool
+
:{{CSharp|bool Payout(Participant target, float amount)}}
 
::Same as Rays.Payout except in this cloud currency
 
::Same as Rays.Payout except in this cloud currency
:GetBalance(Participant target) : float
+
:{{CSharp|float GetBalance(Participant target)}}
 
::Same as Rays.GetBalance except in this cloud currency
 
::Same as Rays.GetBalance except in this cloud currency
  
 
===Participant (C# class: ParticipantExtended)===
 
===Participant (C# class: ParticipantExtended)===
 
====Events====
 
====Events====
:OnEntitiesChanged(Participant part)
+
:{{CSharp|OnEntitiesChanged(Participant part)}}
 
::Fires when a the participant’s connection’s entity list changes (i.e. the user joins or leaves a dynamic or entity group).
 
::Fires when a the participant’s connection’s entity list changes (i.e. the user joins or leaves a dynamic or entity group).
:OnAreaPermissionsChanged(Participant part)
+
:{{CSharp|OnAreaPermissionsChanged(Participant part)}}
 
::Fires when the permission set for this user changes due to changes in permission on the current instance, or any of it’s parent world or area group hierarchy, or due to entity set changes.
 
::Fires when the permission set for this user changes due to changes in permission on the current instance, or any of it’s parent world or area group hierarchy, or due to entity set changes.
:OnSceneReady(Participant part)
+
:{{CSharp|OnSceneReady(Participant part)}}
 
::Fires when the connected client informs the server that it has loaded all reasources, lowered it’s loading screen, and is ready to show the scene.
 
::Fires when the connected client informs the server that it has loaded all reasources, lowered it’s loading screen, and is ready to show the scene.
:OnTypingStarted(Participant part)
+
:{{CSharp|OnTypingStarted(Participant part)}}
 
::Fires when the connected client informs the server that the user has begun typing.
 
::Fires when the connected client informs the server that the user has begun typing.
:OnTypingStopped(Participant part)
+
:{{CSharp|OnTypingStopped(Participant part)}}
 
::Fires when the connected client informs the server that the user has stopped typing.
 
::Fires when the connected client informs the server that the user has stopped typing.
:OnTargetChanged(DOMObject newTarget, DOMObject oldTarget)
+
:{{CSharp|OnTargetChanged(DOMObject newTarget, DOMObject oldTarget)}}
 
::Fires when the connected client changed it’s targeted DOMObject.
 
::Fires when the connected client changed it’s targeted DOMObject.
:OnVirtualRealityStarted(Participant part)
+
:{{CSharp|OnVirtualRealityStarted(Participant part)}}
 
::Fires when the connected client informs the server that the user has turned on their VR headset.
 
::Fires when the connected client informs the server that the user has turned on their VR headset.
:OnVirtualRealityStopped(Participant part)
+
:{{CSharp|OnVirtualRealityStopped(Participant part)}}
 
::Fires when the connected client informs the server that the user has turned on their VR headset.
 
::Fires when the connected client informs the server that the user has turned on their VR headset.
:OnDisposed()
+
:{{CSharp|OnDisposed()}}
 
::Fires as the participant is cleaned up.
 
::Fires as the participant is cleaned up.
 
====Properties====
 
====Properties====
:Name : string
+
:{{CSharp|string Name {get;}}}
 
::Gets the participant’s persona’s name.
 
::Gets the participant’s persona’s name.
:Controller : DOMController
+
:{{CSharp|DOMController Controller {get;}}}
 
::Gets the root DOMController object that represents the participant’s avatar in the room. This will almost always be the only direct DOMController child of the participant document.
 
::Gets the root DOMController object that represents the participant’s avatar in the room. This will almost always be the only direct DOMController child of the participant document.
:AccountID : string
+
:{{CSharp|string AccountID {get;}}}
 
::Gets the account ID of the participant as a GUID in string format
 
::Gets the account ID of the participant as a GUID in string format
:PersonaID : string
+
:{{CSharp|string PersonaID {get;}}}
 
::Gets the persona ID of the participant as a GUID in string format
 
::Gets the persona ID of the participant as a GUID in string format
:SessionID : string
+
:{{CSharp|string SessionID {get;}}}
 
::Gets the session ID of the participant as a GUID in string format
 
::Gets the session ID of the participant as a GUID in string format
:Abilities : AbilitySet
+
:{{CSharp|AbilitySet Abilities {get;}}}
 
::Gets the ability set for this participant which can be used to create ability groups and abilities and modify their state
 
::Gets the ability set for this participant which can be used to create ability groups and abilities and modify their state
 
====Properties (from CreatureManager)====
 
====Properties (from CreatureManager)====
:CreatureType : string
+
:{{CSharp|string CreatureType {get;}}}
 
::Gets the creature type ID as a GUID in string format
 
::Gets the creature type ID as a GUID in string format
:IsMale : bool
+
:{{CSharp|bool IsMale {get;}}}
 
::Returns true if the participant’s creature type is male
 
::Returns true if the participant’s creature type is male
 
====Methods====
 
====Methods====
:InEntity(string id) : bool
+
:{{CSharp|bool InEntity(string id)}}
 
::Checks if this participant’s connection identity is in the requested entity (account, persona, entitygroup, dynamicgroup, etc)
 
::Checks if this participant’s connection identity is in the requested entity (account, persona, entitygroup, dynamicgroup, etc)
:HasAreaPermission(string id) : bool
+
:{{CSharp|bool HasAreaPermission(string id)}}
 
::Checks if this participant’s connection identity has the requested permission in the current area
 
::Checks if this participant’s connection identity has the requested permission in the current area
:ResetPosition() : void
+
:{{CSharp|void ResetPosition()}}
 
::Resets the user’s world position to their specified DOMStartPoint or the default DOMStartPoint or origin
 
::Resets the user’s world position to their specified DOMStartPoint or the default DOMStartPoint or origin
:SendUIScript(ResourceValue packageResource, string args) : bool
+
:{{CSharp|bool SendUIScript(ResourceValue packageResource, string args)}}
 
::Pushes the requested UI package to the connected client
 
::Pushes the requested UI package to the connected client
:NavigateTo(string vwwUrl, bool designMode = false) : bool
+
:{{CSharp|bool NavigateTo(string vwwUrl, bool designMode {{=}} false)}}
 
::Attempts to navigate the participant to another destination scene by vwwUrl and optionally in design mode
 
::Attempts to navigate the participant to another destination scene by vwwUrl and optionally in design mode
 
====Methods (from GameCloud)====
 
====Methods (from GameCloud)====
:SetData(string key, string value) : bool
+
:{{CSharp|bool SetData(string key, string value)}}
 
::Sets the value of a persona scoped data item.
 
::Sets the value of a persona scoped data item.
:GetData(string key) : string
+
:{{CSharp|string GetData(string key)}}
 
::Gets the value of a persona scoped data item.
 
::Gets the value of a persona scoped data item.
:DeleteData(string key) : bool
+
:{{CSharp|bool DeleteData(string key)}}
 
::Deletes the specified persona scoped data item.
 
::Deletes the specified persona scoped data item.
:SetAccountData(string key, string value) : bool
+
:{{CSharp|bool SetAccountData(string key, string value)}}
 
::Sets the value of an account scoped data item.
 
::Sets the value of an account scoped data item.
:GetAccountData(string key) : string
+
:{{CSharp|string GetAccountData(string key)}}
 
::Gets the value of an account scoped data item.
 
::Gets the value of an account scoped data item.
:DeleteAccountData(string key) : bool
+
:{{CSharp|bool DeleteAccountData(string key)}}
 
::Deletes the specified account scoped data item.
 
::Deletes the specified account scoped data item.
:GiveObject(string id) : bool
+
:{{CSharp|bool GiveObject(string id)}}
 
::Creates an ObjectTemplate of the ObjectType specified by the Guid in the id parameter and puts it in the participant’s persona’s inventory. Essentially, gives a person a thing, like clothing, or an object for scene editing.
 
::Creates an ObjectTemplate of the ObjectType specified by the Guid in the id parameter and puts it in the participant’s persona’s inventory. Essentially, gives a person a thing, like clothing, or an object for scene editing.
:ConfirmationRequest(string title, string description, string[] buttons, int defaultButton, int timeout) : ConfirmationHandle
+
:{{CSharp|ConfirmationHandle ConfirmationRequest(string title, string description, string[] buttons, int defaultButton, int timeout)}}
 
::Initiates a new Confirmation Request. The participant’s connection will be sent a packet asking them to confirm the activity described by title and description, by pressing one of the described buttons, with the defaultButton being a zero-based index into that list, with an optional timeout. Use -1 for infinite timeout. The confirmation will be automatically cancelled if the user disconnects or navigates.
 
::Initiates a new Confirmation Request. The participant’s connection will be sent a packet asking them to confirm the activity described by title and description, by pressing one of the described buttons, with the defaultButton being a zero-based index into that list, with an optional timeout. Use -1 for infinite timeout. The confirmation will be automatically cancelled if the user disconnects or navigates.
:SendUIScript(ResourceValue package, string arguments) : bool
+
:{{CSharp|bool SendUIScript(ResourceValue package, string arguments)}}
 
::Pushes a client UI script package to this participant.
 
::Pushes a client UI script package to this participant.
:NavigateTo(string vwwUrl, bool designMode = false) : bool
+
:{{CSharp|bool NavigateTo(string vwwUrl, bool designMode {{=}} false)}}
 
::Attempts to navigate the target participant to the specified VWW URL
 
::Attempts to navigate the target participant to the specified VWW URL
:JoinGroup(string groupIdentifier, bool accountLevel) : bool
+
:{{CSharp|bool JoinGroup(string groupIdentifier, bool accountLevel)}}
 
::Joins the participant to an EntityGroup which has been registered to your application via the admin GameCloud configuration tool
 
::Joins the participant to an EntityGroup which has been registered to your application via the admin GameCloud configuration tool
:LeaveGroup(string groupIdentifier, bool accountLevel) : bool
+
:{{CSharp|bool LeaveGroup(string groupIdentifier, bool accountLevel)}}
 
::Removes the participant from an EntityGroup which has been registered to your application via the admin GameCloud configuration tool
 
::Removes the participant from an EntityGroup which has been registered to your application via the admin GameCloud configuration tool
:CheckGroup(string groupIdentifier) : bool
+
:{{CSharp|bool CheckGroup(string groupIdentifier)}}
 
::Tests whether the participant is in the EntityGroup which has been registered to your application via the admin GameCloud configuration tool
 
::Tests whether the participant is in the EntityGroup which has been registered to your application via the admin GameCloud configuration tool
====Methods (from HumanAvatars)====
+
====Methods (from HumanAvatarManager)====
:EnableAbilityGroup(string identifier) : bool
+
:{{CSharp|bool EnableAbilityGroup(string identifier)}}
 
::Enables a group of abilities for the player. (eg, turning on dance moves when you enter the dance floor)
 
::Enables a group of abilities for the player. (eg, turning on dance moves when you enter the dance floor)
:DisableAbilityGroup(string identifier) : bool
+
:{{CSharp|bool DisableAbilityGroup(string identifier)}}
 
::Disables a group of abilities for the player. (eg, turning off dance moves when you leave the dance floor)
 
::Disables a group of abilities for the player. (eg, turning off dance moves when you leave the dance floor)
  
 
===AbilitySet (C# class: AbilitySetExtended)===
 
===AbilitySet (C# class: AbilitySetExtended)===
 
====Events====
 
====Events====
:OnDisposed()
+
:{{CSharp|OnDisposed()}}
 
::Fired when the ability set is destroyed.
 
::Fired when the ability set is destroyed.
:OnAbilityFired(Ability ability, Participant participant)
+
:{{CSharp|OnAbilityFired(Ability ability, Participant participant)}}
 
::Fires when the user fires an ability (usually by pressing a button on their quickbar).
 
::Fires when the user fires an ability (usually by pressing a button on their quickbar).
 
====Methods====
 
====Methods====
:Find(Guid id) : Ability | AbilityGroup
+
:{{CSharp|Ability Find(Guid id)}}
::Finds an ability or ability group by ID.
+
::Finds an Ability or AbilityGroup by ID.
:CreateGroup(string identifier, ResourceValue iconResource = null) : AbilityGroup
+
:{{CSharp|AbilityGroup CreateGroup(string identifier, ResourceValue iconResource {{=}} null)}}
 
::Creates a new ability group with an optional iconResource.
 
::Creates a new ability group with an optional iconResource.
  
 
===AbilityGroup (C# class: AbilityGroupExtended) (Inherits: Ability)===
 
===AbilityGroup (C# class: AbilityGroupExtended) (Inherits: Ability)===
 
====Events====
 
====Events====
:OnDisposed()
+
:{{CSharp|OnDisposed()}}
 
::Fired when the AbilityGroup  is destroyed.
 
::Fired when the AbilityGroup  is destroyed.
 
====Methods====
 
====Methods====
:CreateGroup(string identifier, ResourceValue iconResource = null) : AbilityGroup
+
:{{CSharp|AbilityGroup CreateGroup(string identifier, ResourceValue iconResource {{=}} null)}
 
::Creates a child ability group under this one.
 
::Creates a child ability group under this one.
:CreateAbility(string identifier, float cooldown = 0, ResourceValue iconResource = null) : Ability
+
:{{CSharp|Ability CreateAbility(string identifier, float cooldown {{=}} 0, ResourceValue iconResource {{=}} null)}}
 
::Creates a new ability with an optional cooldown and icon resource.
 
::Creates a new ability with an optional cooldown and icon resource.
:Remove() : void
+
:{{CSharp|void Remove()}}
 
::Removes the ability.
 
::Removes the ability.
  
 
===Ability (C# class: AbilityExtended)===
 
===Ability (C# class: AbilityExtended)===
 
====Events====
 
====Events====
:OnDisposed()
+
:{{CSharp|OnDisposed()}}
 
::Fired when the Ability is destroyed.
 
::Fired when the Ability is destroyed.
 
====Properties====
 
====Properties====
:ScriptCreated : bool
+
:{{CSharp|bool ScriptCreated {get;}}}
::True if the ability or ability group was created by javascript.
+
::True if the Ability or AbilityGroup was created by javascript.
:Identifier : string (readonly)
+
:{{CSharp|string Identifier {get;}}}
 
::The translatable identifier of the ability
 
::The translatable identifier of the ability
:Description : string (readonly)
+
:{{CSharp|string Description {get;}}}
 
::The description of the ability (not currently used)
 
::The description of the ability (not currently used)
:Enabled : bool
+
:{{CSharp|bool Enabled {get; set;}}}
 
::True if the ability is currently enabled. Note that setting an ability to enabled will make the change locally, but may not take effect if the ability is denied, or any of it’s parents are disabled or denied.
 
::True if the ability is currently enabled. Note that setting an ability to enabled will make the change locally, but may not take effect if the ability is denied, or any of it’s parents are disabled or denied.
:Denied : bool
+
:{{CSharp|bool Denied {get; set;}}}
 
::True if the ability or any of it’s parents are denied. Setting this value may have no effect until parents are un-denied (allowed).
 
::True if the ability or any of it’s parents are denied. Setting this value may have no effect until parents are un-denied (allowed).
:Active : bool
+
:{{CSharp|bool Active {get; set;}}}
 
::Marks an ability as active (in use). This is meant mainly for display purposes.
 
::Marks an ability as active (in use). This is meant mainly for display purposes.
:Cooldown : float (readonly)
+
:{{CSharp|float Cooldown {get;}}}
 
::True if the ability or any of it’s parents are denied. Setting this value may have no effect until parents are un-denied (allowed).
 
::True if the ability or any of it’s parents are denied. Setting this value may have no effect until parents are un-denied (allowed).
:CooldownProgress : float
+
:{{CSharp|float CooldownProgress {get;}}}
 
::A number between 0 and 1 representing the percentage of cooldown time elapsed since the ability was last set Active.
 
::A number between 0 and 1 representing the percentage of cooldown time elapsed since the ability was last set Active.
 
====Methods====
 
====Methods====
:Reset() : void
+
:{{CSharp|void Reset()}}
 
::Attempts to reset the ability (Enabled, not Denied, not Active)
 
::Attempts to reset the ability (Enabled, not Denied, not Active)
:Remove() : void
+
:{{CSharp|void Remove()}}
 
::Removes the ability.
 
::Removes the ability.
  

Revision as of 12:24, 4 October 2016

Contents

System Global Objects

These objects are created by the core, and are always available to server scripts. An instance of each can be accessed at the global scope. For example, a script can access DOM.Self to get a reference to the DOMScript node on which the script is running.

DOM (C# class: DOMFunctions)

Properties

DOMObject Self {get;}
Gets a reference to the DOMScript node which loaded the calling script.
DOMController Controller {get;}
Gets a reference to the DOMController node which represents the avatar in the persona document in which the calling script is running. If the calling script is running in a scene document, this property will be null.
DOMObject Document {get;}
Gets a reference to the DOMDocument under which this script is running. Same as DOM.Self.Document

Methods

DOMObject FindNode(int objectID)
Attempts to find a DOMObject by its ID in the same document in which the calling script is running.
DOMObject FindNodeInParticipants(int objectID)
Attempts to find a DOMObject by its ID in the entire participants container document (All persona documents).
DOMObject GetNodeByID(int objectID)
An alias for FindNode
DOMObject[] GetNodesByName(string name)
Finds DOMObjects with the given name inside the document in which the calling script is running.

Instance (C# class: InstanceExtended)

Properties

DOMDocument Document {get;}
Gets a reference to the DOMDocument at the root of the instance
DOMDocument Participants {get;}
Gets a reference to the DOMDocument that contains all participants
DOMDocument Scene {get;}
Gets a reference to the DOMDocument that contains the scene
string Title {get;}
Returns the title of the instance
string SceneTitle {get;}
Returns the title of the scene
bool DesignMode {get;}
Returns true of the instance is running in design mode
ViewInfo View {get;}
Returns the main view for the instance

Events

OnDisposed()
Fired when the instance shuts down
OnEnter(Participant user)
Fires when a new participant enters the room
OnLeave(bool user)
Fires when a participant leaves the room
OnLoad(bool restarting)
Fires for your script when the instance starts or you are reloaded
OnChildAdded(DOMObject obj)
Fires when a new node is added to the instance

Methods

ViewInfo AddView(string identifier)
Creates a new shared view (document) to which you can attach participants, and add nodes like in the scene document
ViewInfo FindView(string identifier)
Searches for a named shared view
Participant[] GetParticipants()
Returns an array of participants in the instance

System (C# class: SystemFunctions)

Methods

void Debug(string message)
An alias for Log.WriteDebug
void ServerLog(string message)
Writes a debug message to the server log system (as opposed to the script debug system)
Instance GetInstance()
Gets a reference to the Instance object representing the current “room” or instance in which the calling script is running.
int CreateTimer(function callback, int dueTime, int period)
Creates a timer which will fire once in dueTime milliseconds and then every period milliseconds. When the timer fires, it will call the specified JavaScript callback function. An integer handle to the timer is returned.
bool RemoveTimer(int timerID)
Removes a timer given a timer handle from CreateTimer.
bool BroadcastMessage(int channel, string message, DOMObject source)
Sends a JSScriptEVentMessage packet to all connected clients in the room. Client side UI script can process and respond to this message.
void ListenOnChannel(int channel, function callback)
Begins listening on a given script channel number and defines a JavaScript callback to call when a message arrives from another script.
void BroadcastOnChannel(int channel, string message, DOMObject source)
Sends a message on a given channel to all listening scripts. The message an source will be passed to the listening scripts’ callback function registered with ListenOnChannel. These messages are not delivered to connected clients.
DOMController FindController(DOMObject target)
If the target object is in a persona document, this method will return the document’s first DOMController.
DOMController FindParentController(DOMObject target)
Searches up the DOM tree from target looking for the first DOMController.
Participant FindParticipant(DOMObject target)
If the target object is in a persona document, this method will return the document’s first DOMController.
void CreateWebRequest(string requestType, string contentType, string url, function callback, string postData)
Requests data from the web at the given url. requestType should be GET or POST. If POST, the postData should contain the data to post. contentType is optional and can be null or empty. The callback will be called with two parameters: the response string data, and an integer http status code (200 = success).

Physics (C# class: PhysicsFunctions)

Methods

void CastSphere(Vector3 origin, Vector3 direction, float radius, float maxdistance)
Ask patrick
void FireProjectile(DOMTransform projectile, Vector3 origin, Vector3 direction, float speed, float maxdistance, bool usegravity)
Ask patrick
void PathTo(Vector3 position, float speed)
Ask patrick

Log (C# class: DebugLog)

Methods

void WriteVerbose(string message)
void WriteDebug(string message)
void WriteInfo(string message)
void WriteWarning(string message)
void WriteError(string message)
void WriteFatal(string message)
These methods write script debug messages to connected clients with LayerOne permissions

Chat (C# class: ChatChannelExtended.ChatFunctions)

Methods

ChatChannel GetLocalChannel()
Gets a reference to the general chat channel for the current instance.
ChatChannel CreateChannel(string displayName)
Creates a new named chat channel for use by the calling script.

Component Global Objects

These object templates are created by components, and are always available to server scripts as long as the associated component is installed. As with system global objects, an instance of each is created with the same name as the template and can be accessed at the global scope.

Rays (C# class: JSGlobalRays)

Methods

bool Transfer(Participant source, Participant target, float amount)
Transfers Rays currency between the two accounts represented by the source and target DOMObjects which must each belong to persona documents.
bool Collect(Participant source, float amount)
Takes the specified amount of Rays currency from the account represented by the source DOMObject which must belong to persona document.
bool Payout(Participant target, float amount)
Gives the specified amount of Rays currency to the account represented by the target DOMObject which must belong to persona document.
float GetBalance(Participant target)
Gets the balance in Rays of the account represented by the target DOMObject which must belong to persona document.

Adult (C# class: JSGlobalAdult)

Methods

EngagementControl CreateEngagement(DOMObject target, string startingState, bool autoDispose)
Begins an adult system engagement (shared animation state), using target as the focus or parent object of the engagement and beginning in the state specified by startingState. When autoDispose is true, the engagement will clean itself up when the number of participants falls below critical numbers (usually when the last participant leaves, but in some cases, like hugging, when any one person leaves).
EngagementControl GetEngagement(DOMObject target)
Tries to find an engagement control involving the DOMObject specified by target.

Cloud (C# class: JSGlobalCloud)

Methods

bool SetApplication(string applicationID)
Associates this script with an application (scope of data storage). A single call to this function is required before most other GameCloud functions will work. Simply pass a Guid as a string.
bool SetData(string key, string value)
Sets the value of an application-scoped data item. This is basic global application string data storage.
string GetData(string key)
Gets the value of an application scoped data item.
string DeleteData(string key)
Deletes the specified application scoped data item.
InteractionMapping RegisterInteraction(string selector, string abilityIdentifier, string groupIdentifier = null)
Wraps up the ViewInfo’s AddInteractionMapping and AddAbility methods into a single call. The abilityIdentifier is the name of a GameCloud registered ability (created in the admin). The groupIdentifier is the optional name of a GameCloud registered entity group used to filter who gets the interaction, and the selector is a CSS-Style selector which identifies nodes which are eligible targets of the interaction.
void SaveData()
Checkpoints your app data. Just in case.
CloudCurrency GetCurrency(string identifier, bool accountScoped)
Gets or creates a currency for use in your javascript applications. The returned object can be used to transact in this currency, and get balance of accounts.

HAM (C# class: JSGlobalHAM) (hosted by CreatureManager)

Methods

bool IsAvailable()
Returns true if the creature manager is installed.
bool SetAttachment(string attachmentName, DOMObject target, int attachID)
Obsolete
bool HasAttachment(strin attachmentName, DOMObject target)
Obsolete
bool ClearAttachment(string attachmentName, DOMObject target)
Obsolete

Avatar (C# class: JavascriptAvatar)

Methods

bool PlayAnimation(DOMObject target, string actionID, bool looping)
Triggers a HAM action item on the specified player, given its actionID as a Guid
bool StopAnimation(DOMObject target, string actionID)
Stops a HAM action from playing on the specified player given its actionID as a Guid

Bot (C# class: JavascriptBot)

Methods

bool IsAvailable()
bool PlayAnimation(DOMObject target, string animationName, bool looping)
Same as above, but for bots in a room rather than player avatars
bool StopAnimation(DOMObject target, string animationName)
Same as above, but for bots in a room rather than player avatars

Extended Objects

These object templates are defined, but only available to a script via a function call to one of the above global objects. Basically they’re JavaScript interfaces to C# objects which can be passed down into JavaScript as the result of a function call or as the parameter to an event or callback method.

ConfirmationHandle (C# class: ConfirmationHandleExtended)

Properties

Guid ID {get;}
string Title {get;}
string Description {get;}
string[] Buttons {get;}
The list of button labels (eg: yes, no)
int DefaultButton {get;}
The zero-based index into Buttons which will be the default button
bool IsCompleted {get;}
True if this confirmation request was cancelled or completed
bool Success {get;}
True if the user completed the confirmation request
int ButtonChoice {get;}
The zero-based index into Buttons which was chosen by the user
int ReplyTimeout {get;}
The time to wait for the users' reply in milliseconds. -1 to wait indefinitely.
int TimeRemaining {get;}
The time remaining of ReplyTimeout. This property will be -1 if ReplyTimeout is -1, and 0 if the time has expired.

Events

Cancelled()
Fires when the confirmation request has been cancelled (usually because the user logs off or navigates)
Completed()
Fires when the confirmation request completes with success or failure

Methods

void Cancel()
Cancels the confirmation request
void Complete(int buttonChoice)
Simulates the completion of the confirmation request with a specified button choice.

CloudCurrency (C# class: CloudCurrencyExtended)

Properties

Guid ID {get;}
string Identifier {get;}

Methods

bool Transfer(Participant source, Participant target, float amount)
Same as Rays.Transfer except in this cloud currency
bool Collect(Participant source, float amount)
Same as Rays.Collect except in this cloud currency
bool Payout(Participant target, float amount)
Same as Rays.Payout except in this cloud currency
float GetBalance(Participant target)
Same as Rays.GetBalance except in this cloud currency

Participant (C# class: ParticipantExtended)

Events

OnEntitiesChanged(Participant part)
Fires when a the participant’s connection’s entity list changes (i.e. the user joins or leaves a dynamic or entity group).
OnAreaPermissionsChanged(Participant part)
Fires when the permission set for this user changes due to changes in permission on the current instance, or any of it’s parent world or area group hierarchy, or due to entity set changes.
OnSceneReady(Participant part)
Fires when the connected client informs the server that it has loaded all reasources, lowered it’s loading screen, and is ready to show the scene.
OnTypingStarted(Participant part)
Fires when the connected client informs the server that the user has begun typing.
OnTypingStopped(Participant part)
Fires when the connected client informs the server that the user has stopped typing.
OnTargetChanged(DOMObject newTarget, DOMObject oldTarget)
Fires when the connected client changed it’s targeted DOMObject.
OnVirtualRealityStarted(Participant part)
Fires when the connected client informs the server that the user has turned on their VR headset.
OnVirtualRealityStopped(Participant part)
Fires when the connected client informs the server that the user has turned on their VR headset.
OnDisposed()
Fires as the participant is cleaned up.

Properties

string Name {get;}
Gets the participant’s persona’s name.
DOMController Controller {get;}
Gets the root DOMController object that represents the participant’s avatar in the room. This will almost always be the only direct DOMController child of the participant document.
string AccountID {get;}
Gets the account ID of the participant as a GUID in string format
string PersonaID {get;}
Gets the persona ID of the participant as a GUID in string format
string SessionID {get;}
Gets the session ID of the participant as a GUID in string format
AbilitySet Abilities {get;}
Gets the ability set for this participant which can be used to create ability groups and abilities and modify their state

Properties (from CreatureManager)

string CreatureType {get;}
Gets the creature type ID as a GUID in string format
bool IsMale {get;}
Returns true if the participant’s creature type is male

Methods

bool InEntity(string id)
Checks if this participant’s connection identity is in the requested entity (account, persona, entitygroup, dynamicgroup, etc)
bool HasAreaPermission(string id)
Checks if this participant’s connection identity has the requested permission in the current area
void ResetPosition()
Resets the user’s world position to their specified DOMStartPoint or the default DOMStartPoint or origin
bool SendUIScript(ResourceValue packageResource, string args)
Pushes the requested UI package to the connected client
bool NavigateTo(string vwwUrl, bool designMode = false)
Attempts to navigate the participant to another destination scene by vwwUrl and optionally in design mode

Methods (from GameCloud)

bool SetData(string key, string value)
Sets the value of a persona scoped data item.
string GetData(string key)
Gets the value of a persona scoped data item.
bool DeleteData(string key)
Deletes the specified persona scoped data item.
bool SetAccountData(string key, string value)
Sets the value of an account scoped data item.
string GetAccountData(string key)
Gets the value of an account scoped data item.
bool DeleteAccountData(string key)
Deletes the specified account scoped data item.
bool GiveObject(string id)
Creates an ObjectTemplate of the ObjectType specified by the Guid in the id parameter and puts it in the participant’s persona’s inventory. Essentially, gives a person a thing, like clothing, or an object for scene editing.
ConfirmationHandle ConfirmationRequest(string title, string description, string[] buttons, int defaultButton, int timeout)
Initiates a new Confirmation Request. The participant’s connection will be sent a packet asking them to confirm the activity described by title and description, by pressing one of the described buttons, with the defaultButton being a zero-based index into that list, with an optional timeout. Use -1 for infinite timeout. The confirmation will be automatically cancelled if the user disconnects or navigates.
bool SendUIScript(ResourceValue package, string arguments)
Pushes a client UI script package to this participant.
bool NavigateTo(string vwwUrl, bool designMode = false)
Attempts to navigate the target participant to the specified VWW URL
bool JoinGroup(string groupIdentifier, bool accountLevel)
Joins the participant to an EntityGroup which has been registered to your application via the admin GameCloud configuration tool
bool LeaveGroup(string groupIdentifier, bool accountLevel)
Removes the participant from an EntityGroup which has been registered to your application via the admin GameCloud configuration tool
bool CheckGroup(string groupIdentifier)
Tests whether the participant is in the EntityGroup which has been registered to your application via the admin GameCloud configuration tool

Methods (from HumanAvatarManager)

bool EnableAbilityGroup(string identifier)
Enables a group of abilities for the player. (eg, turning on dance moves when you enter the dance floor)
bool DisableAbilityGroup(string identifier)
Disables a group of abilities for the player. (eg, turning off dance moves when you leave the dance floor)

AbilitySet (C# class: AbilitySetExtended)

Events

OnDisposed()
Fired when the ability set is destroyed.
OnAbilityFired(Ability ability, Participant participant)
Fires when the user fires an ability (usually by pressing a button on their quickbar).

Methods

Ability Find(Guid id)
Finds an Ability or AbilityGroup by ID.
AbilityGroup CreateGroup(string identifier, ResourceValue iconResource = null)
Creates a new ability group with an optional iconResource.

AbilityGroup (C# class: AbilityGroupExtended) (Inherits: Ability)

Events

OnDisposed()
Fired when the AbilityGroup is destroyed.

Methods

{{CSharp|AbilityGroup CreateGroup(string identifier, ResourceValue iconResource = null)}
Creates a child ability group under this one.
Ability CreateAbility(string identifier, float cooldown = 0, ResourceValue iconResource = null)
Creates a new ability with an optional cooldown and icon resource.
void Remove()
Removes the ability.

Ability (C# class: AbilityExtended)

Events

OnDisposed()
Fired when the Ability is destroyed.

Properties

bool ScriptCreated {get;}
True if the Ability or AbilityGroup was created by javascript.
string Identifier {get;}
The translatable identifier of the ability
string Description {get;}
The description of the ability (not currently used)
bool Enabled {get; set;}
True if the ability is currently enabled. Note that setting an ability to enabled will make the change locally, but may not take effect if the ability is denied, or any of it’s parents are disabled or denied.
bool Denied {get; set;}
True if the ability or any of it’s parents are denied. Setting this value may have no effect until parents are un-denied (allowed).
bool Active {get; set;}
Marks an ability as active (in use). This is meant mainly for display purposes.
float Cooldown {get;}
True if the ability or any of it’s parents are denied. Setting this value may have no effect until parents are un-denied (allowed).
float CooldownProgress {get;}
A number between 0 and 1 representing the percentage of cooldown time elapsed since the ability was last set Active.

Methods

void Reset()
Attempts to reset the ability (Enabled, not Denied, not Active)
void Remove()
Removes the ability.

ChatChannel (C# class: ChatChannelExtended)

Events

OnDisposed()
Fired when the channel is destroyed.
OnJoin(Participant participant)
Fired when a new participant enters the channel.
OnLeave(Participant participant)
Fired when a participant leaves the channel.
OnMessage(Participant participant, ChatMessageEventArgs message)
Fired when a message is sent in the channel.

Methods

Join(Participant participant) : bool
Add a participant to the channel.
Leave(Participant participant) : bool
Remove a participant from the channel.
Close() : void
Closes (Disposes) a channel.
Broadcast(string message, int messageStyle = 253) : void
Sends a message to all participants of a channel. By default, the message style is 253 (System)
SendMessageTo(Participant participant, string message, int messageStyle) : void
Sends a message to a single participant of a channel. By default, the message style is 253 (System)
GetParticipants() : Participant[]
Gets the participants of the channel

ChatMessageEventArgs (C# class: ChatMessageEventArgsExtended)

Properties

Message : string
The text of the message.
Source : Participant
The participant representing the sender of the message. Or null if it’s a system message.

ViewInfo (C# class: ViewExtended)

Events

OnEnter(Participant who)
Fired when a participant in an engagement uses one of their abilities
OnInteraction(Participant who, DOMObject target, Guid abilityID, object value)
Fired when a participant executes an interaction.
OnLeave(Participant who)
Fired when a participant in an engagement uses one of their abilities

Properties

ViewID : long
The unique ID of the view

Methods

AddInteraction(string selector, Guid abilityID, Guid entityID = null) : InteractionMapping
Add a participant to the shared view.
AddAbility (string identifier, string initialMetadata, float? cooldown = null, Guid? entityID = null) : ViewAbility
Creates a new view-local ability which will be automatically delivered to participants when they join the view. This ability is mean to be used by AddInteraction.
Join(Participant participant) : bool
Add a participant to the shared view.
Leave(Participant participant) : bool
Remove a participant from the shared view.
Release() : bool
Destroys the shared view.

InteractionMapping (C# class: InteractionMappingExtended)

Events

OnInteraction(Participant who, DOMObject target, Guid abilityID, object value)
Fired when a participant executes an interaction.

Properties

Selector : string (readonly)
The CSS-style selector string used to select possible target objects for an this interaction
AbilityID : Guid (readonly)
The ID of the ability bound to this mapping as an interaction
EntityID : Guid (readonly)
The optional ID of an entity to which a participant must belong to get this interaction

Methods

Release() : bool
Destroys the interaction mapping

ViewAbility (C# class: ViewAbilityExtended)

Properties

AbilityID : Guid (readonly)
The ID of the ability bound to this mapping as an interaction
EntityID : Guid (readonly)
The optional ID of an entity to which a participant must belong to get this interaction
Identifier : string (readonly)
The identifier of the ability (used for language translation)
Cooldown : float (readonly)
The cooldown timer for the ability. 0 if there is none.
InitialMetadata : string (readonly)
The initial metadata attached to the participant’s ability when it’s created.

Methods

Release() : bool
Destroys the view ability

EngagementControl (C# class: EngagementControlExtended)

Events

AbilityFired(Participant who, string identifier)
Fired when a participant in an engagement uses one of their abilities
StateChanged(string identifier)
Fired when the state of the angagement changes, and passes in the new state identifier
PlayerAdded(int who)
Fired when a new player is added to an engagement. ‘who’ is the ID of the controller of the new player, which may be a participant or a bot.
PlayerRemoved(int who)
Fired when a new player is added to an engagement. ‘who’ is the ID of the controller of the new player, which may be a participant or a bot.
OnDisposed()
Fired when this engagement control is shutting down

Properties

IsValid : bool
Ask dirk

Methods

Close() : void
Disposes this engagement control.
IsPlayerEngaged(DOMObject who) : bool
Tests if the player represented by the DOMObject is in this engagement.
AddPlayer(DOMObject who) : bool
Adds a player represented by the DOMObject to this engagement.
RemovePlayer(DOMObject who, bool restoreAnimator) : bool
Removes a player represented by the DOMObject from this engagement.
SetOptions(Vector3 position, Vector3 rotation)
Ask dirk. Looks like it sets the offset and rotation of the players from center of the target object of the engagement.

DOMObject (C# class: DOMObjectExtended)

Events

OnDisposed()
Fires when a DOMObject is being destroyed, usually because it’s being removed from the DOM.
OnSelect(Participant who, DOMObject source)
Fires when a user selects an object in world. Who is the Participant doing the selecting.
OnDeselect(Participant who, DOMObject source)
Fires when a user deselects an object in world. Who is Participant doing the deselecting.
OnTarget(Participant who, DOMObject source)
Fires when a user targets an object in world. Who is the Participant doing the targeting.
OnUnTarget(Participant who, DOMObject source)
Fires when a user un-targets an object in world. Who is the Participant doing the un-targeting.

Properties

Class : string (via attribution)
A space separated list of class names which are used by CSS-style selectors to match this node
Document : DOMDocument (readonly)
Gets a reference to the DOMDocument in which this DOMObject resides.
DocumentTitle : string (readonly)
A shortcut equivilant to DOMObject.Document.Title.
Enabled : bool (via attribution)
Indicates whether the client should carry out the effects of this object or it’s children. A disabled node tree should have no effect on the scene
ID : long (readonly) (via attribution)
The unique ID of the object in it’s current DOM tree
IsTemporary : bool (readonly) (via attribution)
An object marked as temporary will not be saved when the DOM is serialized for storage. Objects created by scripts are marked as temprary by default
IsTransient : bool (readonly) (via attribution)
An object marked as transient be sent to connected clients but will not be saved in the DOM.
IsTypeRoot : bool (readonly) (via attribution)
True if this node is the root node of an instantiated object type.
LocalProperties : DOMProperties (readonly)
Gets a DOMProperties object representing the properties of this object which are NOT send over the network.
Title : string (via attribution)
The title of the DOM node. Visible in curiosity.
Type : string (readonly)
A string version of this object’s type’s name, for derived objects, this will return the name of the derived object, so DOMRenderable.Type returns “DOMRenderable”
Parent : DOMObject (readonly)
Gets a reference to the DOMObject directly parenting this one.
Properties : DOMProperties (readonly)
Gets a DOMProperties object representing the properties of this object visible to all viewers of the DOM. Changes to these properties ARE sent over the network.
ProtectionFlags : int (readonly) (via attribution)
A bitfield specifying what sorts of operations are not allowed on this object. 1 = Delete, 2 = Move, 4 = Add (child), 8 = Remove (child), 16 = Change (properties)
Visible : bool (via attribution)
An object marked as not visible will not be delivered to connected clients or will be removed if it already has been. Usefull for hiding a tree from clients until it’s ready to be displayed.

Methods

AddClass(string className) : void
Adds a class name to the space separated list of class names found on the Class property of this DOMObject.
Clone(DOMObject newParent) : DOMObject
Clones this object and places it as a direct child of the specified parent object
CreateEmptyNode(bool visible) : DOMTransform
Creates a simple DOMTransform object, optionally initially invisible, as a direct child of this object.
CreateHookpoint(string title, bool visible) : DOMObject
Creates a simple DOMHookpoint object, optionally initially invisible, as a direct child of this object.
CreateLight(int color, float intensity, int shadowtype, float shadowstrength, Vector3 position, Vector3 rotation) : DOMLight
Creates a DOMLight object as a direct child of this object with the specified properties already set.
CreateNode(string templateID, bool visible) : DOMObject
Creates an instance of the specified ObjectTemplate given its GUID templateID, optionally initially invisible, as a direct child of this object.
CreateTitleNode(string title, int index, bool visible) : DOMObject
Creates a simple DOMTitle object, optionally initially invisible, as a direct child of this object.
DeleteNode() : bool
Removes this node from the DOM.
GetChildren() : DOMObject[]
Gets all direct children.
FindController() : DOMController
Returns the first child DOMController object found in the document in which this object is a member, as long as that document is a persona document (essentially finds the root of an avatar starting from some other object in the avatar’s document). Not so good for finding bot controllers.
FindNode(string name) : DOMObject
Find the first child node (recursive, deep search) with the specified name;
FindNodes(string name) : DOMObject[]
Finds child nodes (recursive, deep search) with the specified name;
FindParentController() : DOMController
Searches up the tree for the first DOMController. Better for finding bot controllers.
GetAttributeValue(string attributeName) : object
Looks for an attribute with the given name and returns its value. Attributes are like special properties placed on the DOM nodes and properties when they appear in an ObjectType definition. An ObjectType is a container for a small snippet of DOM which can be re-used at runtime to create instances of that same layout and inject it into a running document. Attributes placed on these object or properties can later be accessed on any instance of these objects or properties. Think of these like metadata “about” an object or property, rather than data describing the object instance itself.
HasAttribute(string attributeName) : bool
Checks to see if a given attribute exists on this object.
HasClass(string className) : void
Tasts if the specified class name is found in the space separated list of class names found on the Class property of this DOMObject.
ListenOnChannel(int channelID, function callback) : void
Starts listening for messages sent to this object from other scripts, or from client UI scripts. Callback will be called with (int channelID, string message, DOMObject source, DOMObject dest) describing the message. This is similar to System.ListenOnChannel but listens only for messages sent directly to this object.
MatchesSelector(string selector) : bool
Parses the specified CSS-style selector string and then tests itself (the current node) for a match.
QuerySelectorAll(string selector) : DOMObject[]
Parses the specified CSS-style selector string and then queries the DOM from this node down, looking for objects that match. Returns an array of found objects.
QuerySelector(string selector) : DOMObject
Parses the specified CSS-style selector string and then queries the DOM from this node down, looking for objects that match. Returns the first found object.
ReloadScript() : void
If this object is a DOMScript node, causes the script associated with it to reload. This should be moved onto a DOMScriptExtended at some point.
RemoveClass(string className) : void
Removes a class name from the space separated list of class names found on the Class property of this DOMObject.
SendMessage(int channel, string message, DOMObject source) : bool
Sends a message on the specified script communication channel given another object as the source. Someone else having previously used ListenOnChannel could receive this message to their callback function.
ToggleClass(string className) : void
Toggles a class name in the space separated list of class names found on the Class property of this DOMObject.

DOMTransform (C# class: DOMTransformExtended) (Inherits DOMObject)

Properties

AttachToBone : string (via attribution)
When this transform is under a renderable with a skeleton, it’s transform is further modified by the current animated position of a bone in the renderable’s skeleton as well as the transform of the parent renderable itself
IsClickable : bool (via attribution)
Allows an object to receive client click events.
IsSelectable : bool (via attribution)
Allows an object to be selected.
IsTargetable : bool (via attribution)
Allows an object to be the users target.
ToolTip : string (via attribution)
Specifies a tool tip to display when the user hovers their pointer over this object.
ToolTipTitle : string (via attribution)
For large-style tool tips, allows for a title displayed over the tool main tip text
ToolTipIcon : ResourceUri (via attribution)
For large-style tool tips, allows for an icon displayed beside the main tip text
TransformParent : DOMTransform
Gets a reference to this object’s DOMTransform parent, if it has been set to something other than normal node hierarchy.
TransformParentID : int (via attribution)
The ID of the node of the specified TransformParent
X : float (via attribution)
Gets or sets the X component of the transform’s position
Y : float (via attribution)
Gets or sets the Y component of the transform’s position
Z : float (via attribution)
Gets or sets the Z component of the transform’s position
RX : float (via attribution)
Gets or sets the X component of the transform’s rotation
RY : float (via attribution)
Gets or sets the Y component of the transform’s rotation
RZ : float (via attribution)
Gets or sets the Z component of the transform’s rotation
SX : float (via attribution)
Gets or sets the X component of the transform’s scale
SY : float (via attribution)
Gets or sets the Y component of the transform’s scale
SZ : float (via attribution)
Gets or sets the Z component of the transform’s scale

Events

OnClick(Participant who, DOMObject source)
Fires when a user clicks an object in world. Who is the Participant doing the clicking.
OnRightClick(Participant who, DOMObject source)
Fires when a user right-clicks an object in world. Who is the Participant doing the right-clicking.

Methods

MoveTo(float x, float y, float z, float speed) : bool
Moves this object smoothly, and linearly to the specified x,y,z location over time specified by speed. This is accomplished using a child DOMInterpolation node.
MoveToWithCallback(float x, float y, float z, float speed, function callback) : bool
Same as above, but requests a callback when the operation completes.
PhysicsSpawn(float radius, bool stack) : DOMPhysics
Creates a DOMPhysics node as a direct child of this node requesting the Spawn operation and given the specified parameters. The returned DOMPhysics node can be used to start / stop the operation and monitor for its completion.
PhysicsPathTo(float targetX, float targetY, float targetZ, float speed) :: DOMPhysics
Creates a DOMPhysics node as a direct child of this node requesting the PathTo operation and given the specified parameters. The returned DOMPhysics node can be used to start / stop the operation and monitor for its completion.
PhysicsPathToVector(Vector3 target, float speed) : DOMPhysics
Creates a DOMPhysics node as a direct child of this node requesting the PathToVector operation and given the specified parameters. The returned DOMPhysics node can be used to start / stop the operation and monitor for its completion.
PhysicsFollow(DOMTransform target, float minDistance, float, maxDistance) : DOMPhysics
Creates a DOMPhysics node as a direct child of this node requesting the Follow operation and given the specified parameters. The returned DOMPhysics node can be used to start / stop the operation and monitor for its completion.
PhysicsProjectile(float directionX, float directionY, float directionZ, float speed, bool gravity, float maxDistance) : DOMPhysics
Creates a DOMPhysics node as a direct child of this node requesting the Projectile operation and given the specified parameters. The returned DOMPhysics node can be used to start / stop the operation and monitor for its completion.
PhysicsProjectileVector(Vector3 direction, float speed, bool gravity, float maxDistance) : DOMPhysics
Creates a DOMPhysics node as a direct child of this node requesting the ProjectileVector operation and given the specified parameters. The returned DOMPhysics node can be used to start / stop the operation and monitor for its completion.
ResetTransformParent(bool restoreLastPosition) : void
Resets this object’s transform parent reference to null so that it behaves normaly, transforming relative to the next DOMTransform up the hierarchy.
SetPosition(float x, float y, float z) : void
Sets the position (transform) of this object from its next parent DOMTransform or from world origin (0,0,0).
SetRotation(float x, float y, float z) : void
Sets the rotation of this object relative to its next parent DOMTransform or from (0,0,0)
SetScale(float x, float y, float z) : void
Sets the scale of this object relative to its next parent DOMTransform or from (1,1,1)
SetTransformParent(DOMTransform target, Vector3 position, Vector3 rotation, Vector3 scale) : void
Sets this objects transform parent reference to the specified DOMTransform preventing it from transforming relative to the next DOMTransform up the hierarchy, but rather, the specified object instead. Sets the position, rotation, and scale to new values along with the transform parent change as a single atomic operation.

DOMRenderable (C# class: DOMRenderableExtended) (Inherits DOMTransform)

Properties

AnimationName : string (via attribution)
The name of an animation to play
CamPassable : bool (via attribution)
Specifies that this object allow the camera to pass through it
CastShadows : bool (via attribution)
Specifies that this object should cast shadows onto surrounding geometry
InteractionDistance : int (via attribution)
The distance in worldspace units beyond which the user should not be able to interact with the object (see tool tips, respond to clicks, etc)
LightProbes : bool (via attribution)
Specifies that this object should use light probe information in it’s lighting calculations
PhysicsEnabled : bool (via attribution)
Specifies that physics is enabled for this object
ReceiveShadows : bool (via attribution)
Specifies that this object should receive shadows from surrounding geometry

Methods

SetClickable(bool clickable) : void
Apparently sets property #Clickable
EnablePhysics(bool enabled) : void
Apparently sets property #Physics

DOMController (C# class: DOMControllerExtended) (Inherits DOMRenderable)

Properties

AnimationController : DOMAnimationController
Returns the DOMAnimationController that this controller should use for animation. If none is specified an immediate child DOMAnimationController will be used instead.
AnimationController ID : int (via attribution)
The ID of the node of the specified AnimationController override.
ActiveController : DOMController
Returns the DOMController that this controller should use to overide control. If none is specified this DOMController controls itself.
ActiveControllerID : int (via attribution)
The ID of the node of the specified ActiveController override.
BlendshapeTypeNodeID : int (via attribution)
No idea what this does.
Direction : int (readonly) (via attribution)
The direction the avatar is pointing in degrees.
IsParticipant : bool (readonly)
Returns true if this object is in a persona document.
LookAt : DOMTransform
Returns the DOMTransform object that this controller should try to “look at” if any
LookAtID : int (via attribution)
The ID of the node of the specified LookAt target
LookAtBone : string (via attribution)
Gets or sets the name of the bone in the LookAt target to fine-tune the looking.
Participant : Participant (readonly)
Returns the Participant object associated with the persona document in which this controller resides.
ParticipantID : int (readonly) (via attribution)
When in a multiplayer engagement, specifies the participant (slot) ID (OMG… why is this here and why is it named so ambiguously close to Participant which has a really different meaning!)
PositionLocked : bool (readonly) (via attribution)
Specifies whether the controller is allowed to move.
Running : int (readonly) (via attribution)
Indicates the controller’s running speed.
Speed : float (readonly) (via attribution)
The speed the avatar is moving in units per second.

Methods

LockPosition(bool locked) : void
Position locks this object so it can’t move or be controlled to move. Useful for playing animations where locked position is necessary.
SetAnimationInt(string name, int value) : bool
Sets the specified name and integer value of a property on the first child animation controller. This is super cheesy and should be replaced.
StartAnimation(string layerName, string animKey, bool looping, int timeOffset) : bool
Creates a DOMAnimation node and puts it on the specified DOMAnimationLayer. This function is in the wrong place. Should be on DOMController
StartLookAt(DOMTransform target, string boneName) : bool
Sets the LookAt and BoneName properties in a single update
StopAnimation(string layerName, string animKey) : bool
Stops an animation from playing.
StopAnimationLayer(string layerName) : bool
Stops all animations on the specified animation layer from playing.
StopLookAt() : bool
Clears the LookAt and BoneName properties in a single update

DOMAnimation (C# class: DOMAnimationExtended) (Inherits DOMObject)

DOMPhysics (C# class: DOMPhysicsExtended) (Inherits DOMObject)

Events

OnComplete()
Fires when the physics host says the physics operation represented by this object has been completed.

Methods

Start() : void
Asks the physics host to start carrying out the physics operation represented by this object.
Stop() : void
Asks the physics host to stop carrying out the physics operation represented by this object.

DOMVolume (C# class: DOMVolumeExtended) (Inherits DOMTransform)

Events

OnEnter(Participant who, DOMObject source)
Fires when a user enters an DOMVolume in world. Who is the Participant doing the entering.
OnLeave(Participant who, DOMObject source)
Fires when a user leaves an DOMVolume in world. Who is the Participant doing the entering.

DOMProperties (C# class: DOMPropertiesExtended)

Methods

GetAttributeValue(string propertyName, string attributeName) : object
Gets the value of an attribute placed on the specified property. Attributes are like special properties placed on the DOM nodes and properties when they appear in an ObjectType definition. An ObjectType is a container for a small snippet of DOM which can be re-used at runtime to create instances of that same layout and inject it into a running document. Attributes placed on these object or properties can later be accessed on any instance of these objects or properties. Think of these like metadata “about” an object or property, rather than data describing the object instance itself.
HasAttribute(string propertyName, string attributeName) : bool
Checks if the specified property has the specified attribute defined.
WithAttribute(string attributeName) : string[]
Gets the name of all properties with the given attribute defined.
SetInt32(string propertyName, int value, bool silent = false, bool persist = false)  : bool
SetInt64(string propertyName, int value, bool silent = false, bool persist = false)  : bool
SetInt64(string propertyName, int value, bool silent = false, bool persist = false)  : bool
SetSingle(string propertyName, float value, bool silent = false, bool persist = false)  : bool
SetGuid(string propertyName, string value, bool silent = false, bool persist = false)  : bool
SetString(string propertyName, string value, bool silent = false, bool persist = false)  : bool
SetBoolean(string propertyName, bool value, bool silent = false, bool persist = false)  : bool
SetInt32Array(string propertyName, string JSONValue, bool silent = false, bool persist = false)  : bool
SetStringArray(string propertyName, string JSONValue, bool silent = false, bool persist = false)  : bool
SetColor(string propertyName, int value, bool silent = false, bool persist = false)  : bool
SetPoint3D(string propertyName, Vector3 value, bool silent = false, bool persist = false)  : bool
All of these functions set the value of a property in a type-safe manner.
RemoveProperty(string propertyName)
Removes the specified property.
GetProperty(string propertyName) : ProtoValue
GetInt32(string propertyName) : int
GetSingle(string propertyName) : float
GetGuid(string propertyName) : string
GetBoolean(string propertyName) : bool
GetString(string propertyName) : string
GetColor(string propertyName) : Color32
GetPoint3D(string propertyName) : Point3D
All of these functions get the value of a property in a type-safe manner.
AddWatcher(string propertyName, function callback) : void
Begins watching for changes to a property, specifying a callback to be invoked when the property changes.
RemoveWatcher(string propertyName) : void
Stops watching for changes to the specified property.