Skip to main content

New ScriptingComponent - 20100221

13 replies [Last post]
morrisford
Offline
Joined: 2008-03-17

I just committed to the preview3 branch a new version of the scriptingComponent. I haven't finished testing and such so treat her kindly. There are a number of changes that make using the old instructions problematic so if you want to try to make things run before I get the docs done, ask and I will answer.

Also, I committed a new scriptingImager module. This is a module I made by modifying an imager module I found somewhere. This one allows for the display of an image from a stack of images with next/previous image under scripting control.

And, a scriptingShape module. This is Jordan's shape tutorial module with scripting control for the shape change. This was a test of adding scripting control of a modules actions to an existing module.

And, a scriptingSatellite module. This a the satellite module with mods to load a model with some overlapping colored panels such that a script can change the color of the panel by visible/invisible changes. This is a first test on the road to making a scripting controlled model that animates in a variety of ways.

There are a lot of docs that I have to create that I hope to have done soon at least to the point of explaining how to use the new modules.

------------------------------------------------------

I just edited the first part of the scripting wiki page to reflect the changes in the way to install the component. At least the first half or so of that wiki page should be ok for this version. The wiki is

http://wiki.java.net/bin/view/Javadesktop/ProjectWonderlandCommunityScri...

Message was edited by: morrisford

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
maggiel
Offline
Joined: 2003-06-10

Yes, there is a JSR-223 engine for Lua:

http://luaforge.net/projects/jnlua/

morrisford
Offline
Joined: 2008-03-17

Next I need to find docs or examples of how to do the following:

Using a reference passed into a script, call a method back in the calling class using both no parameters and parameters.
Using a reference passed into a script, read and write a variable back in the calling class.

That should be enough to get a script to run.

morrisford
Offline
Joined: 2008-03-17

I have been trying to sort out how to get lua to work and haven't really made any progress. In terms of trying to figure out how to get the jsr223 jua interface to work, I can only find quite vague references to the idea that there is a lua scripting engine. I cannot find any reference to what the actual engine jar file is and where it is. I cannot find any information about what libraries are needed, java, native or otherwise. So for now, no lua in the scripting component.

maggiel
Offline
Joined: 2003-06-10

Downloads are available at the aformentioned http://luaforge.net/projects/jnlua/

One scary aspect is that the Lua engine is apparently native code, and thus platform-dependant. I have to question whether this is suitable for use in a JNPL-launched environment like the PW client.

I'm not saying it can't be done, I'm just saying it'd be a PITA.

morrisford
Offline
Joined: 2008-03-17

I found that page but I could find nothing that said what the lua scripting engine jar file is nor what else is needed and how it is organized. I found a little bit of simple sample code. I also found a reference to lua using reflection to get back into java code but I couldn't tell if that referred to the jsr223 interface.

I have tried to deal with native libraries in WL before but was unsuccessful trying to get them to go down to the client as you said.

guest123
Offline
Joined: 2010-05-03

A sample project http://code.google.com/p/ksstoolkit/, is based on lua, jsr 223 lua scripting engine and luajava. Not sure if it helps but no harm checking it out. No good documentation but the source codes are there.

nnjones
Offline
Joined: 2006-09-26

Thanks very much for your hard work, Morris!!! Btw, what's an LUA?

morrisford
Offline
Joined: 2008-03-17

LUA appears to be a scripting language that I had never heard of until today.

matty_x
Offline
Joined: 2008-06-16

Here's the URL for Lua: http://www.lua.org/

What I dig about the scripting implementation is that any jsr-223 language is supported. If I understand correctly, I can stick to what I know. Poor Javascript and PHP hacks are a GO!

jagwire
Offline
Joined: 2008-06-21

morris,

Do you have an architecture document sitting somewhere? I've looked at the article here:

http://wiki.java.net/bin/view/Javadesktop/ProjectWonderlandCommunityScri...

but I still have many questions.

What are the current strengths and limitations of the capability?

Is LUA supported?

So you attach the capability programmatically and then what?

Are there cell component factories to add the scripting component in world? What are the benefits of this?

What applications does this provide beside the "animate this cell when I click on it"?

many thanks,
jagwire

morrisford
Offline
Joined: 2008-03-17

The document you referred to has info and samples about:

Script repository
Intercell communications
Proximity sensing
Socket connections
Object transforms
Scripting languages
Npc interface (old - will be updated)
Mods to Jordan's shape cell tutorial to enable scripting control
Cell creation under scripting control

I don't know if LUA is supported and if it is supported whether there is sufficient documentation and/or samples of interfacing as a jsr-223 language. I have worked out the interfacing for a number of languages but there are some that I was unable to make work. Javafx for example.

With the component attached the cell will respond to events by looking for specific scripts to call to respond to events.

As to your other questions, either I don't understand the question or the answer would be far too large to deal with here. There have been MANY postings in this forum about the scripting component and its capabilities. There was a moderately recent post that listed all the capabilities of the component, for instance.

jagwire
Offline
Joined: 2008-06-21

Morris,

So the component allows cells to invoke scripts and not the other way around?

From my research, it seems as LUA is kind of the "de facto" standard for scripting languages in game engines. While wonderland is not a game engine perse, there are certainly similarities.I find it disconcerting that LUA may have been left out during development.

As far as the scripting functionality, how much access to the world is allowed with scripting in regards to addition/removal of geometry, audio, and shared applications?

thanks again,
jagwire

morrisford
Offline
Joined: 2008-03-17

The scripting component allows cells to designate scripts to react to events.

LUA was not left out in the development of WL or the scripting component. Any jsr223 compatible scripting language can be run through the interface. At the time that I was testing scripting languages I saw no mention of LUA nor did I find any references to it on any of the jsr223 websites. If someone can verify that LUA is a jsr223 supported language and can find enough information to allow me to verify a minimum level of capability in terms of interfacing through the jsr223 interface, it can be easily added as another scripting language.

Basically, a script can call methods in the scripting component and commands in the cell that are exposed via the scripting cell command interface.

You seem pretty grumpy. Did you have a bad weekend?