Example Script: Stats Example

The example script, Stats Example (StatsExample.cs), can provide useful statistics about the current experience. Grab the file from the download link at the end of the page. 

Here is a step-by-step guide to using the script:

  1. In the My Experiences app, choose the scene you want to edit and click the Edit Scene edit_icon_sm.png button.
  2. If you already have the file in your inventory, jump to step 3 to start using the script. Otherwise, download the StatsExample.cs example script at the bottom of this page and upload the file into your inventory. See Uploading and Applying Scripts for more information.
  3. Now that you have the script in your inventory, choose an object in the scene that you want to apply the script to.
  4. Select the StatsExample.cs file from your Inventory and drag the script onto the object in the scene.
  5. Since this script has no special parameters to set, your script is ready. Save and build your scene.
  6. If you want to verify if the script is running correctly, visit the built scene.  
  7. While visiting the scene, open the Chat app.
  8. In the chat field, enter one of the commands listed below in order to get the desired information.
Command Returned result
/help Provides information about the other commands.
/fire Causes you to fire a cannonball.
/xpinfo Provides information about the current experience, including name, IDs, and more.
/listagents Lists all agents currently in the scene.
/mypos Tells you your current position within the scene.

 

Creative Commons License

This content is licensed under the terms of the Creative Commons Attribution 4.0 International License. When using this content, you must:

  • Acknowledge that the content is from the Sansar Knowledge Base.
  • Include our copyright notice: "© 2017 Linden Research, Inc."
  • Indicate that the content is licensed under the Creative Commons Attribution-Share Alike 4.0 International License.

Include the URL for, or link to, the license summary at https://creativecommons.org/licenses/by-sa/4.0/deed.hi (and, if possible, to the complete license terms at https://creativecommons.org/licenses/by-sa/4.0/legalcode.

For example:

"This work uses content from the Sansar Knowledge Base. © 2017 Linden Research, Inc. Licensed under the Creative Commons Attribution 4.0 International License (license summary available at https://creativecommons.org/licenses/by/4.0/ and complete license terms available at https://creativecommons.org/licenses/by/4.0/legalcode)."

Download Link:

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.