Connecting to the Island Ensure you are in the UA CSCE Artificial Intelligence group Ensure you are in the UA CSCE Artificial Intelligence group Open the.

Slides:



Advertisements
Similar presentations
Introduction to Macromedia Director 8.5 – Lingo
Advertisements

Pages and boxes Building quick user interfaces. learning objectives o Build a quick UI with pages and boxes o understand how pages and boxes work o click.
Chapter 6 Type Checking. The compiler should report an error if an operator is applied to an incompatible operand. Type checking can be performed without.
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Writing General Procedures Often you will encounter programming situations in which multiple procedures perform the same operation This condition can occur.
Mrs. Chapman. Tabs (Block Categories) Commands Available to use Script Area where you type your code Sprite Stage All sprites in this project.
Excel and VBA Creating an Excel Application
IS 1181 IS 118 Introduction to Development Tools VB Chapter 03.
M OTION P LANNING IN R EAL AND V IRTUAL E NVIRONMENTS F ALL 2007 Second Life: Introduction Russell Gayle Comp – Robot Motion Planning Fall 2007.
LSL: Linden Scripting Language Andrew Orr 12/17/07.
JavaScript 101 Lesson 5: Introduction to Events. Lesson Topics Event driven programming Events and event handlers The onClick event handler for hyperlinks.
Cos 381 Day 7. © 2006 Pearson Addison-Wesley. All rights reserved. 6-2 Agenda Assignment 2 Posted –Program a web-based Version of Soduku using JavaScript.
Introduction to Methods. How do we use Methods in Java? Let us start by creating one which displays “hello” on Dos Prompt.
Mr. Wortzman. Tabs (Block Categories) Available Blocks Script Area Sprite Stage All sprites in this project.
Introduction to scripting
HCare access on an iPad hCare access is the remote access to PGH. The steps for installing vary from the Mac somewhat. This will guide you. Installation.
A.I. in Second Life Akihiro Eguchi. Why Second Life? Real world like environment where we can visually show the demo of our work E.g. ◦ Workflow ◦ Ontology.
Variables and Functions Chapter Variables Named storage location in computer’s memory Programs may need to store data when running o Stored in.
Mathcad Variable Names A string of characters (including numbers and some “special” characters (e.g. #, %, _, and a few more) Cannot start with a number.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 26 – CheckWriter Application Introducing Graphics.
Microsoft Visual Basic 2008 CHAPTER NINE Using Arrays and File Handling.
Microsoft Visual Basic 2005 CHAPTER 9 Using Arrays and File Handling.
CS590VC – Tutorial 9 Calling Web Services from Second life.
NMED 3850 A Advanced Online Design January 26, 2010 V. Mahadevan.
Using Arrays and File Handling
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Interest Calculator Application Introducing the For...Next Repetition Statements.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 1B Introduction (Tutorial)
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Microsoft Office Excel Copyright © 2008 Pearson Prentice Hall. All rights reserved
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
ES305 Virtual Tools in Engineering Design Importing Objects Prof. Searleman
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 5 Arrays.
Fundamentals of GUI Programming. Objectives: At the end of the session, you should be able to: describe the guidelines that are used for creating user-friendly.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
User Interface Design using jQuery Mobile CIS 136 Building Mobile Apps 1.
By Melissa Dalis Professor Susan Rodger Duke University June 2011 Multiplication Table.
Module 1.3 Verilog Basics UNIT 1 : Introduction to Verilog Data Types.
Looping and Counting Lecture 3 Hartmut Kaiser
Introducing Python CS 4320, SPRING Resources We will be following the Python tutorialPython tutorial These notes will cover the following sections.
Chapter 3 Functions, Events, and Control Structures JavaScript, Third Edition.
CS590VC - Tutorial 3 Linden Scripting Language (LSL)
Applications Development
CSC 110 Using Python [Reading: chapter 1] CSC 110 B 1.
Field Trip #25 Creating a Client/Server By Keith Lynn.
JavaScript, Fourth Edition
TRIGGERS Triggers tell a script to start executing There are four types of triggers: When green flag is clicked When I am clicked When is pressed When.
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
Scratch Another computer programming language Developed by MIT in 2003
Jaana Holvikivi 1 Introduction to Javascript Jaana Holvikivi Metropolia.
Introduction to Perl. What is Perl Perl is an interpreted language. This means you run it through an interpreter, not a compiler. Similar to shell script.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
Creating Web Documents: JavaScript Ftp / file management: review Introduction to JavaScript Sources Homework: start review for midterm, work on Project.
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
Written by: Dr. JJ Shepherd
Visual Basic Review LBS 126. VB programming Project Form 1Form 2Form 3 Text boxButton Picture box Objects Text box Button Objects.
Microsoft Visual Basic 2012 CHAPTER FIVE Decision Structures.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
JQuery Events, Mobile Events, and Page Events CIS 136 Building Mobile Apps 1.
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
Introducing Scratch Learning resources for the implementation of the scenario
 2001 Prentice Hall, Inc. All rights reserved. Outline 1 JavaScript.
>> Introduction to JavaScript
F/XUAL EDUCATION SERVICES
PHP.
Fundamental Programming
PHP an introduction.
Web Programming and Design
Presentation transcript:

Connecting to the Island Ensure you are in the UA CSCE Artificial Intelligence group Ensure you are in the UA CSCE Artificial Intelligence group Open the Map tap Open the Map tap Type University of Arkansas into the Search box and hit the Search button. Type University of Arkansas into the Search box and hit the Search button. Click University of Arkansas in the results Click University of Arkansas in the results Click Teleport Click Teleport

Introduction to Second Life Scripting

Resources Inside of Second Life: Inside of Second Life: Linden Script Tutorial Group Linden Script Tutorial Group The Particle Laboratory ( The Particle Laboratory (

How to Create a Script (In Inventory) Right click and Select the new script button. Right click and Select the new script button. Cannot run scripts in inventory Cannot run scripts in inventory

How to Create a Script (In Object) Right Click object and select Edit Right Click object and select Edit Click on the Content tab Click on the Content tab Click “New Script” Click “New Script”

LSL Basics Event and state driven Event and state driven Single Threaded Single Threaded Next event will not be processed until current event finishes. Next event will not be processed until current event finishes. Includes logic and looping constructs such as for, if, while, and do-while Includes logic and looping constructs such as for, if, while, and do-while

Primary Built-In Data Types Float – Same as the float type in C Float – Same as the float type in C Integer - 32-bit signed integer Integer - 32-bit signed integer String String Key Key Vector Vector List List

Key Unique identifier for just about any object in Second Life Unique identifier for just about any object in Second Life Contains hexidecimal characters seperated by dashes Contains hexidecimal characters seperated by dashes Example: Example: a822ff2b-ff02-461d-b45d-dcd10a2de0c2 a822ff2b-ff02-461d-b45d-dcd10a2de0c2

Vector Simple data structure of 3 floats, written as. Simple data structure of 3 floats, written as. Used to hold position, velocity, and color. Used to hold position, velocity, and color. Individual elements can be accessed by using the.x,.y, and.z after the variable name. Individual elements can be accessed by using the.x,.y, and.z after the variable name. For color: For color: X = Red X = Red Y = Green Y = Green Z = Blue Z = Blue Examples: Examples: vector example = vector example = example.z gives the value of 1. example.z gives the value of 1.

List Generic Container that can hold any number of elements of any type. Generic Container that can hold any number of elements of any type. Grows dynamically up to maximum amount of memory Grows dynamically up to maximum amount of memory All element access is done through llList2 functions which take the list and position (0- based as parameters) All element access is done through llList2 functions which take the list and position (0- based as parameters) Examples: Examples: list example = [7, “Blue”, [0, 1, 2], ]; list example = [7, “Blue”, [0, 1, 2], ]; llList2Integer(example, 0) returns 7. llList2Integer(example, 0) returns 7.

States Every script must have a default state. Every script must have a default state. All objects begin in the default state. All objects begin in the default state. Additional states can be declared using the state keyword. Additional states can be declared using the state keyword. Event functions are for that specific state. No direct way to have a event handler that works in all states. Event functions are for that specific state. No direct way to have a event handler that works in all states.

Hello World default{ state_entry() state_entry() { llSay(0, "Hello world!"); llSay(0, "Hello world!"); }}

Basic Chat Output Functions All have two parameters – Output Channel (Integer) and Message (String) All have two parameters – Output Channel (Integer) and Message (String) Different functions have different ranges: Different functions have different ranges: llWhisper – 10 meters llWhisper – 10 meters llSay – 20 meters llSay – 20 meters llShout – 100 meters llShout – 100 meters llRegionSay – Entire island (but not on received on clients) llRegionSay – Entire island (but not on received on clients) Chat Channel 0 is the channel that is displayed in the Second Life client. Chat Channel 0 is the channel that is displayed in the Second Life client.

Default Script default{ state_entry() state_entry() { llSay(0, "Hello, Avatar!"); llSay(0, "Hello, Avatar!"); } touch_start(integer total_number) touch_start(integer total_number) { llSay(0, "Touched."); llSay(0, "Touched."); }}

Events Most events can be triggered multiple times per simulation clock cycle. Most events can be triggered multiple times per simulation clock cycle. For the touch_start event, the total_number represents the total avatars that have started touching the object. For the touch_start event, the total_number represents the total avatars that have started touching the object. Information for each avatar or object detected can be obtained through the llDetected functions. Information for each avatar or object detected can be obtained through the llDetected functions.

default{ state_entry() state_entry() { llSay(0, "Hello, Avatar!"); llSay(0, "Hello, Avatar!"); } touch_start(integer total_number) touch_start(integer total_number) { integer i = 0; integer i = 0; for(; i < total_number; ++i) for(; i < total_number; ++i) { llSay(0, "Touched by “ + llDetectedName(i)); llSay(0, "Touched by “ + llDetectedName(i)); } }}

State events State_entry – Triggered when state first becomes active State_entry – Triggered when state first becomes active State_exit – Triggered when state changes and becomes inactive State_exit – Triggered when state changes and becomes inactive

default{ state_entry() state_entry() { llSay(0, “Default State.”); llSay(0, “Default State.”); } touch_start(integer num) touch_start(integer num) { state active; state active; } state_exit() state_exit() { llSay(0, “Leaving default state.”); llSay(0, “Leaving default state.”); }} state active { state_entry() state_entry() { llSay(0, “Activated”); llSay(0, “Activated”); } touch_start(integer num) touch_start(integer num) { llSay(0, “Touched.”); llSay(0, “Touched.”); }}

integer relaychan = -1356; default{ state_entry() state_entry() { llListen(relaychan, “”, NULL_KEY, “”); //Channel, Name, Key, Message filters llListen(relaychan, “”, NULL_KEY, “”); //Channel, Name, Key, Message filters llListen(0, “”, NULL_KEY, “”); llListen(0, “”, NULL_KEY, “”); } listen(integer chan, string name, key id, string message) listen(integer chan, string name, key id, string message) { if(chan == relaychan) if(chan == relaychan) { llSay(0, message); llSay(0, message); } else else { llShout(relaychan, name + “: ” + message); llShout(relaychan, name + “: ” + message); } }}

list lastReceived; integer listenchan = -800; default { state_entry() { llListen(listenchan, "", NULL_KEY, ""); llSetText("ON",, 1.0); } listen(integer channel, string name, key id, string message) { lastReceived = llListInsertList(lastReceived, [message], 0); integer len = llGetListLength(lastReceived); if(len > 10) { lastReceived = llList2List(lastReceived, 0, 9); } integer pos = 0; string floatText = "Last 10 messages:\n"; for(; pos, 1.0); } touch_start(integer a) { state off; } } state off { state_entry() { llSetText("OFF",, 1.0); } touch_start(integer a) { state default; } }

Lab Verify that you can teleport to the Second Life island Verify that you can teleport to the Second Life island Try out the example scripts. Try out the example scripts. Create a script to use llShout to say your avatar name(s) on channel Create a script to use llShout to say your avatar name(s) on channel -800.