In week 1, all we were doing were the very basics of scripting within Second Life.
For the first task, I had to create a prim that could be interacted with upon touched. What the script had to do was display the avatars name once clicked and then count to 10. To do this I used the llDetectedName function and a do-while loop for the counter. Whilst browsing the LSL Tutorials, one page mentioned that a do-while loop is more efficient than a for or while loop. So here is me implementing that.
I could show my code on here, but there is really no point for this exercise.
For the second of this weeks tasks, which was actually a lot easier than I first thought it would be, was to create a script that keeps track of how many times it has been touched(clicked).
All I had to do for this task was add one line of code before the llSay function of the previous script and remove the loop. I also added the llSetText function so that it had hovering text above the prim. Here is it in action!
I struggled with the second task a little bit because I was trying to over complicate things with for loops and what not! Then I realised this was only week one and I better go over it again. Im glad I did. >.>


No comments:
Post a Comment