Difference between revisions of "World Scripting Reference"

From Virtual World Web Wiki
Jump to: navigation, search
m (Spark5 moved page Server Scripting to World Scripting Reference without leaving a redirect)
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
<div style="float: right; margin-left: 2em;">__TOC__</div>
 +
 
This page is part of the [[Infrastructure Guide]]. Here we'll describe the various objects you'll work with from in the server JavaScript scripting environment, as well as provide step by step instructions to help you create your first server script, and examples of working scripts you can use on your server.
 
This page is part of the [[Infrastructure Guide]]. Here we'll describe the various objects you'll work with from in the server JavaScript scripting environment, as well as provide step by step instructions to help you create your first server script, and examples of working scripts you can use on your server.
  
Line 7: Line 9:
 
TODO: make a table of script examples with the link in the first column, and a quick description in the second. The links can go to pages with the full source
 
TODO: make a table of script examples with the link in the first column, and a quick description in the second. The links can go to pages with the full source
  
==System Global Objects==
+
==JavaScript Server Globals==
 
+
{{:JavaScript Server Globals}}
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 <code>DOM.Self</code> to get a reference to the DOMScript node on which the script is running.
+
==JavaScript Server Objects==
 
+
{{:JavaScript Server Objects}}
===DOM (C# class: DOMFunctions)===
+
==JavaScript Component Globals==
* '''C# class DOMFunctions'''
+
{{:JavaScript Component Globals}}
====Properties====
+
==JavaScript Component Objects==
:{{CSharp|DOMObject Self {get;} }}
+
{{:JavaScript Component Objects}}
::Gets a reference to the DOMScript node which loaded the calling script.
+
==JavaScript DOM Nodes==
:{{CSharp|DOMController Controller {get;} }}
+
{{:JavaScript DOM Nodes}}
::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.
+
:{{CSharp|DOMObject Document {get;} }}
+
::Gets a reference to the DOMDocument under which this script is running. Same as DOM.Self.Document
+
====Methods====
+
:{{CSharp|DOMObject FindNode(int objectID)}}
+
::Attempts to find a DOMObject by its ID in the same document in which the calling script is running.
+
:{{CSharp|DOMObject FindNodeInParticipants(int objectID)}}
+
::Attempts to find a DOMObject by its ID in the entire participants container document (All persona documents).
+
:{{CSharp|DOMObject GetNodeByID(int objectID)}}
+
::An alias for FindNode
+
:{{CSharp|DOMObject[] GetNodesByName(string name)}}
+
::Finds DOMObjects with the given name inside the document in which the calling script is running.
+
 
+
===Instance (C# class: InstanceExtended)===
+
* '''C# class InstanceExtended'''
+
====Properties====
+
:{{CSharp|DOMDocument Document {get;} }}
+
::Gets a reference to the DOMDocument at the root of the instance
+
:{{CSharp|DOMDocument Participants {get;} }}
+
::Gets a reference to the DOMDocument that contains all participants
+
:{{CSharp|DOMDocument Scene {get;} }}
+
::Gets a reference to the DOMDocument that contains the scene
+
:{{CSharp|string Title {get;} }}
+
::Returns the title of the instance
+
:{{CSharp|string SceneTitle {get;} }}
+
::Returns the title of the scene
+
:{{CSharp|bool DesignMode {get;} }}
+
::Returns true of the instance is running in design mode
+
:{{CSharp|ViewInfo View {get;} }}
+
::Returns the main view for the instance
+
====Events====
+
:{{CSharp|OnDisposed()}}
+
::Fired when the instance shuts down
+
:{{CSharp|OnEnter(Participant user)}}
+
::Fires when a new participant enters the room
+
:{{CSharp|OnLeave(bool user)}}
+
::Fires when a participant leaves the room
+
:{{CSharp|OnLoad(bool restarting)}}
+
::Fires for your script when the instance starts or you are reloaded
+
:{{CSharp|OnChildAdded(DOMObject obj)}}
+
::Fires when a new node is added to the instance
+
====Methods====
+
:{{CSharp|ViewInfo AddView(string identifier)}}
+
::Creates a new shared view (document) to which you can attach participants, and add nodes like in the scene document
+
:{{CSharp|ViewInfo FindView(string identifier)}}
+
::Searches for a named shared view
+
:{{CSharp|Participant[] GetParticipants()}}
+
::Returns an array of participants in the instance
+
 
+
===System (C# class: SystemFunctions)===
+
* '''C# class SystemFunctions'''
+
====Methods====
+
:{{CSharp|void Debug(string message)}}
+
::An alias for Log.WriteDebug
+
:{{CSharp|void ServerLog(string message)}}
+
::Writes a debug message to the server log system (as opposed to the script debug system)
+
:{{CSharp|Instance GetInstance()}}
+
::Gets a reference to the Instance object representing the current “room” or instance in which the calling script is running.
+
:{{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.
+
:{{CSharp|bool RemoveTimer(int timerID)}}
+
::Removes a timer given a timer handle from CreateTimer.
+
:{{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.
+
:{{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.
+
:{{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.
+
:{{CSharp|DOMController FindController(DOMObject target)}}
+
::If the target object is in a persona document, this method will return the document’s first DOMController.
+
:{{CSharp|DOMController FindParentController(DOMObject target)}}
+
::Searches up the DOM tree from target looking for the first DOMController.
+
:{{CSharp|Participant FindParticipant(DOMObject target)}}
+
::If the target object is in a persona document, this method will return the document’s first DOMController.
+
:{{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).
+
 
+
===Physics===
+
* '''C# class PhysicsFunctions'''
+
====Methods====
+
:{{CSharp|void CastSphere(Vector3 origin, Vector3 direction, float radius, float maxdistance)}}
+
::Ask patrick
+
:{{CSharp|void FireProjectile(DOMTransform projectile, Vector3 origin, Vector3 direction, float speed, float maxdistance, bool usegravity)}}
+
::Ask patrick
+
:{{CSharp|void PathTo(Vector3 position, float speed)}}
+
::Ask patrick
+
 
+
===Log===
+
* '''C# class DebugLog'''
+
====Methods====
+
:{{CSharp|void WriteVerbose(string message)}}
+
:{{CSharp|void WriteDebug(string message)}}
+
:{{CSharp|void WriteInfo(string message)}}
+
:{{CSharp|void WriteWarning(string message)}}
+
:{{CSharp|void WriteError(string message)}}
+
:{{CSharp|void WriteFatal(string message)}}
+
::These methods write script debug messages to connected clients with LayerOne permissions
+
 
+
===Chat===
+
* '''C# class ChatChannelExtended.ChatFunctions'''
+
====Methods====
+
:{{CSharp|ChatChannel GetLocalChannel()}}
+
::Gets a reference to the general chat channel for the current instance.
+
:{{CSharp|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====
+
:{{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.
+
:{{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.
+
:{{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.
+
:{{CSharp|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====
+
:{{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).
+
:{{CSharp|EngagementControl GetEngagement(DOMObject target)}}
+
::Tries to find an engagement control involving the DOMObject specified by target.
+
 
+
===Cloud===
+
* '''C# class JSGlobalCloud'''
+
====Methods====
+
:{{CSharp|void 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.
+
:{{CSharp|void SetData(string key, string value)}}
+
::Sets the value of an application-scoped data item. This is basic global application string data storage.
+
:{{CSharp|bool DataExists(string key)}}
+
::Checks if an application scoped data item exists (is set).
+
:{{CSharp|string GetData(string key)}}
+
::Gets the value of an application scoped data item.
+
:{{CSharp|void DeleteData(string key)}}
+
::Deletes the specified application scoped data item.
+
:{{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.
+
:{{CSharp|void SaveData()}}
+
::Checkpoints your app data. Just in case.
+
:{{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.
+
 
+
===HAM===
+
* '''C# class JSGlobalHAM (hosted by CreatureManager)'''
+
====Methods====
+
:{{CSharp|bool IsAvailable()}}
+
::Returns true if the creature manager is installed.
+
:{{CSharp|bool SetAttachment(string attachmentName, DOMObject target, int attachID)}}
+
::Obsolete
+
:{{CSharp|bool HasAttachment(strin attachmentName, DOMObject target)}}
+
::Obsolete
+
:{{CSharp|bool ClearAttachment(string attachmentName, DOMObject target)}}
+
::Obsolete
+
 
+
===Avatar===
+
* '''C# class JavascriptAvatar'''
+
====Methods====
+
:{{CSharp|bool PlayAnimation(DOMObject target, string actionID, bool looping)}}
+
::Triggers a HAM action item on the specified player, given its actionID as a Guid
+
:{{CSharp|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====
+
:{{CSharp|bool IsAvailable()}}
+
:{{CSharp|bool PlayAnimation(DOMObject target, string animationName, bool looping)}}
+
::Same as above, but for bots in a room rather than player avatars
+
:{{CSharp|bool StopAnimation(DOMObject target, string animationName)}}
+
::Same as above, but for bots in a room rather than player avatars
+
 
+
==Layer One Objects==
+
These are JavaScript wrappers for # objects that can be passed down into JavaScript as return value of a function call or as the parameter to an event or callback method.
+
 
+
===ConfirmationHandle===
+
* '''C# class ConfirmationHandleExtended'''
+
====Properties====
+
:{{CSharp|Guid ID {get;} }}
+
:{{CSharp|string Title {get;} }}
+
:{{CSharp|string Description {get;} }}
+
:{{CSharp|string[] Buttons {get;} }}
+
::The list of button labels (eg: yes, no)
+
:{{CSharp|int DefaultButton {get;} }}
+
::The zero-based index into Buttons which will be the default button
+
:{{CSharp|bool IsCompleted {get;} }}
+
::True if this confirmation request was cancelled or completed
+
:{{CSharp|bool Success {get;} }}
+
::True if the user completed the confirmation request
+
:{{CSharp|int ButtonChoice {get;} }}
+
::The zero-based index into Buttons which was chosen by the user
+
:{{CSharp|int ReplyTimeout {get;} }}
+
::The time to wait for the users' reply in milliseconds. -1 to wait indefinitely.
+
:{{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.
+
====Events====
+
:{{CSharp|Cancelled()}}
+
::Fires when the confirmation request has been cancelled (usually because the user logs off or navigates)
+
:{{CSharp|Completed()}}
+
::Fires when the confirmation request completes with success or failure
+
====Methods====
+
:{{CSharp|void Cancel()}}
+
::Cancels the confirmation request
+
:{{CSharp|void Complete(int buttonChoice)}}
+
::Simulates the completion of the confirmation request with a specified button choice.
+
 
+
===CloudCurrency===
+
* '''C# class CloudCurrencyExtended'''
+
====Properties====
+
:{{CSharp|Guid ID {get;} }}
+
:{{CSharp|string Identifier {get;} }}
+
====Methods====
+
:{{CSharp|bool Transfer(Participant source, Participant target, float amount)}}
+
::Same as Rays.Transfer except in this cloud currency
+
:{{CSharp|bool Collect(Participant source, float amount)}}
+
::Same as Rays.Collect except in this cloud currency
+
:{{CSharp|bool Payout(Participant target, float amount)}}
+
::Same as Rays.Payout except in this cloud currency
+
:{{CSharp|float GetBalance(Participant target)}}
+
::Same as Rays.GetBalance except in this cloud currency
+
 
+
===Participant===
+
* '''C# class ParticipantExtended'''
+
====Events====
+
:{{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).
+
:{{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.
+
:{{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.
+
:{{CSharp|OnTypingStarted(Participant part)}}
+
::Fires when the connected client informs the server that the user has begun typing.
+
:{{CSharp|OnTypingStopped(Participant part)}}
+
::Fires when the connected client informs the server that the user has stopped typing.
+
:{{CSharp|OnTargetChanged(DOMObject newTarget, DOMObject oldTarget)}}
+
::Fires when the connected client changed it’s targeted DOMObject.
+
:{{CSharp|OnVirtualRealityStarted(Participant part)}}
+
::Fires when the connected client informs the server that the user has turned on their VR headset.
+
:{{CSharp|OnVirtualRealityStopped(Participant part)}}
+
::Fires when the connected client informs the server that the user has turned on their VR headset.
+
:{{CSharp|OnDisposed()}}
+
::Fires as the participant is cleaned up.
+
====Properties====
+
:{{CSharp|string Name {get;} }}
+
::Gets the participant’s persona’s name.
+
:{{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.
+
:{{CSharp|string AccountID {get;} }}
+
::Gets the account ID of the participant as a GUID in string format
+
:{{CSharp|string PersonaID {get;} }}
+
::Gets the persona ID of the participant as a GUID in string format
+
:{{CSharp|string SessionID {get;} }}
+
::Gets the session ID of the participant as a GUID in string format
+
:{{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
+
====Properties (from CreatureManager)====
+
:{{CSharp|string CreatureType {get;} }}
+
::Gets the creature type ID as a GUID in string format
+
:{{CSharp|bool IsMale {get;} }}
+
::Returns true if the participant’s creature type is male
+
====Methods====
+
:{{CSharp|bool InEntity(string id)}}
+
::Checks if this participant’s connection identity is in the requested entity (account, persona, entitygroup, dynamicgroup, etc)
+
:{{CSharp|bool HasAreaPermission(string id)}}
+
::Checks if this participant’s connection identity has the requested permission in the current area
+
:{{CSharp|void ResetPosition()}}
+
::Resets the user’s world position to their specified DOMStartPoint or the default DOMStartPoint or origin
+
:{{CSharp|bool SendUIScript(ResourceValue packageResource, string args)}}
+
::Pushes the requested UI package to the connected client
+
:{{CSharp|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)====
+
:{{CSharp|void SetData(string key, string value)}}
+
::Sets the value of a persona scoped data item.
+
:{{CSharp|bool DataExists(string key)}}
+
::Checks if a persona scoped data item exists (is set).
+
:{{CSharp|string GetData(string key)}}
+
::Gets the value of a persona scoped data item.
+
:{{CSharp|void DeleteData(string key)}}
+
::Deletes the specified persona scoped data item.
+
:{{CSharp|void SetAccountData(string key, string value)}}
+
::Sets the value of an account scoped data item.
+
:{{CSharp|bool AccountDataExists(string key)}}
+
::Checks if an account scoped data item exists (is set).
+
:{{CSharp|string GetAccountData(string key)}}
+
::Gets the value of an account scoped data item.
+
:{{CSharp|void DeleteAccountData(string key)}}
+
::Deletes the specified account scoped data item.
+
:{{CSharp|void 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.
+
:{{CSharp|void GiveUniqueObject(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 if one doesn't exist already. Essentially, gives a person a thing, like clothing, or an object for scene editing.
+
:{{CSharp|ConfirmationHandle Inform(string title, string description, string buttonText {{=}} "core.confirmbutton.ok", int timeout {{=}} -1 )}}
+
::Initiates a new Confirmation Request meant to inform the user of something.
+
:{{CSharp|ConfirmationHandle Confirm(string title, string description, function yesCallback, function noCallback {{=}} null, string[] buttons {{=}} null, int timeout {{=}} -1 , function cancelCallback {{=}} null)}}
+
::Initiates a new Confirmation Request meant to confirm something with the user. 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. The confirmation will be automatically cancelled if the user disconnects or navigates. You can provide functions that will be called back when the user presses yes no or cancel.
+
:{{CSharp|ConfirmationHandle ConfirmationRequest(string title, string description, string buttons, int defaultButton, int timeout)}}
+
::Initiates a new Confirmation Request meant to confirm something with the user. 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. The confirmation will be automatically cancelled if the user disconnects or navigates. Buttons are specified as a comma separated list.
+
:{{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
+
:{{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
+
:{{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
+
:{{CSharp|InteractionMapping RegisterInteraction(string selector, string abilityIdentifier)}}
+
::Registers an ability (created earlier in a call to <code>Instance.View.AddAbility</code>) as an interaction that only this participant will see.
+
:{{CSharp|bool SetOverlayItem(string path, string objectTypeId)}}
+
::Sets the specified object type as a GameCloud clothing slot overlay in the slot specified by ''path'' on this participant.
+
:{{CSharp|bool SetOverlayBlank(string path)}}
+
::Sets a 'blank' or clothing remove request as a GameCloud clothing slot overlay in the slot specified by ''path'' on this participant.
+
:{{CSharp|bool ClearOverlayItem(string path)}}
+
::Clears any GameCloud clothing slot overlay in the slot specified by ''path'' on this participant.
+
:{{CSharp|bool ClearOverlay()}}
+
::Clears all GameCloud clothing slot overlays on this participant.
+
====Methods (from HumanAvatarManager)====
+
:{{CSharp|bool EnableAbilityGroup(string identifier)}}
+
::Enables a group of abilities for the player. (eg, turning on dance moves when you enter the dance floor)
+
:{{CSharp|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====
+
:{{CSharp|OnDisposed()}}
+
::Fired when the ability set is destroyed.
+
:{{CSharp|OnAbilityFired(Ability ability, Participant participant)}}
+
::Fires when the user fires an ability (usually by pressing a button on their quickbar).
+
====Methods====
+
:{{CSharp|Ability Find(Guid id)}}
+
::Finds an Ability or AbilityGroup by ID.
+
:{{CSharp|AbilityGroup CreateGroup(string identifier, ResourceValue iconResource {{=}} null)}}
+
::Creates a new ability group with an optional iconResource.
+
 
+
===AbilityGroup===
+
* '''C# class AbilityGroupExtended, Inherits Ability'''
+
====Events====
+
:{{CSharp|OnDisposed()}}
+
::Fired when the AbilityGroup  is destroyed.
+
====Methods====
+
:{{CSharp|AbilityGroup CreateGroup(string identifier, ResourceValue iconResource {{=}} null)}}
+
::Creates a child ability group under this one.
+
:{{CSharp|Ability CreateAbility(string identifier, float cooldown {{=}} 0, ResourceValue iconResource {{=}} null)}}
+
::Creates a new ability with an optional cooldown and icon resource.
+
:{{CSharp|void Remove()}}
+
::Removes the ability.
+
 
+
===Ability===
+
* '''C# class AbilityExtended'''
+
====Events====
+
:{{CSharp|OnDisposed()}}
+
::Fired when the Ability is destroyed.
+
====Properties====
+
:{{CSharp|bool ScriptCreated {get;} }}
+
::True if the Ability or AbilityGroup was created by javascript.
+
:{{CSharp|string Identifier {get;} }}
+
::The translatable identifier of the ability
+
:{{CSharp|string Description {get;} }}
+
::The description of the ability (not currently used)
+
:{{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.
+
:{{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).
+
:{{CSharp|bool Active {get; set;} }}
+
::Marks an ability as active (in use). This is meant mainly for display purposes.
+
:{{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).
+
:{{CSharp|float CooldownProgress {get;} }}
+
::A number between 0 and 1 representing the percentage of cooldown time elapsed since the ability was last set Active.
+
====Methods====
+
:{{CSharp|void Reset()}}
+
::Attempts to reset the ability (Enabled, not Denied, not Active)
+
:{{CSharp|void Remove()}}
+
::Removes the ability.
+
 
+
===ChatChannel===
+
* '''C# class ChatChannelExtended'''
+
====Events====
+
:{{CSharp|OnDisposed()}}
+
::Fired when the channel is destroyed.
+
:{{CSharp|OnJoin(Participant participant)}}
+
::Fired when a new participant enters the channel.
+
:{{CSharp|OnLeave(Participant participant)}}
+
::Fired when a participant leaves the channel.
+
:{{CSharp|OnMessage(Participant participant, ChatMessageEventArgs message)}}
+
::Fired when a message is sent in the channel.
+
====Methods====
+
:{{CSharp|bool Join(Participant participant)}}
+
::Add a participant to the channel.
+
:{{CSharp|bool Leave(Participant participant)}}
+
::Remove a participant from the channel.
+
:{{CSharp|void Close()}}
+
::Closes (Disposes) a channel.
+
:{{CSharp|void Broadcast(string message, int messageStyle {{=}} 253)}}
+
::Sends a message to all participants of a channel. By default, the message style is 253 (System)
+
:{{CSharp|void SendMessageTo(Participant participant, string message, int messageStyle)}}
+
::Sends a message to a single participant of a channel. By default, the message style is 253 (System)
+
:{{CSharp|Participant[] GetParticipants()}}
+
::Gets the participants of the channel
+
 
+
===ChatMessageEventArgs===
+
* '''C# class ChatMessageEventArgsExtended'''
+
====Properties====
+
:{{CSharp|string Message {get; set;} }}
+
::The text of the message.
+
:{{CSharp|Participant Source {get;} }}
+
::The participant representing the sender of the message. Or null if it’s a system message.
+
 
+
===ViewInfo===
+
* '''C# class ViewExtended'''
+
====Events====
+
:{{CSharp|OnEnter(Participant who)}}
+
::Fired when a participant in an engagement uses one of their abilities
+
:{{CSharp|OnInteraction(Participant who, DOMObject target, Guid abilityID, object value)}}
+
::Fired when a participant executes an interaction.
+
:{{CSharp|OnLeave(Participant who)}}
+
::Fired when a participant in an engagement uses one of their abilities
+
====Properties====
+
:{{CSharp|long ViewID {get;} }}
+
::The unique ID of the view
+
====Methods====
+
:{{CSharp|InteractionMapping AddInteraction(string selector, Guid abilityID, Guid entityID {{=}} null)}}
+
::Add a participant to the shared view.
+
:{{CSharp|ViewAbility AddAbility (string identifier, string initialMetadata, float? cooldown {{=}} null, Guid? entityID {{=}} null)}}
+
::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.
+
:{{CSharp|bool Join(Participant participant)}}
+
::Add a participant to the shared view.
+
:{{CSharp|bool Leave(Participant participant)}}
+
::Remove a participant from the shared view.
+
:{{CSharp|bool Release()}}
+
::Destroys the shared view.
+
 
+
===InteractionMapping===
+
* '''C# class InteractionMappingExtended'''
+
====Events====
+
:{{CSharp|OnInteraction(Participant who, DOMObject target, Guid abilityID, object value)}}
+
::Fired when a participant executes an interaction.
+
====Properties====
+
:{{CSharp|string Selector {get;} }}
+
::The CSS-style selector string used to select possible target objects for an this interaction
+
:{{CSharp|Guid AbilityID {get;} }}
+
::The ID of the ability bound to this mapping as an interaction
+
:{{CSharp|Guid EntityID {get;} }}
+
::The optional ID of an entity to which a participant must belong to get this interaction
+
====Methods====
+
:{{CSharp|bool Release()}}
+
::Destroys the interaction mapping
+
 
+
===ViewAbility===
+
* '''C# class ViewAbilityExtended'''
+
====Properties====
+
:{{CSharp|Guid AbilityID {get;} }}
+
::The ID of the ability bound to this mapping as an interaction
+
:{{CSharp|Guid EntityID {get;} }}
+
::The optional ID of an entity to which a participant must belong to get this interaction
+
:{{CSharp|string Identifier {get;} }}
+
::The identifier of the ability (used for language translation)
+
:{{CSharp|float Cooldown {get;} }}
+
::The cooldown timer for the ability. 0 if there is none.
+
:{{CSharp|string InitialMetadata {get;} }}
+
::The initial metadata attached to the participant’s ability when it’s created.
+
====Methods====
+
:{{CSharp|bool Release()}}
+
::Destroys the view ability
+
 
+
===EngagementControl===
+
* '''C# class EngagementControlExtended'''
+
====Events====
+
:{{CSharp|AbilityFired(Participant who, string identifier)}}
+
::Fired when a participant in an engagement uses one of their abilities
+
:{{CSharp|StateChanged(string identifier)}}
+
::Fired when the state of the angagement changes, and passes in the new state identifier
+
:{{CSharp|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.
+
:{{CSharp|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.
+
:{{CSharp|OnDisposed()}}
+
::Fired when this engagement control is shutting down
+
====Properties====
+
:{{CSharp|bool IsValid {get;} }}
+
::Ask dirk
+
====Methods====
+
:{{CSharp|void Close()}}
+
::Disposes this engagement control.
+
:{{CSharp|bool IsPlayerEngaged(DOMObject who)}}
+
::Tests if the player represented by the DOMObject is in this engagement.
+
:{{CSharp|bool AddPlayer(DOMObject who)}}
+
::Adds a player represented by the DOMObject to this engagement.
+
:{{CSharp|bool RemovePlayer(DOMObject who, bool restoreAnimator)}}
+
::Removes a player represented by the DOMObject from this engagement.
+
:{{CSharp|void 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.
+
 
+
==Layer One Objects (DOM)==
+
As above, these are wrappers for C# objects that can be returned from function calls or passed to events. These are all wrappers for DOMObject derived classes implemented by DOMObjectExtended and it's derived classes.
+
 
+
===DOMObject===
+
* '''C# class DOMObjectExtended'''
+
====Events====
+
:{{CSharp|OnDisposed()}}
+
::Fires when a DOMObject is being destroyed, usually because it’s being removed from the DOM.
+
:{{CSharp|OnSelect(Participant who, DOMObject source)}}
+
::Fires when a user selects an object in world. Who is the Participant doing the selecting.
+
:{{CSharp|OnDeselect(Participant who, DOMObject source)}}
+
::Fires when a user deselects an object in world. Who is Participant doing the deselecting.
+
:{{CSharp|OnTarget(Participant who, DOMObject source)}}
+
::Fires when a user targets an object in world. Who is the Participant doing the targeting.
+
:{{CSharp|OnUnTarget(Participant who, DOMObject source)}}
+
::Fires when a user un-targets an object in world. Who is the Participant doing the un-targeting.
+
====Properties====
+
:{{CSharp|string Class {get; set;} // via attribution}}
+
::A space separated list of class names which are used by CSS-style selectors to match this node
+
:{{CSharp|DOMDocument Document {get;} }}
+
::Gets a reference to the DOMDocument in which this DOMObject resides.
+
:{{CSharp|string DocumentTitle {get;} }}
+
::A shortcut equivilant to DOMObject.Document.Title.
+
:{{CSharp|bool Enabled {get; set;} // 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
+
:{{CSharp|long ID {get;} // via attribution}}
+
::The unique ID of the object in it’s current DOM tree
+
:{{CSharp|bool IsTemporary {get;} // 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
+
:{{CSharp|bool IsTransient {get;} // via attribution}}
+
::An object marked as transient be sent to connected clients but will not be saved in the DOM.
+
:{{CSharp|bool IsTypeRoot {get;} // via attribution}}
+
::True if this node is the root node of an instantiated object type.
+
:{{CSharp|DOMProperties LocalProperties {get;} }}
+
::Gets a DOMProperties object representing the properties of this object which are NOT send over the network.
+
:{{CSharp|string Title {get; set;} // via attribution}}
+
::The title of the DOM node. Visible in curiosity.
+
:{{CSharp|string Type {get;} }}
+
::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”
+
:{{CSharp|DOMObject Parent {get;} }}
+
::Gets a reference to the DOMObject directly parenting this one.
+
:{{CSharp|DOMProperties Properties {get;} }}
+
::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.
+
:{{CSharp|int ProtectionFlags {get;} // 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)
+
:{{CSharp|bool Visible {get;} // 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====
+
:{{CSharp|void AddClass(string className)}}
+
::Adds a class name to the space separated list of class names found on the Class property of this DOMObject.
+
:{{CSharp|DOMObject Clone(DOMObject newParent)}}
+
::Clones this object and places it as a direct child of the specified parent object
+
:{{CSharp|DOMTransform CreateCurve(string title {{=}} null, bool visible {{=}} true)}}
+
::Creates a new DOMCurve object, optionally initially invisible, as a direct child of this object.
+
:{{CSharp|DOMTransform CreateCurveFromJson(string json)}}
+
::Creates a new DOMCurve object from the [[JSON Curve Definition]], as a direct child of this object.
+
:{{CSharp|DOMTransform CreateEmptyNode(bool visible {{=}} false)}}
+
::Creates a simple DOMTransform object, optionally initially invisible, as a direct child of this object.
+
:{{CSharp|DOMObject CreateHookpoint(string title, bool visible {{=}} false)}}
+
::Creates a simple DOMHookpoint object, optionally initially invisible, as a direct child of this object.
+
:{{CSharp|DOMLight CreateLight(int color, float intensity, int shadowtype, float shadowstrength, Vector3 position, Vector3 rotation)}}
+
::Creates a DOMLight object as a direct child of this object with the specified properties already set.
+
:{{CSharp|DOMObject CreateNode(string templateID, bool visible {{=}} false)}}
+
::Creates an instance of the specified ObjectTemplate given its GUID templateID, optionally initially invisible, as a direct child of this object.
+
:{{CSharp|DOMObject CreateTitleNode(string title, int index, bool visible {{=}} false)}}
+
::Creates a simple DOMTitle object, optionally initially invisible, as a direct child of this object.
+
:{{CSharp|bool DeleteNode()}}
+
::Removes this node from the DOM.
+
:{{CSharp|DOMObject[] GetChildren()}}
+
::Gets all direct children.
+
:{{CSharp|DOMController FindController()}}
+
::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.
+
:{{CSharp|DOMObject FindNode(string name)}}
+
::Find the first child node (recursive, deep search) with the specified name;
+
:{{CSharp|DOMObject[] FindNodes(string name)}}
+
::Finds child nodes (recursive, deep search) with the specified name;
+
:{{CSharp|DOMController FindParentController()}}
+
::Searches up the tree for the first DOMController. Better for finding bot controllers.
+
:{{CSharp|object GetAttributeValue(string attributeName)}}
+
::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.
+
:{{CSharp|bool HasAttribute(string attributeName)}}
+
::Checks to see if a given attribute exists on this object.
+
:{{CSharp|bool HasClass(string className)}}
+
::Tests if the specified class name is found in the space separated list of class names found on the Class property of this DOMObject.
+
:{{CSharp|void ListenOnChannel(int channelID, function callback)}}
+
::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.
+
:{{CSharp|bool MatchesSelector(string selector)}}
+
::Parses the specified CSS-style selector string and then tests itself (the current node) for a match.
+
:{{CSharp|DOMObject[] QuerySelectorAll(string selector)}}
+
::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.
+
:{{CSharp|DOMObject QuerySelector(string selector)}}
+
::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.
+
:{{CSharp|void RemoveClass(string className)}}
+
::Removes a class name from the space separated list of class names found on the Class property of this DOMObject.
+
:{{CSharp|bool SendMessage(int channel, string message, DOMObject source)}}
+
::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.
+
:{{CSharp|void ToggleClass(string className)}}
+
::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====
+
:{{CSharp|string AttachToBone {get; set;} // 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
+
:{{CSharp|bool IsClickable {get; set;} // via attribution}}
+
::Allows an object to receive client click events.
+
:{{CSharp|bool IsSelectable {get; set;} // via attribution}}
+
::Allows an object to be selected.
+
:{{CSharp|bool IsTargetable {get; set;} // via attribution}}
+
::Allows an object to be the users target.
+
:{{CSharp|string ToolTip {get; set;} // via attribution}}
+
::Specifies a tool tip to display when the user hovers their pointer over this object.
+
:{{CSharp|string ToolTipTitle {get; set;} // via attribution}}
+
::For large-style tool tips, allows for a title displayed over the tool main tip text
+
:{{CSharp|ResourceUri ToolTipIcon {get; set;} // via attribution}}
+
::For large-style tool tips, allows for an icon displayed beside the main tip text
+
:{{CSharp|DOMTransform TransformParent {get; set;} }}
+
::Gets a reference to this object’s DOMTransform parent, if it has been set to something other than normal node hierarchy.
+
:{{CSharp|int TransformParentID {get; set;} // via attribution}}
+
::The ID of the node of the specified TransformParent
+
:{{CSharp|float X {get; set;} // via attribution}}
+
::Gets or sets the X component of the transform’s position
+
:{{CSharp|float Y {get; set;} // via attribution}}
+
::Gets or sets the Y component of the transform’s position
+
:{{CSharp|float Z {get; set;} // via attribution}}
+
::Gets or sets the Z component of the transform’s position
+
:{{CSharp|float RX {get; set;} // via attribution}}
+
::Gets or sets the X component of the transform’s rotation
+
:{{CSharp|float RY {get; set;} // via attribution}}
+
::Gets or sets the Y component of the transform’s rotation
+
:{{CSharp|float RZ {get; set;} // via attribution}}
+
::Gets or sets the Z component of the transform’s rotation
+
:{{CSharp|float SX {get; set;} // via attribution}}
+
::Gets or sets the X component of the transform’s scale
+
:{{CSharp|float SY {get; set;} // via attribution}}
+
::Gets or sets the Y component of the transform’s scale
+
:{{CSharp|float SZ {get; set;} // via attribution}}
+
::Gets or sets the Z component of the transform’s scale
+
====Events====
+
:{{CSharp|OnClick(Participant who, DOMObject source)}}
+
::Fires when a user clicks an object in world. Who is the Participant doing the clicking.
+
:{{CSharp|OnRightClick(Participant who, DOMObject source)}}
+
::Fires when a user right-clicks an object in world. Who is the Participant doing the right-clicking.
+
====Methods====
+
:{{CSharp|bool MoveTo(float x, float y, float z, float speed)}}
+
::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.
+
:{{CSharp|bool MoveToWithCallback(float x, float y, float z, float speed, function callback)}}
+
::Same as above, but requests a callback when the operation completes.
+
:{{CSharp|DOMPhysics PhysicsSpawn(float radius, bool stack)}}
+
::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.
+
:{{CSharp|DOMPhysics PhysicsPathTo(float targetX, float targetY, float targetZ, float speed)}}
+
::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.
+
:{{CSharp|DOMPhysics PhysicsPathToVector(Vector3 target, float speed)}}
+
::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.
+
:{{CSharp|DOMPhysics PhysicsFollow(DOMTransform target, float minDistance, float, maxDistance)}}
+
::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.
+
:{{CSharp|DOMPhysics PhysicsProjectile(float directionX, float directionY, float directionZ, float speed, bool gravity, float maxDistance)}}
+
::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.
+
:{{CSharp|DOMPhysics PhysicsProjectileVector(Vector3 direction, float speed, bool gravity, float maxDistance)}}
+
::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.
+
:{{CSharp|void ResetTransformParent(bool restoreLastPosition)}}
+
::Resets this object’s transform parent reference to null so that it behaves normaly, transforming relative to the next DOMTransform up the hierarchy.
+
:{{CSharp|void SetPosition(float x, float y, float z)}}
+
::Sets the position (transform) of this object from its next parent DOMTransform or from world origin (0,0,0).
+
:{{CSharp|void SetRotation(float x, float y, float z)}}
+
::Sets the rotation of this object relative to its next parent DOMTransform or from (0,0,0)
+
:{{CSharp|void SetScale(float x, float y, float z)}}
+
::Sets the scale of this object relative to its next parent DOMTransform or from (1,1,1)
+
:{{CSharp|void SetTransformParent(DOMTransform target, Vector3 position, Vector3 rotation, Vector3 scale)}}
+
::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====
+
:{{CSharp|string AnimationName {get; set;} // via attribution}}
+
::The name of an animation to play
+
:{{CSharp|bool CamPassable {get; set;} // via attribution}}
+
::Specifies that this object allow the camera to pass through it
+
:{{CSharp|bool CastShadows {get; set;} // via attribution}}
+
::Specifies that this object should cast shadows onto surrounding geometry
+
:{{CSharp|int InteractionDistance {get; set;} // 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)
+
:{{CSharp|bool LightProbes {get; set;} // via attribution}}
+
::Specifies that this object should use light probe information in it’s lighting calculations
+
:{{CSharp|bool PhysicsEnabled {get; set;} // via attribution}}
+
::Specifies that physics is enabled for this object
+
:{{CSharp|bool ReceiveShadows {get; set;} // via attribution}}
+
::Specifies that this object should receive shadows from surrounding geometry
+
====Methods====
+
:{{CSharp|void SetClickable(bool clickable)}}
+
::Apparently sets property #Clickable
+
:{{CSharp|void EnablePhysics(bool enabled)}}
+
::Apparently sets property #Physics
+
 
+
===DOMController===
+
* '''C# class DOMControllerExtended, Inherits DOMRenderable'''
+
====Properties====
+
:{{CSharp|DOMAnimationController AnimationController {get; set;} }}
+
::Returns the DOMAnimationController that this controller should use for animation.  If none is specified an immediate child DOMAnimationController will be used instead.
+
:{{CSharp|int AnimationControllerID {get; set;} // via attribution}}
+
::The ID of the node of the specified AnimationController override.
+
:{{CSharp|DOMController ActiveController {get; set;} }}
+
::Returns the DOMController that this controller should use to overide control.  If none is specified this DOMController controls itself.
+
:{{CSharp|int ActiveControllerID {get; set;} // via attribution}}
+
::The ID of the node of the specified ActiveController override.
+
:{{CSharp|int BlendshapeTypeNodeID {get; set;} // via attribution}}
+
::No idea what this does.
+
:{{CSharp|int Direction {get;} // via attribution}}
+
::The direction the avatar is pointing in degrees.
+
:{{CSharp|bool IsParticipant {get;} }}
+
::Returns true if this object is in a persona document.
+
:{{CSharp|DOMTransform : LookAt {get; set;} }}
+
::Returns the DOMTransform object that this controller should try to “look at” if any
+
:{{CSharp|int LookAtID {get; set;} // via attribution}}
+
::The ID of the node of the specified LookAt target
+
:{{CSharp|string LookAtBone {get; set;} // via attribution}}
+
::Gets or sets the name of the bone in the LookAt target to fine-tune the looking.
+
:{{CSharp|Participant Participant {get;} }}
+
::Returns the Participant object associated with the persona document in which this controller resides.
+
:{{CSharp|int ParticipantID {get;} // 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!)
+
:{{CSharp|bool PositionLocked {get;} // via attribution}}
+
::Specifies whether the controller is allowed to move.
+
:{{CSharp|int Running {get;} // via attribution}}
+
::Indicates the controller’s running speed.
+
:{{CSharp|float Speed {get;} // via attribution}}
+
::The speed the avatar is moving in units per second.
+
====Methods====
+
:{{CSharp|void LockPosition(bool locked)}}
+
::Position locks this object so it can’t move or be controlled to move. Useful for playing animations where locked position is necessary.
+
:{{CSharp|bool SetAnimationInt(string name, int value)}}
+
::Sets the specified name and integer value of a property on the first child animation controller. This is super cheesy and should be replaced.
+
:{{CSharp|bool StartAnimation(string layerName, string animKey, bool looping, int timeOffset)}}
+
::Creates a DOMAnimation node and puts it on the specified DOMAnimationLayer. This function is in the wrong place. Should be on DOMController
+
:{{CSharp|bool StartLookAt(DOMTransform target, string boneName)}}
+
::Sets the LookAt and BoneName properties in a single update
+
:{{CSharp|bool StopAnimation(string layerName, string animKey)}}
+
::Stops an animation from playing.
+
:{{CSharp|bool StopAnimationLayer(string layerName)}}
+
::Stops all animations on the specified animation layer from playing.
+
:{{CSharp|bool StopLookAt()}}
+
::Clears the LookAt and BoneName properties in a single update
+
 
+
===DOMAnimation===
+
* '''C# class DOMAnimationExtended, Inherits DOMObject'''
+
 
+
===DOMScript===
+
* '''C# class DOMScriptExtended, Inherits DOMObject'''
+
====Methods====
+
:{{CSharp|void ReloadScript()}}
+
::Causes the script associated with this node to reload.
+
 
+
===DOMPhysics===
+
* '''C# class DOMPhysicsExtended, Inherits DOMObject'''
+
====Events====
+
:{{CSharp|OnComplete()}}
+
::Fires when the physics host says the physics operation represented by this object has been completed.
+
====Methods====
+
:{{CSharp|void Start()}}
+
::Asks the physics host to start carrying out the physics operation represented by this object.
+
:{{CSharp|void Stop()}}
+
::Asks the physics host to stop carrying out the physics operation represented by this object.
+
 
+
===DOMCurve===
+
* '''C# class DOMCurveExtended, Inherits DOMObject'''
+
This DOM object represents an animation of the DOM. A '''Curve''' is made up of '''Keyframes''' with '''Values'''. A '''Player''' plays the curve and it's properties reflect the values at any given moment along the curve, and can project those values onto other objects in the DOM via it's Selector. You can create a new DOMCurve via the CreateCurve and CreateCurveFromJson methods of DOMObject.
+
====Methods====
+
:{{CSharp|DOMCurveKeyframe CreateKeyframe(float time, string title {{=}} null)}}
+
::Creates a new keyframe at the specified time on this curve
+
:{{CSharp|DOMCurvePlayer CreatePlayer(string title {{=}} null)}}
+
::Creates a new player on this curve
+
:{{CSharp|string ToJson()}}
+
::Creates a stringified JSON object in the [[JSON Curve Definition]] format from this curve.
+
 
+
===DOMCurveKeyframe===
+
* '''C# class DOMCurveKeyframeExtended, Inherits DOMObject'''
+
====Properties====
+
:{{CSharp|float Time {get; set} // via attribution}}
+
::The time that this keyframe occurs on the curve
+
====Events====
+
:{{CSharp|OnPlayerCrossed(DOMCurvePlayer player)}}
+
::Fires when this keyframe is crossed by a player
+
====Methods====
+
:{{CSharp|DOMObject CreateValue(string name)}}
+
::Creates a new DOMCurveValue node with the specified name, you must set a property on it with an appropriate value
+
:{{CSharp|DOMObject CreateColorValue(string name, Color32 value)}}
+
::Creates a new DOMCurveValue node with the specified name, and Color32 value
+
:{{CSharp|DOMObject CreatePointValue(string name, Point3D value)}}
+
::Creates a new DOMCurveValue node with the specified name, and Point3D value
+
:{{CSharp|DOMObject CreateFloatValue(string name, float value)}}
+
::Creates a new DOMCurveValue node with the specified name, and float value
+
:{{CSharp|DOMObject CreateResourceValue(string name, ResourceValue value)}}
+
::Creates a new DOMCurveValue node with the specified name, and ResourceValue value
+
:{{CSharp|DOMObject CreateStringValue(string name, string value)}}
+
::Creates a new DOMCurveValue node with the specified name, and string value
+
:{{CSharp|DOMObject CreateIntValue(string name, int value)}}
+
::Creates a new DOMCurveValue node with the specified name, and int value
+
:{{CSharp|DOMObject CreateBoolValue(string name, bool value)}}
+
::Creates a new DOMCurveValue node with the specified name, and bool value
+
 
+
===DOMCurvePlayer===
+
* '''C# class DOMCurvePlayerExtended, Inherits DOMObject'''
+
====Properties====
+
:{{CSharp|float Time {get; set} // via attribution}}
+
::Gets or sets the current time index of this player. Generally you'll only read this value, not set it.
+
:{{CSharp|DOMCurveOperation Operation {get; set} // via attribution}}
+
::Set to one of the following enum values, this property specifies the operational mode of the player:
+
:::*'''Stop''' (0) : The player freezes and it's values do not change, it stops projecting it's values onto DOM Nodes matching it's selector
+
:::*'''Run''' (1) : The player begins counting time and each "tick" it assumes new property values by "playing" the curve. As it moves between keyframes, value nodes are used to generate lerped values for the properties assumed by the player. The player then projects these values onto other nodes in the DOM via it's Selector
+
:::*'''Step''' (2) : As with Run above, except as the player passes keyframes it consumes it's "StepCount" and eventually stops
+
:::*'''JumpToKeyframe''' (3) : The player freezes, sets it's time index to that of the keyframe specified by the ID in the JumpToKeyframeID property, and projects it's values ''once'' onto the DOM nodes matching it's Selector
+
:::*'''Reset''' (4) : The player freezes, sets it's time index to 0, and stops projecting it's values onto DOM Nodes matching it's selector
+
:{{CSharp|long JumpToKeyframeID {get; set} // via attribution}}
+
::The ID of the keyframe node under this curve to which the player should jump if it's Operation property is set to JumpToKeyframe
+
:{{CSharp|bool Loop {get; set} // via attribution}}
+
::If set to true the player loops around from the last keyframe's Time to 0.0 when it reaches the end (or from 0.0 to the last keyframes's time when it reaches the beginning when running in reverse)
+
:{{CSharp|bool Reverse {get; set} // via attribution}}
+
::If set to true the player runs backward
+
:{{CSharp|string Selector {get; set} // via attribution}}
+
::The CSS-style selector used to identify nodes in the DOM that should be affected by this player
+
:{{CSharp|int StepCount {get; set} // via attribution}}
+
::The number of steps the player should run for if it's Operation property is set to Step
+
====Events====
+
:{{CSharp|OnKeyframeCrossed(DOMCurveKeyframe keyframe)}}
+
::Fires when this player crosses a keyframe
+
====Methods====
+
:{{CSharp|void Run()}}
+
::Starts the player running by setting the Operation property to "Run"
+
:{{CSharp|void Stop()}}
+
::Stops the player from running by setting the Operation property to "Stop"
+
:{{CSharp|void Reset()}}
+
::Stops the player from running and resets it to time index 0.0 by setting the Operation property to "Reset"
+
:{{CSharp|void Step(int count {{=}} 1)}}
+
::Increments the step count by ''count'' and sets the Operation property to "Step". The player will run until it consumes ''count' steps
+
:{{CSharp|void JumpToKeyframe(DOMCurveKeyframe keyframe)}}
+
::Sets the time index of the player to that of the specified keyframe, fires the crossed events for the keyframe and player, and stops.
+
 
+
 
+
===DOMVolume===
+
* '''C# class DOMVolumeExtended, Inherits DOMTransform'''
+
====Events====
+
:{{CSharp|OnEnter(Participant who, DOMObject source)}}
+
::Fires when a user enters an DOMVolume in world. Who is the Participant doing the entering.
+
:{{CSharp|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====
+
:{{CSharp|object GetAttributeValue(string propertyName, string attributeName)}}
+
::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.
+
:{{CSharp|bool HasAttribute(string propertyName, string attributeName)}}
+
::Checks if the specified property has the specified attribute defined.
+
:{{CSharp|string[] WithAttribute(string attributeName)}}
+
::Gets the name of all properties with the given attribute defined.
+
:{{CSharp|bool SetInt32(string propertyName, int value, bool silent {{=}} false, bool persist {{=}} false)}}
+
:{{CSharp|bool SetInt64(string propertyName, int value, bool silent {{=}} false, bool persist {{=}} false)}}
+
:{{CSharp|bool SetInt64(string propertyName, int value, bool silent {{=}} false, bool persist {{=}} false)}}
+
:{{CSharp|bool SetSingle(string propertyName, float  value, bool silent {{=}} false, bool persist {{=}} false)}}
+
:{{CSharp|bool SetGuid(string propertyName, string value, bool silent {{=}} false, bool persist {{=}} false)}}
+
:{{CSharp|bool SetString(string propertyName, string value, bool silent {{=}} false, bool persist {{=}} false)}}
+
:{{CSharp|bool SetBoolean(string propertyName, bool value, bool silent {{=}} false, bool persist {{=}} false)}}
+
:{{CSharp|bool SetInt32Array(string propertyName, string JSONValue, bool silent {{=}} false, bool persist {{=}} false)}}
+
:{{CSharp|bool SetStringArray(string propertyName, string JSONValue, bool silent {{=}} false, bool persist {{=}} false)}}
+
:{{CSharp|bool SetColor(string propertyName, int value, bool silent {{=}} false, bool persist {{=}} false)}}
+
:{{CSharp|bool SetPoint3D(string propertyName, Vector3 value, bool silent {{=}} false, bool persist {{=}} false)}}
+
::All of these functions set the value of a property in a type-safe manner.
+
:{{CSharp|void RemoveProperty(string propertyName)}}
+
::Removes the specified property.
+
:{{CSharp|ProtoValue GetProperty(string propertyName)}}
+
:{{CSharp|int GetInt32(string propertyName)}}
+
:{{CSharp|float GetSingle(string propertyName)}}
+
:{{CSharp|string GetGuid(string propertyName)}}
+
:{{CSharp|bool GetBoolean(string propertyName)}}
+
:{{CSharp|string GetString(string propertyName)}}
+
:{{CSharp|Color32 GetColor(string propertyName)}}
+
:{{CSharp|Point3D GetPoint3D(string propertyName)}}
+
::All of these functions get the value of a property in a type-safe manner.
+
:{{CSharp|void AddWatcher(string propertyName, function callback)}}
+
::Begins watching for changes to a property, specifying a callback to be invoked when the property changes.
+
:{{CSharp|void RemoveWatcher(string propertyName)}}
+
::Stops watching for changes to the specified property.
+

Latest revision as of 16:10, 7 February 2019

Contents

This page is part of the Infrastructure Guide. Here we'll describe the various objects you'll work with from in the server JavaScript scripting environment, as well as provide step by step instructions to help you create your first server script, and examples of working scripts you can use on your server.

Creating A Server Script

TODO: make a tutorial explaining how to make, upload, and debug a server script

Script Examples

TODO: make a table of script examples with the link in the first column, and a quick description in the second. The links can go to pages with the full source

JavaScript Server Globals

Remarks [edit]

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.

Chat Global (Full Article)

The Chat JavaScript global object is available from server world scripts and provides methods for working with chat channels

DOM Global (Full Article)

The DOM JavaScript global object is available from server world scripts and is the main entry point to the Document Object Model

Instance Global (Full Article)

The Instance JavaScript global is available in server world scripts and provides access to the server instance in which the script is running.

Log Global (Full Article)

The Log JavaScript global object is available from server world scripts and provides methods for writing to the script debug log

Physics Global (Full Article)

The Physics JavaScript global object is available from server world scripts and provides methods for launching physics operations

System Global (Full Article)

The System JavaScript Global object is available from server world scripts and provides utility methods for ineter-script communication among other things


JavaScript Server Objects

Remarks [edit]

These are JavaScript wrappers for C# objects that can be passed down into JavaScript as return value of a function call or as the parameter to an event or callback method.

AbilityExtended (Full Article)

Represents a user ability

AbilityGroupExtended (Full Article)

Represents a user ability group

AbilitySetExtended (Full Article)

Represents a user ability set

ChatChannelExtended (Full Article)

ChatMessageEventArgsExtended (Full Article)

Represents a chat message

DOMPropertiesExtended (Full Article)

Represents the property collection on a DOMObject

InteractionMappingExtended (Full Article)

Represents a mapping between an ability and nodes in the DOM for which the ability should be an Interaction

ParticipantExtended (Full Article)

Represents a participant in an instance. A participant is the owner of a connection's current avatar in an instance of a scene. It represents the user's actions in the instance, and is the source of interaction events like mouse clicks.

ViewAbilityExtended (Full Article)

Represents a runtime ability created in the view

ViewExtended (Full Article)

Represents a View which hosts live DOM


JavaScript Component Globals

Remarks [edit]

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.

Adult Global (Full Article)

The Adult JavaScript global object is available from server world scripts and provides methods for working with angagements and overlays

Bot Global (Full Article)

The Bot JavaScript global object is available from server world scripts and provides methods and objects for creating, clothing, and working with NPC avatars

Cloud Global (Full Article)

The Cloud JavaScript global object is available from server world scripts and is the main entry point for the GameCloud functionality.

HAM Global (Full Article)

The HAM JavaScript global object is available from server world scripts and provides methods for working with avatar attachments

Market Global (Full Article)

The Cloud JavaScript global object is available from server world scripts and is the main entry point for the GameCloud functionality.

Rays Global (Full Article)

The Rays JavaScript global object is available from server world scripts and provides methods for working the Rays virtual currency


JavaScript Component Objects

Remarks [edit]

These are JavaScript wrappers for C# objects passed down from components

ActorExtended (Full Article)

Represents a an Actor in an Enagement.

AvatarActorExtended (Full Article)

Represents a an Actor in an Enagement that is based on a GameCloud AvatarExtended.

AvatarExtended (Full Article)

Represents an avatar which is a collection of DOM nodes starting with a root DOMController object and managed by the Creature Manager component

AvatarLayerExtended (Full Article)

Represents a modification layer on an avatar. These can be used to change clothing and attachment items and other properties.

CloudCurrencyExtended (Full Article)

Represents an available GameCloud virtual currency

ConfirmationHandleExtended (Full Article)

Represents a user confirmation or notification request in progress

CreatureActorExtended (Full Article)

Represents a an Actor in an Enagement that is based on a GameCloud CreatureAvatarExtended.

CreatureAvatarExtended (Full Article)

Represents an avatar ove a certain creature type

EngagementControlExtended (Full Article)

Represents an multiplayer engagement

EngagementExtended (Full Article)

Represents an Enagement which is a state machine that helps to coordinate complex scripted activities that may include multiple players or bot avatars

EngagementStateExtended (Full Article)

Represents a state in an Enagement which can be configured to allow transitions to other states via triggers

ListingInfoExtended (Full Article)

Provides information about an asset listed in a store

PersonaAvatarExtended (Full Article)

Represents an avatar based for a persona. It will wear the same clothes as the persona and reflect other changes to their avatar

PersonaLayerExtended (Full Article)

Represents a modification layer on an avatar that is shared by all avatars of a given persona. These can be used to change clothing and attachment items and other properties.

PlayerActorExtended (Full Article)

Represents a an Actor in an Enagement that is based on a GameCloud PlayerAvatarExtended.

PlayerAvatarExtended (Full Article)

provides access to the avatar for a participant in the room.

PlayerExtended (Full Article)

Represents a Player, which is the GameCloud's representation of a connected user, the quests progress, achievements, advancement, etc.

RuntimeLayerExtended (Full Article)

Represents a modification layer on an avatar that is specific to a single run-time avatar instance. These can be used to change clothing and attachment items and other properties.


JavaScript DOM Nodes

Remarks [edit]

As above, these are wrappers for C# objects that can be returned from function calls or passed to events. These are all wrappers for DOMObject derived classes implemented by DOMObjectExtended and it's derived classes.

DOMAnimationExtended (Full Article)

Represents a DOMAnimation in JavaScript

DOMControllerExtended (Full Article)

Represents a DOMController in JavaScript

DOMCurveExtended (Full Article)

Represents a DOMCurve in JavaScript. This DOM object represents an animation of the DOM. A Curve is made up of Keyframes with Values. A Player plays the curve and it's properties reflect the values at any given moment along the curve, and can project those values onto other objects in the DOM via it's Selector. You can create a new DOMCurve via the CreateCurve and CreateCurveFromJson methods of DOMObject.

DOMCurveKeyframeExtended (Full Article)

Represents a DOMCurveKeyframe in JavaScript

DOMCurvePlayerExtended (Full Article)

Represents a DOMCurvePlayer in JavaScript

DOMDocumentExtended (Full Article)

Represents a DOMDocument in JavaScript.

DOMGeometryExtended (Full Article)

Represents a DOMGeometry in JavaScript

DOMLightExtended (Full Article)

Represents a DOMLight in JavaScript.

DOMObjectExtended (Full Article)

Represents a DOMObject in JavaScript

DOMPhysicsApproachExtended (Full Article)

Represents a DOMPhysicsApproach in JavaScript

DOMPhysicsExtended (Full Article)

Represents a DOMPhysics in JavaScript

DOMPhysicsFaceExtended (Full Article)

Represents a DOMPhysicsFace in JavaScript

DOMPhysicsFacePointExtended (Full Article)

Represents a DOMPhysicsFacePoint in JavaScript

DOMPhysicsFaceTargetExtended (Full Article)

Represents a DOMPhysicsFaceTarget in JavaScript

DOMPhysicsFollowExtended (Full Article)

Represents a DOMPhysicsFollow in JavaScript

DOMPhysicsOperationExtended (Full Article)

Represents a DOMPhysicsOperation in JavaScript

DOMPhysicsPathingExtended (Full Article)

Represents a DOMPhysicsPathing in JavaScript

DOMPhysicsPathToExtended (Full Article)

Represents a DOMPhysicsPathTo in JavaScript

DOMPhysicsPursueExtended (Full Article)

Represents a DOMPhysicsPursue in JavaScript

DOMPhysicsSpawnAreaExtended (Full Article)

Represents a DOMPhysicsSpawnArea in JavaScript

DOMPhysicsSpawnAtExtended (Full Article)

Represents a DOMPhysicsSpawnAt in JavaScript

DOMPhysicsSpawnExtended (Full Article)

Represents a DOMPhysicsSpawn in JavaScript

DOMRenderableExtended (Full Article)

Represents a DOMRenderable in JavaScript

DOMSceneDocumentExtended (Full Article)

Represents a DOMSceneDocument in JavaScript.

DOMScriptExtended (Full Article)

Represents a DOMScript in JavaScript

DOMTransformExtended (Full Article)

Represents a DOMTransform in JavaScript

DOMVolumeExtended (Full Article)

Represents a DOMVolume in JavaScript