Scripting Getting Started 2017


Any suggestions on getting started with this?

I found these example scripts (quite complex for getting started)

Javascript API Reference (is this obsolete and should I believe it?)

Found this category in the wiki (old or useful?)

Is there any introduction in video format or people that meet regularly to discuss how to do this?



There isnt any uptodate spec, unfortunately, and even some scripts are out of date. Most of the time, I’ve had to dig around the source code to get most of the info out for what is supported, and what is doable: Some of them I’ve compiled into my own framework and library.

Otherwise, best source is to talk with us here on the forums.

Here is a thread I have about scripting, if you have some experience with programming/ scripting / js

We did have javascript meets every now and then. I wonder if we should have another one someday this week.


Perhaps what we need is an update on the latest scripting APIs with annotations on their limits/bugs. It is something that could be produced automatically aka doxygen or other similar interface auto-documenting frameworks.


I would love to meet up any time, just let me know. Does anyone have an example of an absolutely simple call to move one of the avatars limbs… say raise an arm up in the air or something like that?


I suggest looking up an archive-script called crazy legs. It makes the legs move silly procedurally using a sine on a quaternion. More recent one that isnt archived (which should work, havent tested the crazy legs for a while), is the chair script

A simpler method to play back an existing animation such as using MyAvatar.overrideRoleAnimation or MyAvatar.overrideAnimation


The wiki entries for the javascript api are rather incomplete.

For instance until I added some a few days ago there was no mention of the Menu api stuff.

As far as I can tell, they are “accurate”, as in, the methods described there exist and work as described, but it’s possible mistakes have crept in. They are however as I said, incomplete.

On a side note, atleast for the client side (interface) scripting i made a quick bit of code to dump available Objects and methods to the console.

thing = {};
for (name in this) {
	var nam = name.toString();
	thing[nam] = Object.getOwnPropertyNames(this[name]);

The output


See also the script, currentAPI.js, included in High Fidelity.


When loaded, it crashes Interface.


So it does! It used to work not so long ago. I’ve entered a bug report about it crashing Interface.


I noted it on Dang crash reports a few days ago. wonders what the cause would be.


It seems to be something to do with typeof for me.

I tried wrapping it in a try catch and printing every line taht it typeof’s to the log immeadiatlym try catch ddin’t help, but it crashes after the steam stuff, (atleast for me).


currentAPI.js crashes when trying to reflect Steam.isRunning. Until this is fixed, here’s a modified copy of currentAPI.js that works around the problem:


Yaay… thanks David, I was going to look at that script but is just another thing on a long list.