SScript

Functions

TypeName

string TypeName (DynValue dv)

Return the type name of the value.

Parameter
Type
Description

dv

DynValue

typeName = Space.TypeName("123")

TrackingAllowed

bool TrackingAllowed (string key)

Function Description

Parameter
Type
Description

isTrackingAllowed = Space.TrackingAllowed('3423423423423')

TrackingRequest

void TrackingRequest (string key, string privacynotice, Closure callback, bool force=false)

Function Description

Parameter
Type
Description

GetResource

SResource GetResource (string name)

Returns a reference to a SResource using it's Resource name.

Parameter
Type
Description

name

string

Name of the Resource as set in the Scripting Runtime Component (Resources section)

LogEvent

void LogEvent (string eventName, float value, SVector position)

Function Description

Parameter
Type
Description

Log

void Log (DynValue text, bool logToFile=false) void Log (string text, bool logToFile=false)

Log a message to console.

Parameter
Type
Description

Properties

Inventory

SInventory Inventory get

Allows access to the users inventory

Persistence

SPersistence Persistence get

Stores information between user sessions, and for other users

Scene

SScene Scene get

Allows access to the current scene graph (objects and avatars in the scene, and other information)

Grid

SGrid Grid get

Property Description

Host

SHost Host get

Access information about the current scripting runtime host

Physics

SPhysics Physics get

Call physics-related commands, and variables, such as raycasting

Math

SMath Math get

Math related functions (Sin, Cos, Tan, etc)

String

SString String get

Miscellaneous additional string functions (e.g. MD5Sum)

Input

SInput Input get

Input device related functions (mouse position, keyboard state)

Camera

SCameraManager Camera get

Take and control the users camera

WebServices

SWebService WebServices get

Call remote web services to designated hosts (will not work with arbitrary domains, see page for details)

Network

SNetwork Network get

Send data to other clients through the region server

PostFX

SPostFX PostFX get

Property Description

AudioAnalyser

SAudioAnalyser AudioAnalyser get

Property Description

Tween

STween Tween get

Property Description

UI

SUI UI get

Property Description

Dialogues

SDialogues Dialogues get

Property Description

Shared

SShared Shared get

Property Description

Quests

SQuests Quests get

Property Description

Economy

SEconomy Economy get

Property Description

Groups

SGroup Groups get

Property Description

Activity

SActivity Activity get

Property Description

RenderSettings

SRenderSettings RenderSettings get

Property Description

Profile

SProfile Profile get

Property Description

Photos

SPhotos Photos get

Property Description

Videos

SVideos Videos get

Property Description

MusicDirectory

SMusicDirectory MusicDirectory get

Property Description

Journey

SJourney Journey get

Property Description

GameTester

SGameTester GameTester get

Property Description

RuntimeType

string RuntimeType get

Return current RuntimeType name.

Platform

string Platform get

Return current platform name.

SessionID

string SessionID get

Return current SessionID.

InEditor

bool InEditor get

Return true if in unity editor.

Version

int Version get

Returns the version of the viewer this script is running in

Resources

SResource[] Resources get

Property Description

Time

float Time get

Returns time at the beginning of this frame.

ServerTime

string ServerTime get

Returns current server time.

LocalTime

string LocalTime get

Returns current local time.

LoginTime

float LoginTime get

Returns how long player has been logged in (in seconds).

ServerTimeUnix

int ServerTimeUnix get

Returns the server time unix timestamp.

LocalTimeUnix

int LocalTimeUnix get

Returns the local time unix timestamp.

DeltaTime

float DeltaTime get

The completion time in seconds since the last frame.

PreviewServer

bool PreviewServer get

Return true if in preview server.

ComponentName

string ComponentName get

The name of this component.