Monday, June 30, 2008

A Greeter for the Library Exhibits

Buildings can be rather lonely, and very intimidating when they are large and full of strange, foreign and unexplained objects. Thanks to the llSensorRepeat() function that comes packaged with Second Life's Linden Scripting Language (LSL) anyone can make a custom greeter. The Second Life Exchange website has several different greeter models, all available for a reasonable price (averaging around 200L depending on how complicated the model is), and all offering slightly different feature sets. However, with a little patience, some scripting skills and a few test subjects, a homemade greeter script is a free and rewarding way to add a little comfort to an otherwise inauspicious parcel of land.

And that's exactly what has been done for the Cuyahoga County Public Library (CCPL) building in ClevelandPlus II. The CCPL greeter has different settings for new and returning visitors, and keeps track of some basic statistics. One innovative feature is the greeter's ability to recognize multiple allowed users. This feature is useful for public places where more than one person administrates the land (or when one person makes the object and another needs control, but the first person needs to be able to fix bugs or add features). Another feature is the use of a configuration notecard, which allows for giving clear instructions and for the script to be kept private.

Though the script for the CCPL greeter is homemade, its contents are proprietary and secret. For the sake of education though, the basic code needed to make a greeter script is included below.

default
{
state_entry()
{
llSensorRepeat("", "", AGENT, 36.0, PI, 5.0);
}

sensor(integer detected)
{
integer i;
for(i = 0; i < detected; i++)
{
llInstantMessage(llDetectedKey(i), "Welcome! " + llDetectedName(i));
}
}
}


The llSensorRepeat() function is comprised of six arguments, the first two of which identify the name and key of the person/object to look for, and when left blank allow for sensing all objects and avatars. The third argument, however, describes what to look for, in this instance AVATAR. The remaining three arguments describe how the sensing radius, shape and how often to fire the sensor event.

Given the basics for a greeter script, it should be fairly simple to add features and to customize it to fit the needs of a particular space. And if not, the greeters available commercially are very good... who knows, the one currently in use at the CCPL might eventually make its way to SL Exchange.

Wednesday, June 25, 2008

Custom Animations

Have you ever wondered if you can make your own animations in Second Life? Perhaps you wanted to make a custom walk, or wanted your avatar to realistically interact with an object you made. Luckily, there is an open source (free) program called QAvimator that lets you make your own animations! It was designed specifically for Second Life avatar animations,

Qavimator.jpg
QAvimator Screenshot


If you've worked with any 3D animation software before, the interface should be self-explanatory. For those new to animation, Torley Linden made a nice tutorial explaining all the basics.



I created a dance (the Macarena) using QAvimator, uploaded it, and added it to a poseball. I then made a speaker system to play the Macarena. It is a very simple demonstration, but it shows the creative potential that this program has.



We are working with the Cleveland Clinic on a project to help train doctors who will be interacting with patients. We hope to recreate these meetings in Second Life to help them prepare for the real thing. In order to do this, we need to create animations that make avatars behave the way real patients do. For example, a patient with schizophrenia could "exhibit purposeless agitation" (Wikipedia).

QAvimator can be downloaded here.