Scripting reference

Previous chapter < Playing back the sequence

Next chapter > More details

In this chapter you will learn how to have your own scripts interact with the MvtPlayer, which is very easy, to either act as controller scripts or plugin scripts (or both).

Of course, basic knowledge about the LSL scripting language is assumed ; but the information described here may also be useful if you want to set up a direct interface with another product like AVSitter's BUTTONs, as described on this page.

Message validation

Interfacing with the MvtPlayer technically means sending and receiving link_message's.

In order to avoid collisions with messages used by other scripts, a convention is implemented and must be observed. For a message to be considered MvtPlayer-related, it must contain (key)"MVTPLAYER" as it "key" (id) parameter, that is the string "MVTPLAYER" (all uppercase) cast to a key:

llMessageLinked(LINK_SET,number,message,(key)"MVTPLAYER");

If your script receives a message originating from the MvtPlayer, it will contain this key value, and your script should check that. If you send a message to the MvtPlayer, it must contain this key value, or your message will be ignored.

Message reference

The following spreadsheet lists all messages accepted and generated by the MvtPlayer. Other messages may exist but it they are not documented here they must not be relied upon as they might change in a future release.

Here is a brief description of the columns in this spreadsheet:

  • Label: this is just a convenient informative label that has no meaning within the scripts. It is just easier to remember "PLAYMVT" than "number 200010". In the fullperm scripts provided with the MvtPlayer system, the message label is always added as a comment where relevant.

  • From: identifies the sender of the message. Here controller means the script controlling the playback of the sequence, MvtPlayer is, well, the MvtPlayer script itself, and Plugin means a script designed to interact with the MvtPlayer to handle the "Plugin action" and/or "Plugin wait" step types. Of course the distinction between controller and plugin is purely a logic one, the corresponding roles can very well be implemented into the same script.

  • To: identifies the script receiving the message.

  • Number: the numerical (integer) part of the link_message. It is used as the primary way to classify the messages: all the messages listed below have different numbers.

  • Message: this is the string part of the link_message. It is used to carry parameters for the link_message designated by the "number" parameter, if any. In case the value has to be cast to string from another type, the original data type is mentioned in parentheses in the spreadsheet (e.g. (integer)).

  • Meaning: gives a short and (hopefully) useful explanation about the message.

Messages supported by MvtPlayer

Of course your own scripts are not required to implement all these messages if they don't need to. Please check the provided full-perm scripts for useful examples.

The MVTSTATUS message is sent every time there is a change in the player status. The following table lists the currently possible status codes and their meanings. Again, the "label" column has no meaning beyond making things easier to read.

Of course, statuses not mentioned in this list might be used in later revisions of the MvtPlayer system.

Status codes

Finally, the next table details the expected syntax for playback options. They may be specified along with the PLAYMVTOPT message. Options not specified will have their default values.

Playback options