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.


No comments:

Post a Comment