Q: What is the Scripting Component?
A: Scripting Component is a component for Open Wonderland that
implements a client side scripting environment. A component in the
Open Wonderland environment is a type of plugin that implements a set
of capabilities for a module. A component can be attached to almost
any object in a Wonderland world.
Q: What is the scripting language implemented by Scripting Component?
A: The Scripting Component uses the JSR-223 feature of java to
implement an interface that allows almost any scripting language. So,
there is not one specific language but rather, a variety of already
well known scripting languages.
Q: What scripting languages have been tested with this interface?
A: Javascript, PHP, Groovy, JRuby, Java, Jython and Sleep have been
verified.
Q: Are there sample scripts for these languages?
A: Yes. Another post in this forum will have examples of these
languages except for Java. Java can be used as a scripting language
with this interface but the interfacing to the system is quite messy.
If you really want to use Java, just ask and I'll post a couple of
sample programs.
Q: What is the structure of the scripting environment?
A: The structure of the environment is individual scripts that respond
to events within the attached module. There are about 25 specific
types of events and hence about 25 possible scripts. The scripts are
stored at the Open Wonderland server so that all clients have access.
Q: Why does the scripting component use individual scripts instead of
one single script?
A: Multiple scripts were used as a way to isolate actions to
individual files. Also, in order to allow for the use of different
scripting languages for different events.
Q: How does the scripting component deal with maintaining state?
A: The component has a large number of variables that can be read and
written from scripts specifically for maintaining state.
Q: Are there communications capabilities implemented in the component?
A: Yes, the component has several types of communications
capabilities. There is a socket interface that allows for incoming or
outgoing socket connections. There is an inter-module message passing
mechanism that allows any module to communicate with any or all other
modules. Both of these messaging systems carry a message number and an
arbitrary length string parameter.
Q: How is the Scripting Component connected to a module?
A: There are two ways to connect to a module, through the properties
menu and by calling the component in the Java code for the module. The
code to add the component to a module is 5 lines of code.
Q: Where do I find the Scripting Component?
A: Open Wonderland has a module warehouse at
http://openwonderland.org/index.php?option=com_docman&cat=add_ons&Itemid=123
The Scripting Component is available there along with several
scripting enabled modules.
Q: What is a scripting enabled module?
A: The component has a command structure that can be incorporated
inside a module to allow commands in the module to be called by name
from scripts.
Q: Is the command interface easy to implement in a module?
A: That depends greatly on how the module is implemented. If a module
exposes its commands in the main client side java module, the command
interface can be easily implemented.
Q: What are the command enabled modules available in the module
warehouse?
A: Scripting NPC. Implements a scripting controlled bot. Scripting
Imager. Implements an image display module. Scripting Poster.
Implements a scripting controlled message board. There will be several
more in the near future.
--
Oxana Zhuravlyova