Sunday, 30 October 2011

Week 6

HUD
For this week’s task I had to make a HUD that controls a box. The problem I had when making the HUD was the size, you need to make very small prims, as you cant resize the objects when you attach it as a HUD.

I made 4 classes for each of the moment buttons. The Class shouts the word left on a channel that I selected. The good find about the channel is that other people will not hear it.


This script listens to the channel I selected for each of the buttons. If any of the key words are used like back or right, the object will move in that direction. I think this would be usefully for sending dater between scripts.

Thursday, 27 October 2011

Week 5

Lists
The first task for this week was storing information in a list, when a player hits the object. When the owner touches the object, the object will tell the owner what’s stored in the list.

When a player or object has finished colliding with the script, the script will save information of the object that collided with the script in a list. When the owner touches the object, the list will display all the information it has got, one line at a time.


Notecards
The second task was for an object to read a note card that contains vector positions. Once the positions points are read, the object will move to them every time some one touches the object.

The script makes use of states. States are good if you want to use the object in a different way once a certain criteria has been meet. 


llSetText()

I was testing out the llSetText function that lets you put hovering text above an objects. You also get to select what colour the text is, what could be useful for team games.

Thursday, 20 October 2011

Week 4

For this week’s tasks I need to move a physical and non physical object in second life. The script I wrote moves a physical object to the second closest player near it. The script will not work if there is only one player in the area. The main reason I did this was because I wanted to test out moving an object to another object instead of to me.
llDetectedPod() = Get the position of a object/player
LlMoveToTarget() = moves the object to the selected location at a speed of my choosing.
The second script moves a non-physical object., but the difference with this one is that it does not move over time. But instantly jumps to the position.  When this script had been touched it will jump to four different locations over the course of 8 seconds.
llGetPos = Gets the current position of the object.
llSetPos = Set the position of the object instantly.

Thursday, 13 October 2011

Week Three



Using the gun script from http://lslwiki.net/lslwiki/wakka.php?wakka=ExampleGun I made a gun that fires bananas, that will help me best out the bam door.  The task for this week is to make a door that when hit by an object it display the speed that it is travelling at, and the owner of the object.  Most of the function to do this have been covered in the other weeks.
llDetectedName(0) = Gets the Object name.
llVecMag(llDetectedVel(0)) = Gets the speed of the object.
llKey2Name(llGetOwner()) = Gets the owner of the object.

Thursday, 6 October 2011

Week Two

Greeting Script
I had to create a script that outputs the player’s name and the time of day (night evening morning afternoon) when it is touched.  I found out that one second life day is four real hours.  By using the llGetTimeOfDay function (uses seconds, 3600 seconds = 1 hour) I was able to get the current world time then put it in an if statement. As a day is four hours the first hour is night (the beginning of the day is at 00:00 night-time so I presume that it is the same in second life), the second of morning, the third is noon, and the last one is evening.
Collision Script
When the a user collides with the assign object, the script gets the name of the player and the speed at which they hit the object. The problem with this script is that when you hit the object, the chat box gets spammed with the output message. I tried to put a delay (llMinEventDelay) so that the event could only happens every 5 seconds, but it did not work.
Finder Script
 
If the owner touches the object (me) the script will use the sensor event, (and function) to find all users in 50 meters and display them to me. If someone other than the owner touches the object , it will search for all the users in a 25 meter radius of the object an display them.