EduMUVE Member Site 

The SLENZ Builds Technical Blog

March 16th, 2010 Aaron No comments

This blog will give an ongoing commentary on the SLENZ Project builds from a technical perspective, looking at the methodologies used in the build, talking through the scripts so as to facilitate upgrades or enhancements and as a central point for discussions on futher developments.

Written/compiled by Aaron Griffiths – SL: Isa Goodman
Lead Developer for the SLENZ Builds

Bookmark and Share

Welcome Sign Script: Foundation Studies Build

April 26th, 2010 Aaron 2 comments

Foundation Welcome Sign    This post is the first in a series that will look at the scripting of objects in both the SLENZ Foundation and Midwifery Studies builds and hopefully help those who wish to adapt, enhance or change the builds to other purposes.  It looks at the Welcome sign for the Foundations Studies build (a similar one is found on the complete Midwifery 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 (see image).  A pdf showing the complete script is available throught the following link: Welcome Script

I will attempt to colour the code syntax as it is seen in Second Life 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 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 0 to 6

integer sensorRange = 30;
float sensorFrequency = 10.0;
integer listenChannel = 1000;
// Delay for clearing out latestVisitors list (2 hours in seconds)
float welcomeBackDelay = 7200.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 access the information (by clicking on the sign).

state_entry(): Lines 10 to 15

llSensorRepeat("","",AGENT,sensorRange,2*PI,sensorFrequency);
llSetTimerEvent(welcomeBackDelay); 
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 17 to 42
    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);
list nameCheck = [userName];
integer test1 = llListFindList(visitors, nameCheck);

    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.

if(test1 == -1)
{
     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 access the initial dialog box.

else
{
     integer test2 = llListFindList(latestVisitors, nameCheck);
     if(test2 == -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 44 to 47
    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 49 to 71
    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.  Lines 63 to 70 were inserted as a list testing solution to see that the list visitors was accurately receiving data.

else if(message == "say list" && id == llGetOwner())
{
     integer i;
     for (i=0; i<llGetListLength(visitors); i++)
     {
          llOwnerSay(llList2String(visitors, i));
     }
}

    These lines enable the owner of the build to type /1000 say list into the main chat window and the current items in the list visitors will be displayed (to the owner only).

timer(): Lines 73 t0 84

// Remove oldest half of latest visitors list
integer halfLen = llGetListLength(latestVisitors)/2;
latestVisitors = llDeleteSubList(latestVisitors, 0, halfLen);
// If visitors list over 80 remove oldest visitors from list
if(llGetListLength(visitors) > 80)
{
     integer over80 = llGetListLength(visitors) - 60;
     visitors = llDeleteSubList(visitors, 0, over80);
}

    The timer event runs every 2 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 60 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.  As mentioned above any questions should be addressed to this blog as comments so that all users can benefit from the discussion.

    Isa Goodman/Aaron Griffiths

Bookmark and Share

SLENZ Midwifery Studies Build Now Available

March 26th, 2010 Aaron No comments

    The second of the SLENZ Project builds, Midwifery Studies Build Version 1.0, has now been made available free to the general public.  Nelson Marlborough Institute of Technology (NMIT) as the fund holders for the SLENZ project are making this build available under the Creative Commons Attribution Share-Alike License 3.0.   The build can be accessed on the NMIT island of Kowhai at the SLENZ Project central landing point [ http://slurl.com/secondlife/Kowhai/146/115/32 ].

The Provided Build
    This build provides all the items required for the Normal Birth Scenario developed by the SLENZ team for the Midwifery Studies part of the SLENZ Project.  This includes the birthing room, midwives office, treatment room and outdoor courtyard.  The rooms provided constitute a portion of the complete Birthing Unit, Te Wāhi Whānau – The Birth Place, the full build able to be viewed on the NMIT sim Kowhai (link provided above).  Ceilings on the rooms have been removed to facilitate camera access.   The SLENZ Midwifery Studies Resource Pack is also included in the build package delivered to your Inventory and contains all other resources and instructions required for completing the Normal Birth Scenario.  All build items are full permissions, i.e. Modify Copy and Transfer.   This includes textures, animations and scripts.

    The build items are provided inside a 24 x 40 metre megaprim base (SLENZ Midwifery Studies Rez Base) and can be rezzed from this base once it is positioned.  The base top forms the natural ground level for correct build placement and is removed once the build is rezzed.  The build is rezzed by the owner clicking on the positioned base and receiving the rezzing menu.

The Birthing Room
    The Birthing Room contains a large number of scripted objects used in the Normal Birth scenario.  The majority are interacted with directly through a left click and are designed to display variable results (in chat) throughout the birth or indications that a certain object or proceedure has been used, e.g. taking the mothers temperature or using sterile gloves.  Three items, the birthing pool, the chair and the bed, contain multiple poses and use the SLENZ Mother Controller (HUDs created by Toddles Lightworker, SLENZ Developer) found in the Resource Pack to change poses.  Other items such as the bench or the mantlepiece are single left click poses.  The SLENZ Midwife Contoller is used to control or reset the scenario, changing the scenes as the they progress.  It also interacts with various items in the birthing room and with the mother through local chat.

The Treatment Room
    This contains a medications fridge and IV unit which are incorporated into the scenario.  Medications are displayed in the birthing room. 

The Midwives Office
    The Midwives Office contains a filing cabinet used as a dropbox for midwife notes (notecards) written at the end of each scenario scene.  Retrieval from the filing cabinet is assigned to specific tutors through a configurable notecard.

The Courtyard
    The Courtyard is an integral part of the birthing room having been part of the building design formulated out of research on the ideal birthing unit.  It is however its own linked group and may be deleted if prim counts are a problem.  It has not been supplied with plants, just the paving, seating and mulched beds.

Look out for…
    the first of the technical discussions which will focus on a users first interaction with the Foundation Studies and Midwifery Builds.  It will look at the scripts used to welcome users and offer them introductory information.

    Please contact me (see details below or use Comments in this blog) for any help required in accessing or rezzing this second build should any complications arise.  Feedback on the Build package would be most appreciated so that it can be better adapted to users needs.

    It is also hoped that enhancements to the current builds and any adaptations produced by users will be fed back to myself by emailing Aaron Griffiths offworld [ debnaar@clear.net.nz ] or IMing Isa Goodman inworld, in the spirit of the Creative Commons Attribution-Share Alike license, so that all may benefit from such improvements.

Bookmark and Share

SLENZ Foundation Studies Build Now Available

March 16th, 2010 Aaron No comments

    The first of the SLENZ Project builds, Foundation Studies Build Version 1.0, has now been made available free to the general public.  Nelson Marlborough Institute of Technology as the fund holders for the SLENZ project are making this build available under the Creative Commons Attribution Share-Alike License 3.0.   The build can be accessed on the island of Kowhai at the SLENZ Project central landing point [ http://slurl.com/secondlife/Kowhai/146/115/32 ].

The Provided Build
    The provided build includes the Skill Mastery Hyperdome with all rezzable scenes available (includes the Stairway of Learning) and the Private Interview Room Teleporters.  With the exception of the majority of the clothes and hair provided for the Hyperdome shop and a few seating animations all build items are full permissions, i.e. Modify Copy and Transfer.   This includes textures, animations and scripts.

    The build items are provided inside a 60 x 80 metre megaprim base (SLENZ Foundation Studies Rez Base) and can be rezzed from this base once it is positioned.  The base top forms the natural level for correct build placement but can be removed once the build is rezzed.

The Skill Mastery Hyperdome
    The Skill Mastery Hyperdome, which takes the form of a holodeck, contains a number of rezzable scenes relevant to training students in interview techniques.  Each scene is rezzed inside the Hyperdome using the Hyperdome console.  The console buttons have been configured for each scene (these reside in the Hyperdome base) and use a specific chat channel command to rez them.  The console is lockable by individually approved users through an editable notecard.

The Stairway of Learning
    The Stairway of Learning is a dual staircase surrounding the Hyperdome and is used to deliver individual pieces of learning around preparation for an interview.  The stairway is designed so that each piece of information is displayed as a user mounts (or descends) each step so as to actively engage the learner in seeking the knowledge.  As this function is collision based each step is rezzed individually when the build is first rezzed from the SLENZ Foundation Studies Rez Base.

Private Interview Room Teleporters
    The interview room teleporters, situated near the front of the Hyperdome, provide for rezzing of individual interview rooms for student interview practice.  The rooms are rezzed on demand, each situated above the chosen teleporter platform and spaced approximately 70m apart to prevent the crossover of voice if used in the interview process.  The rooms have been designed specifically for the SLENZ Foundation Studies project and reflect a number of interview rooms likely to be encountered by the students involved.  The room types made available are fully configurable through an editable notecard and individual rooms, with their full permissions, can be adapted to any number of interview situations.

Look out for…
    the second build, Midwifery Studies, to be released shortly.  Also for a much more indepth discussion of all aspects of both builds that will facilitate adaptations.

    Please contact me (see details below or use Comments in this blog) for any help required in accessing or rezzing this first build should any complications arise.  Feedback on the Build package would be most appreciated so that it can be better adapted to users needs.

    It is also hoped that enhancements to the current builds and any adaptations produced by users will be fed back to myself by emailing Aaron Griffiths offworld [ debnaar@clear.net.nz ] or IMing Isa Goodman inworld, in the spirit of the Creative Commons Attribution-Share Alike license, so that all may benefit from such improvements.

Bookmark and Share

A Praxis Website 

WP SlimStat