SL Cert - Basic Scripting

From Second Life Wiki
Revision as of 08:30, 26 November 2009 by Grandma Bates (Talk | contribs)

Jump to: navigation, search

Overview

This list of requirements is part of the Second Life Certification project. It is an effort to create a list of specific skills required for persons to become certified in basic scripting.

Audience

Persons who wish to demonstrate competence in basic LSL scripting.

Prerequisites

Some experience and familiarity of the second life graphical user interface and controls is necessary. Also some experience of building within second life would be an advantage. Six months secondlife experience recommended.

Criteria for testing to basic level

In the basic skill sets a person should demonstrate a mastery of common programming tasks. The following categories provide the basic categories.

Broad Overview and Most Basic Skills

  • Rationale for scripting
  • Script creation
  • Commenting and Clarity
  • Mono vs. LSL2
  • Software Development

A person should provide a basic understanding of the potential and the limitations of scripts. The person should be able to demonstrate how to create a script both within an object rezzed in world or in their inventory. The person should know the difference between mono and LSL2 and the implications when a script is created within inventory as opposed to an object's inventory. A person should demonstrate a basic understanding of the construction of consistent, structured code and consistent commenting style.

The person should demonstrate an understanding of the difference between server side lag, client side lag, and the script delays associated with different LSL library calls. The person does not need to memorize which function calls have a delay and how much the delay is, but they need to understand what a delay is and how to determine if a given function has a delay and how long the delay is.

Finally, the person should provide a very basic understanding of practices for good software development. This includes the use and maintenance of comments and the rationale for the use of functions and subroutines. Additionally, the person should provide a rudimentary understanding of code revisioning and practices to keep and maintain local back up files.

Data Types

  • Types
  • Operators
  • Global vs. Local Variables
  • Typecasting


A person should be able to identify the basic data types, integer, float, string, key, list, vector and rotation. The person should know the basic operations and what they mean in context. For example, division with integers is different compared to division with floats. The person should understand that some operations are overloaded and have different meanings when combined with different types. For example, if v1 and v2 are vectors then v1*v2 is the dot product, but if v1 is a vector and r is a rotation then v1*r will rotate the vector.

The person should demonstrate the concept of the "scope" of a variable. There is a difference if it is defined outside of an event or function. Also, the person should demonstrate an understanding that a global variable can be ignored if it is also defined locally.

Finally, the person should demonstrate how to "convert" one variable into another and what happens. For example, a float is trunctated when cast as an integer.


Control Structures

  • Loop Constructs
  • Conditionals

A person should demonstrate an understanding of the different looping constructs using for, while, and do-whole loops and understand when one loop construct might be favored over another in a given context. The person should also demonstrate an understanding of the "if" statement and be able to use compound and nested if statements.

The person should be able to demonstrate the ability to construct complex boolean expressions. For example, they should be able to make use of multiple boolean statements using the boolean "or," boolean "not," and boolean "and" to filter nontrivial conditions in a control structure or conditional. The person should demonstrate an understanding of the difference between integer operations such as "xor," "and," "or," and the shift operations as opposed to the similar boolean operations.

Events and Functions

  • Events
  • Functions
  • States


A person should demonstrate the basic idea of an event and how a script might react in various circumstances. For example, the person should have a basic understanding of the three touch events and how they differ. At the basic level the broad categories of events that should be mastered include collision, touch, land collision, state entry/exit, timer, and attach events.

The person should demonstrate an understanding of the use and creation of their own functions. This includes understanding the difference between null functions and functions that return a specific data type. The person should know the difference between a user defined function and the set of functions available within the build in library.

Finally, the person should demonstrate an understanding of the use of states. They should understand the default state, how to define new states, and move between different states. The person should have a firm understanding of the control flow as a script moves between different states.


Basic I/0

  • llWhisper
  • llSay
  • llShout
  • llRegionSay
  • llOwnerSay
  • llInstantMessage

A person should know the basic ways to communicate information in LSL. The person should know the limitations and advantages of each command. The person should now the predefined channels for open chat and debug messages and also know the range of possible channels. The person should know the differences between using a positive number and negative number for the channel number and the relative advantages.

At the basic level a person should know how to open a channel for listening and construct a listening event. The person should understand the importance of being able to close a listening event. For example, the person should know how to use a timer to insure that an open listener will be closed within a given time frame.

At the basic level a person should also have a rudimentary understanding of the string functions. The person should be able to make direct comparisons and also be able to manipulate substrings. Additionally a person should be able to trim spaces off of the beginning and end of a string as well as convert the case to all upper or all lower.