|
Replies:
48
-
Last Post:
Oct 6, 2008 12:20 PM
by: morrisford
|
|
|
|
|
|
|
Scripting with WL 0.4
Posted:
Sep 19, 2008 5:23 AM
|
|
|
Hi,
A feedback we often get is that WL (0.4) is "interactive with the virtual world" only through a fixed set of applications and with code development needed for the rest, ie nothing is provided for allowing general users to assign behaviors to objects and interact with these objects. Also it might last several more months until general users are able to use scripting with Wonderland (0.5 User Version).
For this reason I was thinking that it could be useful to the whole community to work together on temporary solutions for "interactions" based on 0.4, for instance:
- has anyone though on using the JSR-233 scripting APIs built into Java to make a script-enabled cell type ?
- what about creating a library of pieces of code which allow "interactions" with objects and associated actions ?
Let me know your thoughts, -michel
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 19, 2008 6:41 AM
in response to: micheldenis
|
|
|
I would be interested in participating in that process. I will start looking at jsr-233 a bit. What kind of things do you see as being 'scriptable'?
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 19, 2008 7:58 AM
in response to: morrisford
|
|
|
Hi Morris,
You like all the good things isn't it ? (just joking..)
Some time ago I entered a post on scripting: http://forums.java.net/jive/thread.jspa?messageID=261514
but things there are general and probably too much for a 0.4 Core Scripting module or so.
My ideas are:
- detect Mouse Left click and Mouse Right click events on selected objects
1- for Mouse Left click, initiate associated Action (defined for object)
2- for Mouse Right click, create a display of Menu items 2.1- on Click for a menu item, initiate associated Action (defined for Menu Item)
- Action could be for instance to bring a Display with defined Text, both static text and selectable URLs that user can click on.
What do you think ?
-michel
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 19, 2008 9:25 AM
in response to: micheldenis
|
|
|
In some of my experimenting I made a modified SimpleTerrainCell that handles mouse clicks and client to server messages. That with some simple mods I made to the WFSCell bits enabled me to click on an 'item' in world and receive back the wfs file name of that cell. I use that to work on the cells in a world without having to spend huge amounts of time trying to tie together the item and the wfs file. Anyway, the mods could be easily adapted to be the start of the scripting stuff you are talking about.
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 19, 2008 9:53 AM
in response to: morrisford
|
|
|
Yes Morris, this looks like an excellent foundation. Though I'm not a good programmer, I'd like to help on this!
-michel
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 19, 2008 10:12 AM
in response to: micheldenis
|
|
|
One important piece that I/we need to figure out is the linkage for an object(cell) to move itself in-world. This has been on my list of things to figure out for a while but I haven't gotten to it. When I get that figured, I could create a sample cell that does some arbitrary motion with each mouse click. Then it would be a fairly easy step to storing a simple script that defines actions for keystrokes/clicks.
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 19, 2008 12:23 PM
in response to: micheldenis
|
|
|
Jagwire, the iSocial developer, has created a custom cell type that detects mouse clicks on an object and sends associated messages to the server.
More specifically, the cell displays an image of a video. When the image is clicked, that video begins playing in a video player cell.
We're planning on checking it in to the incubator as soon as we find the time.
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 19, 2008 12:51 PM
in response to: matty_x
|
|
|
I have a cell now that responds to a mouse click and executes a basic javascript script so basic capability is there. Now I just have to figure out how to put the 'cell' in motion. Anybody could head me in the right direction?
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 19, 2008 4:45 PM
in response to: matty_x
|
|
|
On Fri, 2008-09-19 at 12:23 -0700, wonderland@javadesktop.org wrote: > Jagwire, the iSocial developer, has created a custom cell type that detects mouse clicks on an object and sends associated messages to the server. > > More specifically, the cell displays an image of a video. When the image is clicked, that video begins playing in a video player cell. > > We're planning on checking it in to the incubator as soon as we find the time. > [Message sent by forum member 'matty_x' (matty_x)]
Yup, gotta have that one. It wouldn't make sense to try to teach someone who walks into a room by himself with the lecture half over. Thanks! Ric
-- ---------------------------------------------------- My father, Victor Moore (Vic) used to say: "There are two Great Sins in the world... ..the Sin of Ignorance, and the Sin of Stupidity. Only the former may be overcome." R.I.P. Dad. Linux user# 44256 Sign up at: http://counter.li.org/ https://nuoar.dev.java.net/ Verizon Cell # 434-774-4987
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 19, 2008 4:43 PM
in response to: micheldenis
|
|
|
On Fri, 2008-09-19 at 07:58 -0700, wonderland@javadesktop.org wrote: > Hi Morris, > > You like all the good things isn't it ? (just joking..) > > Some time ago I entered a post on scripting: > http://forums.java.net/jive/thread.jspa?messageID=261514 > > but things there are general and probably too much for a 0.4 Core Scripting module or so. > > My ideas are: > > - detect Mouse Left click and Mouse Right click events on selected objects > > 1- for Mouse Left click, initiate associated Action (defined for object) > > 2- for Mouse Right click, create a display of Menu items > 2.1- on Click for a menu item, initiate associated Action (defined for Menu Item) > > - Action could be for instance to bring a Display with defined Text, both static text and selectable URLs that user can click on. > > What do you think ?
Sweet!! LONG AGO, in the way-way-wayback time machine, we used to run a full blown MUD. Users edited their own part of the world, which was called a domain. Within each domain were lots of user creatd scripts that defined a room, the objects in it and what they could do. We had some pretty clever users, one made a slot machine that behaved according to the real-world rules of how a slot would roll the slots and the percentages of payouts. It paid off in gold or electric shocks. Clever as heck, THAT part that you are describing is gonna be the fun part, where we and the users/developers get to show off. I'm still flaying away at getting apache served with the worldbuilder. <grins> I keep blowing up the OS with tar-ball installs. Not going there again. Ric -- ---------------------------------------------------- My father, Victor Moore (Vic) used to say: "There are two Great Sins in the world... ..the Sin of Ignorance, and the Sin of Stupidity. Only the former may be overcome." R.I.P. Dad. Linux user# 44256 Sign up at: http://counter.li.org/ https://nuoar.dev.java.net/ Verizon Cell # 434-774-4987
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 20, 2008 5:30 AM
in response to: Ric Moore
|
|
|
After thinking about scripting overnight I have a list of todo's and some questions. My goal at the moment is to provoke discussion and to very quickly get to a minimal cell that can load and run a script, like in the next few days if possible. I am a firm believer in letting a prototype develop the design.
Todo: The test script I ran was javascript using the built in engine. I am going to get another engine working, probably python.
I want to try a script that does some swing stuff to see what it does.
I think one of the first things that would be useful would be to decide where to keep a(some) script(s) for a cell on disk so I have to look at what the cell has access to in the WL file structure.
I need to set up some mechanism for creating/editing the stored script(s). I'll see if I can find a simple editor written in some scripting language to use for that.
Questions/Assumptions: My assumption is that the scripting will probably be client based for now with a possible(probable?) server side component. If the scripting is to create/modify WFS entries, there will have to be a server side component.
There will probably need to be an 'action layer' created that the client scripts talk to to perform actions. This would simplify the enabling of a variety of script types to talk to the WL structure. Goal here is to allow the 'user' to arbitrarily select whatever scripting language is desired as long as it works in the jsr-223 structure.
I think allowing free running scripts would be very useful if not mandatory. Doing things like taking actions based on proximity would be very difficult without a script that probes occasionally.
At the moment I have this scripting in a cell type that I created based on Jordan's tutorial. I could fairly easily implant the changes into the SimpleTerrainCell that I modified. Question is: what route is desired, scripting in a unique cell or in a generalized cell.
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 20, 2008 9:20 AM
in response to: morrisford
|
|
|
Hi Morris,
I increasingly see scripting as the most missing feature of WL 0.4 -- it is great that it has retained so much your attention!
Some thoughts and feedback (humbly and quickly...):
- scripting language: Paul Byrne will implement scripting for 0.5-- he said it might be Jython (close to jME) or Javascript (close to Java) if I remember. Python is fine too and used in several high profile gaming engines (and yes again-- gaming engines usually have a scripting engine to help advanced users versus developers).
- scripts location: I am not sure whether a Wonderland admin would like users to define their own script hence modifying the behavior of the world and its objects (aka cells or so). Maybe the server side could be prefered, with access by user in read/exec mode. The location of the scripts could perhaps be pointed by a variable in my.run/build.properties ? Initially of course it could be a fixed name and location.
Michel
- creating/editing the scripts: if the script is plain ASCII text, one could chose their prefered editor including dtpad, vi, emacs, wordpad,..
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 20, 2008 9:58 AM
in response to: micheldenis
|
|
|
So far this morning I have:
Gotten a jython(python) script to run. Run a javascript script with a small embedded java swing app. The swing app displays on the client screen on top of the client window (I assume it is not in world). Run a script from disk. Placed a script inside the structure served as the wfs world as pointed to it out of the properties and then ran it successfully. I have to work on this a little more to get a good file location and name nailed down. The assumption I am operating under is that a cell (object) has to have it's own unique script(s) and the only thing I know of that is unique to a cell and stays the same across server restarts is the WFS filename and path so I'm using part of that path as a unique identifier.
So...at the moment with this cell type a script can be stored and executed on a mouse click. Now, what do we do with it. To run it as is (using the WFS filename) requires some core WL changes and putting my cell type into the wonderland-modules structure. I will have my test world back on-line this week and we could experiment there. I would like to have people start creating and running scripts to see what exciting things appear. However, I still need to figure out how to get a cell to change things for the displayed object like rotate or move over there.
Several things that I have encountered so far:
I have not found a way to have a script execute a method in the java code that called the script. The script would want to call methods in the java part to cause actions like moving the object. A script can be allowed to modify data in the java program so a linkage like this could work, 1) set up a data space for the script to put data into, 2) call the script, 3) script decides what action(s) are desired, 4) script places info into the allocated data space indicating desired actions, 5) script returns, 6)java performs desired actions.
A tighter linkage between the two than this would appear to require the java program call the script and not expect a return except in the form of data placed in a shared space. Looks to me like that would require getting down into the innards of the client cell code and creating a couple of threads to deal with the scripting.
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 20, 2008 11:56 AM
in response to: morrisford
|
|
|
Hi Morris,
In your implementation, what can the script activate ? which functions, and how ?
-michel
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 20, 2008 12:15 PM
in response to: micheldenis
|
|
|
As far as I can tell, the script cannot activate anything directly. The script can tell the java code to activate things. So, the script could activate (indirectly) anything that the java code part of the cell could activate.
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 20, 2008 12:50 PM
in response to: morrisford
|
|
|
And what could activate the java code part of the cell, Morris ?
For instance can it easily open a panel with a text or a menu itemlist ?
-michel
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 20, 2008 1:21 PM
in response to: micheldenis
|
|
|
The things that I know about that can cause the java code in a cell to activate would be a mouse or key action and a message from the server side. The java code then would initiate a script. The script could take whatever actions including displaying a screen or a menu. The script would then, on exiting, notify the java portion of the cell what actions are desired. This is my understanding of the possible linkage after a few hours of examining this kind of client side scripting.
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 20, 2008 1:24 PM
in response to: morrisford
|
|
|
Maybe the Wonderland developers team could provide some lights here, to help ?
-michel
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 20, 2008 2:14 PM
in response to: micheldenis
|
|
|
I agree. Their help would be quite valuable at this point. A little bit of guidance from the developers has helped me greatly with other things that I have tried to do. I would really want anything we do in this direction to complement their efforts in 0.5.
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 22, 2008 12:24 PM
in response to: micheldenis
|
|
|
I have worked out how to get javascript to call a method in the host java program that called the javascript. Confusing enough? This opens up taking WL actions from inside a script. I also found javascript code for starting a thread so I am going to be experimenting with creating a free running javascript to see if that new thread running javascript can also call methods back into the original java program. Now I just need to figure out doing object manipulations(move, rotate, etc). I'm looking at MoveableCell for that stuff.
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 24, 2008 1:43 PM
in response to: micheldenis
|
|
|
I now have a cell that can move itself based on commands from an embedded javascript. I will be creating a bit of a demo and putting it out in my test world in the next few days.
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 24, 2008 1:50 PM
in response to: morrisford
|
|
|
That's great Morris! Wish this all could be included in an off-the-shelf binary built like 0-4-1 ?
-michel
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 24, 2008 2:19 PM
in response to: morrisford
|
|
|
Morris,
This really is terrific! Thanks so much for this contribution -- everyone on the team really appreciates it. We have been heads down on 0.5 these past few weeks, so sorry that we haven't participating in this discussion more.
I think your thinking through this is right on. JSR-223 is nice because it lets anyone use the scripting language of their choice. (it would make a terrific demo to show the same "moving" code in both javascript and another language...). The scripting language takes care of the logic, what's left is deciding the set of methods that we'll provide as an interface to actuate stuff in Wonderland.
Certainly, in terms of events, mouse and keyboard events are two necessities and a great place to start for now. More examples, which you have touched on, are proximity events and perhaps audio events (e.g. do something when someone starts talking within a certain distance).
Next, we'll need to decide how we'll allow the scripting to affect the world, e.g. moving cells. Certainly every cell type may provide its own set of actions that scripts can call upon. (For v0.5, we are planning for a "component" style architecture where all cells that wish to support moving can include the "movable" component.)
You touched upon another important issue -- where do scripts get stored? We can certainly make room for them in WFS, I agree that every instance of a cell may want its own script. How someone creates scripts is another story -- eventually, we'd like to integrate with an IDE such as Netbeans that has development support for scripting languages. But for now, a text editor and dorking with the WFS is a good place to start.
Suppose I write a script, where I click on an object, it spins around and around. Does my client just see that? Or do all clients see the action? I can think of cases where we may want either.
Anyway, I don't think I'm adding much to the discussion above, because I think you are doing the right things. I'm really looking forward to your demo and learning how you did this.
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 24, 2008 6:12 PM
in response to: jslott
|
|
|
Let's see. I have a working demo script in javascript and one in python. I will just need to make the demo move code that I am going to make work in both.
I already was planning to make a layer of possible actions that the scripts could use, both to limit somewhat what can be done from a script and to simplify the interface. I suppose some enabling configuration for the actions would be easy enough to do.
I was thinking about a mechanism where an 'init' script could register callbacks for a variety of events if desired. I would want to have a structure where an arbitrary event could be linked to a callback.
The mechanism I have right now is that the scripts get stored in a directory that reflects the canonical wfs file name so that the scripts can be unique by cell instance. I think it would be important that a script is accessed at run time so that mods can be made at any time.
Seems like the message to server would determine if other cells see the motion. That also could be readily configured.
One thing not touched on is getting a mechanism working for putting the motions into the wfs files so the changes are retained even for a restart from wfs. I am going to start experimenting with turning on the retention of the database again soon but I think it is going to be important to get the wfs to reflect the current condition of the world. Another piece that I have in process is to create a j3s.gz file and wfs xml directly from a cell program. I am just going to be able to create a cube of arbitrary dimensions with texture on one or more faces at first just to prove concept. The ability to poke that wfs file into the wfs structure and the model into the repository for models and reload the world would be vital to make that work right. Once the model(s) is(are) registered and displayed the moving stuff would allow for rearranging things to allow in-world building.
|
|
|
|
|
|
|
|
Something maybe simple but essential
Posted:
Sep 28, 2008 7:33 AM
in response to: morrisford
|
|
|
If we can spend the time thinking at essentials which are missing in WL0.4 in comparison to the strong SecondLife/OpenSim/RealXtend high speed train, one is the following scenario:
- a user clicks on an object - a text window opens (out of the world, ie on the user's screen) which types the content of a text file - sometimes for info complement, that text contains a URL that the user can click on to open that web page
The above seems to be a very simple script (especially because it does not make changes in-world) but essential for the business value of Wonderland ! Looks like Javascript/HTML can do the work.
Any possibility this could be added to bring a minimum of interactivity to WL0.4, instead of waiting several months to get WL0.5 User version on the road ?
-michel
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Sep 28, 2008 8:01 AM
in response to: micheldenis
|
|
|
I was just now finishing adding the first set of scripting demo stuff to my test world. The password I set up for you should still work.
That test world also has the 40 buildings that I was using for performance testing so you may want to adjust your back clip setting to keep your system from freezing up. I use a setting about 15.
When you enter the world, immediately behind the avatar is a wall made up of four panels. Each panel is set up with scripts to respond differently to left and right mouse clicks. I have created a mechanism in the cell code and in the scripting that allows for animation of the type seen here. The scripting is also able to run in javascript or jython. It is set for javascript right now.
The mechanism you are talking about should be doable as the scripts can start up java swing components that display on the local client screen. I have done only a little work with this so far but having a script start up some kind of dialog and then capture the input in the script and act on it is one of the things on my list.
I will try to get a description of how the scripting that I have implemented works real soon now and then anyone who wants can experiment in my test world. The scripts are all on disk with each instance of a cell with it's own set of scripts and the scripts are read from disk for every execution so they can be changed at any time and affect the cell as soon as changed.
The world is up now although I have to leave and will not be back for a while.
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Sep 28, 2008 12:27 PM
in response to: morrisford
|
|
|
Hi Morris,
I visited your test world, and yes it is interactive! The snow mountain picture turning into a sphere, the back picture opening its door etc ... Great! Did you try opening a local (out of world) window with text printed ? a URL to click on ?
-michel
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Sep 28, 2008 5:26 PM
in response to: micheldenis
|
|
|
Thanks for trying it out. I made a couple of changes: I changed the texture on one of the panels and I attached a new script to the left mouse button click for that panel. The script now displays a simple swing app that displays a button, a label and a text field. If you click on the button the label changes. If you type something into the text box and press enter a message will be displayed in the java console, if you have the console enabled. This app is implemented fully in the mouse.js javascript.
If you could be a little more specific about an example of text displayed or some other app, I will see if I can do it in a script.
Once again, I appreciate your feedback.
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Sep 28, 2008 6:19 PM
in response to: micheldenis
|
|
|
I also added a new script for the mouse right button click. This one shows a swing app with 4 text inputs and two buttons. Replace the x, y, z and rotation fields with numbers and press Move and the panel will move according to those parameters. The bottom button will place the panel back to it's original position.
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Sep 29, 2008 1:02 AM
in response to: morrisford
|
|
|
Hi Morris,
I just tested the 2 scripts (left and right click) on the new center image and they behave exactly the way you describe them. Excellent.
I'm sure that what you did is useful to many people in the community. Especially if they are "generic" ie if all can be coded in Javascript (ps file), which seem to be the case.
The typical simple example that is important to have is the following: when a user left clicks on an object, it opens a small window (in Swing for instance) and types a text of say 20 lines, which will include one or more URL(s). The 20 lines of text could either come from a text file or from the Javascript script (your choice).When the user clicks on one of the URLs, then a window opens with the corresponding web page, and the user can surf etc... Of course the text and URLs depend upon which object was clicked.
If you can make it (and I'm sure you can Morris) then we can look to the right click, which people would expect can open a list of Menu Items according to the object (in the Swing window for instance), and when the user picks an item it starts some action accordingly... Anyway this is very similar to what you already have implemented, I think.
An short example: when the user clicks (left click) on your snow white image, it opens a small window which says: "This is one of the most beautiful pictures of mountain with snow. It is located in the Alps and the height is more than 4000 meters. People can ski on it. For more information and plan your trip there please click on following link: http://www.pays-mont-blanc.com/ . Have fun!"
Maybe the difficulty would be to allow such behavior for any object the user wants to select ?
Many thanks, -michel
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Sep 29, 2008 5:33 AM
in response to: micheldenis
|
|
|
Great! Thanks once again for testing. The scenario you describe should be readily done and completely in scripting. Since all java classes are available to the scripting engine, constructing a text screen with url's that link to a 'browser' could be built. I don't know exactly how I would do all that since I haven't experimented with implementing a java based browser.
That leads right into the next thing, i.e., even though the scripting out of a cell is not 'finished' I will put the code out so that people can start creating the scripts that they would like to have. I see several options: 1) Put the code in the incubator in 'test' version to be updated later. Problem with this is that there are a couple of core WL changes and that there is a new module that implements the test scripting interface. Trying this out would be difficult for many people. 2) Allow anyone that wants to to access my test world to work on scripts. I plan to do this with whatever other release method is employed. 3) Create and set up for download binary and source versions of the version I am currently testing with. I would need some help with building these releases if this choice is desired. 4) Give the changes to the Sun dev group to integrate. Probably not a good idea at this point since too much resource would be required to deal with a forked release and then re-integration.
Soooo, a little advice from the dev group would be in order. I personally like the path of allowing access to the test world that is running the code and set up for download a 'Morris' release that would be available until the whole thing could be integrated into a 0.4.1 official release.
I will try to have some documentation today of the scripting structure as it exists currently. Also, anyone that would like to test should send me an email at morrishford 'atsign' gmail 'period' com. I will set up cell(s) for anyone that want so they can write and experiment with their own scripts.
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Sep 29, 2008 7:50 AM
in response to: morrisford
|
|
|
That's great again .. let's say Wonderful! With this scripting functional capability, one of the 3 key technical issues for Wonderland competitiveness (avatars quality, inworld building tools capability and advanced user scripting) will be solved.
However to be really used by the community it will need sometime in the future to be part of binaries (at least for Linux and Solaris)-- there are so many people in the community around who (just like me!) tend to only install binaries. I hope that the WL Dev team can help you with this, for a 'Morris' download except it it can be part of a 0-4-1.
Concerning the launch to the URL, what about calling HTTP and opening a firefox web browser window ? But I'm not sure it is so simple..
Your documentation will be very useful-- please include all Javascripts scripts that you use as examples 
Once I can download a Solaris binary I will experiment with several Javascript script and provide the examples to the community.
Thanks, -michel
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Sep 29, 2008 7:54 AM
in response to: micheldenis
|
|
|
Just a note.. but the JSR 223: Scripting support for Java requires Java SE 6. No?
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Sep 29, 2008 8:07 AM
in response to: Jordan Slott
|
|
|
Yes, jsr-223 is in 1.6 versions.
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Sep 29, 2008 9:42 AM
in response to: morrisford
|
|
|
Creating a branch of the 0.4 workspace for scripting is probably the best approach. I'll be in touch.
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Sep 29, 2008 5:27 PM
in response to: morrisford
|
|
|
[nobr]Hey guys, Been following the thread with great amusement because I'd been expecting to implement this very thing :-D (love it when someone else does my work for me ) If there's anything I can do to help, let me know! (yes, that includes code.) Obviously, I'm keen to get a copy of the diffs so I can start experimenting (or I guess I can wait to pull them from the branch once set up!).
A few as-yet poorly-researched thoughts came to mind: - security - 'action layer' - script location - messages
What were your approaches to recalcitrant scripts? Is there a way of sand-boxing within a SecurityManager? Useful option for us paranoid people? 
Re. your 'action layer', I guess you're passing in as a Bindings instance populated with sufficient WL classes to do stuff. I guess this is a Mediator pattern and wondered if you'd considered using Boudreau's Capabilities [1] pattern to allow extension (e.g. for modules and/or other scripts to expose their stuff).
On script location, I'd wondered if we could include from-URL scripts? This gives the neat advantages of letting you generate dynamically behind a web call and might boost exchange of scripts via URL (community anyone? Yeah yeah, I know we'll need to re-write for 0.5 ... but it's still a neat idea!).
Lastly, what were your thoughts on Messages? I suspect scripts will want their own Messages but won't be able to define. As such, perhaps a new ScriptMessage is needed with some cunning wrapping, peeking and unwrapping as necessary.
Cheers, Rupert.
1. http://weblogs.java.net/blog/timboudreau/archive/2008/08/the_capability.html[/nobr]
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Sep 30, 2008 5:48 AM
in response to: rkd
|
|
|
Hi Rupert,
ref. "If there's anything I can do to help, let me know! "
One area that we will need help is to produce Solaris and Linux binaries containing this scripting package. Otherwise it will stay "confidential" and not used a lot by the community. Would it be possible ?
Thanks, -michel
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Sep 30, 2008 6:06 AM
in response to: micheldenis
|
|
|
> I spoke with Morris yesterday and he is going to email me the changes he needs to be made to the core. If the changes are small and don't seem like they would affect much, then we could perhaps put them into a 0.4 branch to allow scripting as an extension.
It's been mentioned here before, but the core team does not currently have plans for a 0.4.1 release. It takes a tremendous amount of effort to put together a release, and we are focused on 0.5 development. However, that does not preclude a community member from rolling their own binary release for experimentation and certainly the core team is available to guide anyone wishing to do this (but again, we are focused on 0.5). All of the build scripts to make the binary releases are already in the workspace, so it shouldn't be that difficult for a community member to generate binaries.
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Sep 30, 2008 1:37 PM
in response to: micheldenis
|
|
|
Hey Michel, I'm not clear what binaries could be involved that are platform dependent (?) but, if it helps, sure. I have Ubuntu and OpenSolaris running -- the prior's probably useful, the latter only good if users are on OpenSolaris or later (not Solaris 8, 9, 10) due to forward-compatability guarantee of library changes. HTH (although I don't know if it does!), R.
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Oct 1, 2008 3:17 AM
in response to: rkd
|
|
|
Hi Rupert,
What would be nice would be to have the following files for download on the Wiki or Web site: - WL Linux - WL Solaris - War file (the large file version) with a name like "0.4 with scripting" -- this interactivity with the easy Javascript customization bring Wonderland to new heights! People will like to download and run, without the uncertain aspects of re-building..
If you could help with Morris to make this happen it would be so great!
Many thanks in advance, -michel
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Oct 1, 2008 5:39 AM
in response to: micheldenis
|
|
|
The scripting support is now fully in a module and does not require any core WL support. That makes it possible to have the whole release in the 'module' that I will be putting into the module incubator place in the next few days. That will allow anyone running a source version to insert the scripting module into the wonderland-modules directory structure, compile and run. I have Windows, Ubuntu, Mac and Open Solaris environments and plan to create and host binaries for at least the first three as time permits. I am dealing with this as a prototype and written proposal that is intended to be a generator of comments, suggestions, corrections and code changes. I would like to flush out a set of enhancements for the next version and the next. In addition to being scripting support for version 0.4, this effort is prototyping and development of scripting support for version 0.5 and beyond. I am trying to get the code into not quite so rough condition and get the written part done so that I can get the discussion/experimenting started.
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Oct 1, 2008 9:22 AM
in response to: morrisford
|
|
|
> Great! Thanks once again for testing. The scenario > you describe should be readily done and completely in > scripting. Since all java classes are available to > the scripting engine, constructing a text screen with > url's that link to a 'browser' could be built. I > don't know exactly how I would do all that since I > haven't experimented with implementing a java based > browser.
Ah... but through the wonders of open source, you should see that we've had some students working on building an HTML viewer (and Nigel's built an SVG viewer). They're both in the modules incubator project, so it sounds like you'll be neighbours!
cheers
(BTW, I think this is pretty damn fantastic)
Bernard
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Oct 3, 2008 8:08 AM
in response to: bernard_horan
|
|
|
I have just placed the scripting proposal in a Google doc at address http://docs.google.com/Doc?id=dfd5c56j_1fjp5j9fx
I will put the scripting module in the incubator this afternoon.
For now, have a look at the document and please comment.
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Oct 3, 2008 8:15 AM
in response to: morrisford
|
|
|
Hi Morris: could you provide us with read access to the document ?
Thanks, -michel
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Oct 3, 2008 10:50 AM
in response to: micheldenis
|
|
|
I think I just did that by answering the email and granting collaborator permissions. Hope so anyway. Let me know.
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Oct 3, 2008 11:29 AM
in response to: micheldenis
|
|
|
Ok, I have checked the module into the module incubator, at least I think I did! The module is under the apps/3d directory and is called SimpleTerrainCellMHF. It is a modified SimpleTerrainCell with all the scripting stuff added. There are several sample files and a README in that directory that should explain enough to get started. All that should be required is to put that directory in the same relative position in your wonderland-modules directory (source release required) and compile and run. I did not apply the module to a completely virgin source release so if you weird problems let me know and I'll get it sorted.
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Oct 6, 2008 12:15 PM
in response to: morrisford
|
|
|
I've played around with this for Mac OSX (using the Java SE 6 Apple ships). It seems Javascript does not come with their version. (I'm reading how to install it). A test program prints:
% java ScriptTest Available script engines: ------------------------------------------- Language: AppleScript Engine: AppleScriptEngine -------------------------------------------
|
|
|
|
|
|
|
|
Re: Something maybe simple but essential
Posted:
Oct 6, 2008 12:20 PM
in response to: jslott
|
|
|
Grab the jsr 223 download and implement jython. Copy the jar file for jython from the engines directory space then download the jython from their website and put their jython jar in the same place as the engines jar file. I used jdk???/jre/lib/ext for the jars. That should work with a jython script. There are several jython scripts in the incubator stuff. If Rhino is not included with the Apple version, you should be able to do the same procedure for javascript.
|
|
|
|
|
|
|
|
Re: Scripting with WL 0.4
Posted:
Sep 20, 2008 4:49 PM
in response to: micheldenis
|
|
|
On Sat, 2008-09-20 at 09:20 -0700, wonderland@javadesktop.org wrote:
> - scripts location: I am not sure whether a Wonderland admin would > like users to define their own script hence modifying the behavior of > the world and its objects (aka cells or so). Maybe the server side > could be prefered, with access by user in read/exec mode. > The location of the scripts could perhaps be pointed by a variable in > my.run/build.properties ? Initially of course it could be a fixed name > and location.
As I wrote the other day, within a old-fashioned MUD, you had the "domain", which was the overall "world" and user's "realms" where they were given space to develop within. Sorta like SL is today. Their realm was sandboxed off until it passed peer review. although other developers could enter another realm under construction to offer advice as well as critique. When a new realm was announced to be open, it was opened to the Domain via a doorway or whatever, to enter it through. It would seem that something like that could happen within Wonderland. Maybe using that elevator that was mentioned some time ago?? Ric
-- ---------------------------------------------------- My father, Victor Moore (Vic) used to say: "There are two Great Sins in the world... ..the Sin of Ignorance, and the Sin of Stupidity. Only the former may be overcome." R.I.P. Dad. Linux user# 44256 Sign up at: http://counter.li.org/ https://nuoar.dev.java.net/ Verizon Cell # 434-774-4987
|
|
|
|
|