Monday, 25 February 2013

I decided to play around with building some vehicles in second life. Both vehicles I scripted so the user could ride them, be seated in appropriate position and spawn objects as it moved using this code segment-


integer LIFETIME    = 40; //max amount of spawns at one time
float DELAY = 0.3;     //Delay between spawns    
vector pos;
vector possAdd = <-1,0,0>; //object appears slightly behind avatar
rotation rot;
rot = llGetRot();
pos = llGetPos() + possAdd;
llRezObject("rainbow", pos, <0,0,0>, rot, LIFETIME); //change object as appropraite
llSetTimerEvent(DELAY);

Here they are in action-

 

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.