this is a work in progress and it's based on Morris' tutorials. Please feel free to contribute!
Bots 101 -- This page is intended as an introduction to the scripting module, including Robot functionality.
General information#Scripting is being developed as a module by Morris Ford. Both community servers are scripting enabled, but for a personal server the module will have to be installed if you want to use it.
There is a series a guides and classes written by Morris that can be accessed here.
Introduction#This tutorial describes the scripting module and how it can be leveraged to script models within an open wonderland world.
Please note that the scripting module is a work in progress and some of the things exposed here might change, especially if you are using the latest version of OWL from source.
The tutorials in this series were written using the information in the original scripting classes by Morris Ford, linked at the top of the page.
The Scripting module#
The scripting component is being developed by Morris Ford. It is intended to provide a layer of 'in-world' programming to the virtual environment. This means that all the programming can be done within the world by using the set of tools provided by this component, without having to worry about development of modules for Open Wonderland itself, which are programmed using Java.
A typical scenario could be to animate a model in-world, for instance, to make a cube spin around when touched. The component also provides support for:
- Instantiating models
- Audio playing
- Inter cell communication
- add some more here
- tons more that we will discover through the tutorials
Installation#The easiest way to install this module is using a binary download from the module warehouse. Add a bit more here........
Binary Install, Module Warehouse#The module warehouse is a facility that allows developers to share their modules and users to benefit from the functionality of those modules. And some more as in... go here and grab the module, then install using the web app. Screenshot of the webapp.
Installing from Source#If you are not using Open Wonderland from source code you can safely skip this section. Here... explain the ant deploy, as in any other module...
Add a Note: Some of the functionality with regards to NPCs uses authentication so that has to be set up before being able to use it. This will be dealt with in other tutorials.
How to get scripting working#
The module resides in the unstable branch of the wonderland-modules repository. It can also be downloaded from the Module warehouse. sep_2010
Installation is done as with any other module. From source you can use 'Ant deploy'. From the web interface just browse to the jar downloaded from the module warehouse and click on install.
Troubleshooting#A few tips on how to troubleshoot problems with the scripting component.
Problems with scripting in Windows platforms.#
Solution taken from and email from Nina: Please note that the scripting component used to be triggered with the key 'p' before a context menu was added.
If this is the windows “p” issue, what I did was to associate the .jnlp file extension with the javaws.exe in the jdk\bin and not the jdk\jre\bin directory. [...] An easy way to make the file association is to go into the browser tools menu in Firefox (Tools > Options) and click on the applications tab. Scroll down to the jnlp file and click the pull down and select other… Then browse to the jdk\bin\javaws.exe file. -Nina-
Problems in Windows 7#The above solution seems NOT to work on Windows 7 platforms. This is another work around that should work.
Step1: Launch the javaws viewer from command line (or any other way!):
Step 2: Move to the Java tab and click on the view button:
Step 3: By default, the JRE will be selected, as you can see in the picture:
Click on find, navigate to your JDK folder and select this folder. The system should automatically find and add the JDK to the list. Now you can un-tick the JRE line and make your JDK the default one.
Wonderland will have to be launched again if you were still running it. Next time you run it, JDK's javaws should be default and the scripting editor should pop up.
Missing scripts reported in console#
Some errors will show up in the console regarding scripts not found, similar to the following:
ScriptingComponent : Cell 1 : Script file http://xxx:8080//webdav/content/scripts/garden_arches/mouse3.js not found
These are not really errors, but warnings that the scripts do not exist. Can be ignored (they will disappear if scripts are generated for those actions).
- how to use the Robot panel of the scripting window
- tips on how to use the scripting window
- working through the scripting tutorials
- Issues and known gotchas: such as the 'P' issue in Windows
Add new attachment
List of attachments
|Kind||Attachment Name||Size||Version||Date Modified||Author||Change note|
|jre_selected.png||12.6 kB||1||01-Feb-2011 18:01||Josmas Flores||jre selected|
|launch_javaws_viewer.png||8.3 kB||1||01-Feb-2011 18:00||Josmas Flores||launching the javaws viewer|
|runtime_view_button.png||11.2 kB||1||01-Feb-2011 18:01||Josmas Flores||runtime view button|