100 likes | 200 Views
CS590VC – Tutorial 5. Advanced programming with LSL. Interacting with the web. Retrieves an RSS feed from web Parsing the feed. What we will do ……. Get the first link in the first item of the RSS feed Open the link in the user’s browser when the object is touched.
E N D
CS590VC – Tutorial 5 Advanced programming with LSL
Interacting with the web • Retrieves an RSS feed from web • Parsing the feed
What we will do ……. • Get the first link in the first item of the RSS feed • Open the link in the user’s browser when the object is touched. • The URL for the feed is: http://blog.secondlife.com/feed/
Download the file: 0711_Fetching_A_URL_And_Parsing_The_Result
A sensor application • To detect objects or residents near the selected object. • Event handler: sensor • Creating a sensor: llSensor & llSensorRepeat • Removing a sensor: llSensorRemove
The basic function llSensor We have three arguments as follows: (a) A string: the name of the object/residents to search for. (b) A key: the unique ID of an object/residents to search for (c) A type: AGENT/ACTIVE/PASSIVE/SCRIPTED (d) Three Floats: the range to look for objects, the arc in radian to search, the rate in seconds to repeat the search
llSensor type argument • AGENT: finds the avatar • ACTIVE: finds objects that are being acted on by simulator physics • PASSIVE: finds objects that are not ACTIVE • SCRIPTED: finds objects that have a running script
What we will do • To turn the object into a transparent, phantom dimpled sphere that matches the area being searched by the sensor • To find object's owner, position this object in front of owner and point in the direction owner is looking
Download the files:0718_Visualizing_Sensors&0719_Using_Sensors_To_Find_Owner
References • Creating your World – the official guide to advanced content creation for second life