Friday, 11 November 2011

Week 8

Here is the code for the listening object, with proof I recieved the email.
The object is listening on channel 1337 for the scan to announce the results. This is then added to a list and emailed to the set account.

Friday, 4 November 2011

Week 7

Today we were making our own gestures.
Since I was costumed as a robot, I decided to make the robot dance.
Used start "Away" gesture, then wait 5 secs, then stop "Away" gesture.
Then a wait till animation stopped command initiated "dance 8", athen another wait till animation command initiated "backflip". Finally another "Away" command is added to finish it.
It was set as /robot. I could have set it to shift/ctrl f3 if I wanted. There is also a command to add text to chat channel and sounds to be played.

Tuesday, 1 November 2011

Week 5

Todays lab was all about lists and notecards. Part 1 invloved a prim recording the name, key and speed of an object colliding with it. Part 2 was presenting this into a chat channel. I combined both into the following code.
Created a list as a global variable. then created each of the functions as strings. I then made an int to count the list length and used a for loop to step through each word and present to owner.

Friday, 28 October 2011

Week 6

This weeks lab is all about HUDs. Here is my finished one (yes I know buttons are big but they can be easily shrunk)
Here is the button codes
This shouts key words over an obscure channel (1337), this in turn is picked up by the listening prim thusly-


Depending on what word is heard (spelt in caps to reduce chances someoen else will shout in that channel) the prim will call upon the correct vector and move accordlingly

Thursday, 20 October 2011

Week 4

This weeks labs focused on moving non-physical and physical prims.
Here is the code used for non-physical. It compares distance between to locations, if this is above 0.001 meters, the loop repeats moving the prim 10 meters towards its goal.

For a physical prim, the story is very similar. Except we substitute llSetPos with llMoveToTarget. We also have an extra tau value to consider. This slows the object down the closer it is to its goal.

This weeks lab ties in nicely with my idea for the assignment. I would like to create a tilt maze similar to this-
It would naturally have more to it that this, including highscores for the quickest to finish. This will all depend on how HUDs work, so at the moment its only a postulation.

Friday, 14 October 2011

Week 3 Addendum

I got the impression it expected the onrezz function to be blogged, so I will add this.

Friday, 7 October 2011

Week 3

This week was mainly a recap session, whilst touching on rezzing objects.
This was my result of the llOnRez command. I made a launcher that fires Moogles from the Final Fantasy gaming series. The launcher itself calls upon the prim "bullet" that is set to temporary, and gauges avatars position, rotation and sets its velocity. I added the sound file "shoot" for extra effect.
Instead of throwing Bananas, I decided to use my Moogles for the task. We had to make a recap object that upon collision, states Object Name, Avatar Name and Speed. This has all been covered in the last few weeks so I wont go into too much detail but here is the coding.

Friday, 30 September 2011

Week 2

This week we have been looking at slightly more indepth LSL scripting, mainly focused around collision and scanning.
Task 1 invloved writing a script that upon touch, stated the avatar name, then gives a suitable time related greeting, good morning/evening etc. This was achieved by creating an integer attached to the llGetGMTClock function. This is returned in seconds, counted from 00.00.
To get correct greetings, if/else statements were used. There are 3600 seconds in an hour so less than 43199 seconds is considered morning etc. Evening and Night were just extensions to this calculation.

Task 2 was composed of a script to detect the name of an Avatar or object colliding with a prim and state the speed it was travelling. It should also state the owner of the object.
Detecting the velocity was solved by a combination of llVecMag and llDetectVel. Stating the ownership of the item was linking the key to a name, then retrieving the owners name.

Task 3 was very tricky indeed. We needed to create a prim that if the owner touched, scanned a 50 radius for Avatars and list them, and if anyone else touched it, only a 25 scan was set off.
The task of identifying ownership was solved by a simple if statement. If the detected Avatar matched the owners ID then the 50 radius scan is set off, else the 25 scan is activated. The scan was set to detect agents with PI (180 degree arc abouve ground)
The sensor event then counts the number of avatars found and prints this via a string. A while loop was used to step through each detected Avatars name, which was then printed to the screen.

Thursday, 29 September 2011

Week 1


Week 1 consisted of basic LSL scripting and touch interactions with Prims.

First task was to create a Prim that would state the Avatars name and count to 10. Using the command llGetDisplayName and llDetectedKey it was possilbe to broadcast this on channel 0 (Could also use llOwnerSay if I just wanted to boradcast to myself.
Next using a do while loop and the ++ function, it was possible to count to 10 (setting parameters to a <11)

The Second Task was even easier. We had to script so that a Prim would announce how many times it was tocuhed. No restrictions or loops were needed for this. Just the ++ fucntion. the Integer had to be declared globally.