Tuesday, December 9, 2008

Simone's Simple Scripts #1

One of my pre-sabbatical tasks is to learn the scripting lanquage. So I am starting a new occasional feature Simone's Simple Scripts to share some scripts and amuse more advanced scripters with my fumbling around.

A useful tool in Second Life is a viewer that visitors to flip through textures or text-the holy grail of course is true web on a prim where users could essentially use a prim as a web browser, thus bringing the web into Second Life. Failing that, a standard thing to do is display information as textures and flip through that and there are of course lots of such viewers out there.

Prowling around the SL scripting portal I found a really cool and new function, llDetectedTouchFace(i). This function detects what face of a prim you are touching. Now this has possibilities. So I decided to make a simple viewer that uses only one prim and real simple controls. I like simple.

So I tool a box prim, flattened it out so that the central face is a display and the left and right faces are for flipping through images-which could be text captured as a texture of course.

The accompanying picture shows the result:

The script is pretty simple.

Unfortunately Blogger seems to mangle SL script.
So if you want a copy of my one prim viewer that you can copy and modify contact me in world (Simone Gateaux) or e-mail me. sgateaux at gmail dot com and I will send you the script or if you want, in world give you a copy of the one prim viewer.

Of course feedback and suggestions are always welcome.

P.S. If any one has an idea how to stop Blogger from mangling SL code...let me know.


Eloise said...

Um, I'd love to leave comments and pointers, but it's really hard on this snippet of script you've got here... impossible to know what's going on - and this won't compile or run.

One obvious thing though - why the listener? You should be able to do a viewer like this without listening.

Simone said...


Oh the listener was not supposed to be there. I had used another snippet of code and forgot to remove it.

Hmmm runs fine for me...maybe I didn't get all the code when I pasted into to blogger.

Simone said...

Ah ha! Blogger mangled the code when I published it...grrr no wonder it won't compile.