SLENZ Build Deconstruction

Over 18 months from mid 2008 to the end of 2009 a small group of enthusiatic New Zealand educators set about creating the SLENZ Project. The following excerpt is from the forward of the literature review.

This literature review is the first step in the project, “Engaging with Second Life: Real Education in a Virtual World”. This project began as a dream for two educators, Clare Atkins and Aaron Griffiths, when they first explored Second Life and saw its potential for teaching and learning.

The project, funded through the New Zealand Tertiary Education Commission’s Encouraging and Supporting Innovation Fund, began in July, 2008. The project aims to determine and understand the additional value of a multi-user virtual environment, such as Second Life, to adult learning experiences, e.g. increased engagement or collaborative problem solving. The project also aims to increase the capability in New Zealand for educators and learners to teach and learn within Second Life. The project is being led by four tertiary institutions: Nelson Marlborough Institute of Technology, Otago Polytechnic, The Open Polytechnic of New Zealand and Wellington Institute of Technology. IBM and Telecom also support the project with representation on the project steering group.

Atkins, A., Blackall, L., & Salt B. (2008). Engaging with Second Life: Real World Education in a Virtual World.
Retrieved from 30 May 2012.

As the lead builder/developer I spent approximately 600 hours on the inworld building part of the project. Created under the Creative Commons Attribution 3.0 New Zealand License, the task was particularly challenging as full permissions were required for all items in the build. Over 3000 prims and 250 scripts, plus more than 150 textures, sculpts, animations and poses were created to fulfil the creative commons brief. And at the end of the project the builds were packaged and made available under the license in Second Life.

In our bid to make the builds available to educators however, one thing remained to be done and was not able to be funded by project itself. This was porting the builds over into OpenSim and making them available there. The Foundation Studies build (see video below) was the one more likely to be of use across multiple education sectors so it is this build that I considered first.

I had set myself to accomplish this task immediately following the project, and did begin the process, but other work and personal commitments soon took precedence. To date though much of the build has been moved onto Goodstar, my jokaydiaGrid sim, but there is still a lot to do to complete it so I have decided to make this a goal for 2012; to get the Foundation Studies build over to OpenSim and available for use.

As part of the process of exporting from SL and the reconstruction on Goodstar I will also be deconstructing some of the scripts for those that may be interested, explaining their function in the builds and hopefully helping those who wish to adapt, enhance or change the builds to other purposes or simply just use the scripts. This gives me a chance to revisit the scripts myself and apply any changes that may be necessary for the OpenSim environment and where I can, make the code more efficient etc.

The remainder of this post looks at the Welcome sign for the Foundations Studies build which welcomes new users to the build and presents them with a number of options for further information in the form of a notecard and links out to WikiEducator. The script is called welcome and can be found in the actual sign itself (hanging from the arch in the above image). A pdf showing the complete script is available through the following link; welcome

I will attempt to colour the code syntax as it is seen in Second Life/OpenSim to facilitate identification and identify line numbers where appropriate. It would be greatly appreciated that if any errors are discovered in this and/or subsequent posts of scripts or any questions are raised, readers comment here so that I can address them promptly and other readers can benefit from the discussion.

The Variables: Lines 22 to 27

integer sensorRange = 30;
float sensorFrequency = 10.0;
integer listenChannel = 1000;
float welcomeBackDelay = 14400.0;
list visitors;
list latestVisitors;

The integer sensorRange is the distance in metres from the sign that avatars are detected for automatic delivery of the welcome through a dialog box. The float sensorFrequency is the time in seconds that the area is scanned for avatars. The integer listenChannel is the communications channel used. The float welcomeBackDelay is used in conjunction with the list latestVisitors to ensure that visitors to the build are not pestered by the welcome each time the area is scanned. The list visitors holds the names of up to 80 visitors so that on revisiting the site newer visitors will not automatically be delivered the welcome notice but instead told how to re-access the information (by clicking on the sign).

state_entry(): Lines 31 to 36

llSensorRepeat(“”, “”, AGENT, sensorRange, PI, sensorFrequency);
llListen(listenChannel, “”, NULL_KEY, “”);

Set up in the state_entry event are the sensor which scans for avatars, the timer event for managing the visitor lists and the listener which handles button selections from the dialog box delivered to visitors.

sensor(integer total_number): Lines 38 to 60
The sensor event handles delivery of information to visitors picked up by the llSensorRepeat function. Each detected visitor is first checked against the visitors list as follows:

string userName = llDetectedName(i);
if(llListFindList(visitors, [userName]) == -1)

If the visitor is not on the list they are delivered a dialog box with button choices for selecting information on the build and added to both the visitors list and the latestVisitors list.

llDialog(llDetectedKey(i), “Welcome ” + userName + ” to the Skill Mastery Hyperdome. Note: Click on the Welcome sign to re-open this dialog/n** Options for Information **/n1. Notecard: Read and save to your SL Inventory/n2. Resources: View teacher resources on WikiEducator/n3. Notes: View student notes on WikiEducator“, [“Notecard“, “Resources“, “Notes“], listenChannel);
visitors = visitors + [userName];
latestVisitors = latestVisitors + [userName];

If they are on the visitors list (i.e they were one of the last 80 visitors) they are then checked against the latestVisitors list. If they are not on the latestVisitors list they are delivered an instant message in chat informing them how to re-access the initial dialog box.

if(llListFindList(latestVisitors, [userName]) == -1)
llInstantMessage(llDetectedKey(i), “Welcome back to the Skill Mastery Hyperdome ” + userName + “. To review general information on this build please click on the Welcome sign.“);
latestVisitors = latestVisitors + [userName];

touch_start(integer num_detected): Lines 62 to 65
The touch_start event allows visitors to touch the Welcome sign and receive the initial dialog box for information review purposes. They are informed of this ability in the original dialog box and when they revisit the build and are still on the visitors list.

listen(integer channel, string name, key id, string message): Lines 67 to 81
The listen event receives the button name from the dialog box on the selected communications channel and delivers the appropriate response depending on which button is selected.

timer(): Lines 83 to 92

// Remove oldest half of latest visitors list
latestVisitors = llDeleteSubList(latestVisitors, 0, llRound(llGetListLength(latestVisitors)/2));
// If visitors list over 80 remove oldest visitors from list
if(llGetListLength(visitors) > 80)
visitors = llDeleteSubList(visitors, 0, llGetListLength(visitors) – 40);

The timer event runs every 4 hours and is used to keep the lists to a manageable size while enabling those who have recently visited the build to not be bothered by repeated notices from the welcome sign. First the event removes the oldest half of the latestVisitors list, then it checks the visitors list and if the list count is greater than 80 it will remove the oldest visitors from the list leaving the latest 40 or thereabouts. This method ensures that the character count for a list does not stretch the script memory and that the latest visitors are always retained in the list.

I hope that this explains the welcome script adequately and is of use in adapting the script for other purposes.


5 thoughts on “SLENZ Build Deconstruction

  1. Pingback: SLENZ Build Deconstruction | Fernando Cassola in Virtual Worlds |

  2. Pingback: SLENZ Build Deconstruction | Second Virtual Life |

  3. Pingback: Using a Collision Based Effect « F/Xual Education Services

  4. Pingback: Triggering Effects with llVolumeDetect « F/Xual Education Services

  5. Pingback: Scripting 101 | Multiuser Virtual Environments

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s