Digital Deity

Second Life® and Real Life from Shadowen Silvera

Archive for the ‘Beginner’ Category

Here’s looking at you.

leave a comment »

Ever wonder if you are the life of the party? Is that Avatar standing next to you checking out your latest pair of shoes? How much attention is that floozy getting across the room?

Here is how you can find out the answer to these questions and many more:

To use Show Look At, enable Advanced menu > Character > Show Look At.

Thanks to Richard Linden for this info on what the different colors mean:

* Nothing – dark gray
* Idle – light gray (look straight forward)
* AutoListen – light gray (look at avatars and objects that are talking around you)
* FreeLook – blue (follow the mouse cursor)
* Respond – black (look at someone when typing a response to them)
* Hover – green (look at the object your mouse is hovering over, when tooltips enabled)
* Conversation – dark blue (look at someone after clicking on them)
* Select – pink (look at the selected object)
* Focus – purple (look at the alt-zoom target)
* Mouselook – yellow (follow cursor in mouselook)

There are various values that control how long these lookats are valid, how they prioritize relative to each other, what the percentage chance of them triggering is, etc. You can find the settings in character/attentions.xml (e.g., C:\Program Files\SecondLife\character\attentions.xml)

http://wiki.secondlife.com/wiki/Show_Look_At

This will allow you to see where people are alt-camming or otherwise what direction in the room they are peering towards.

Written by tim

July 11, 2009 at 5:39 am

LSL Scripting: Word Wrap / String Format Function

leave a comment »

Feel free to use this however you want. It inserts “returns” ie \n’s at wrap location and takes into account spaces or lack thereof.

string format(string s, integer wrap)
{
    integer len = llStringLength(s); //the length of the string
    integer i = 0; //iterator for our loops
    string tmp;     //used for a substring checking for spaces
    integer j;      //iterator for our nested loop

    //if the length is greater than the wrap size then we need to insert \n's
    //otherwise we will just return the string unmodified
    if(len > wrap) 
    {
        //in the interest of making this function faster we are going to check
        //to see if the string has no spaces at all.. if it does we will simply
        //insert \n's at the wrap setting and then return.
        if(llSubStringIndex(s," ") == -1) //check for spaces
        {
            i = 0; //set our interator at 0.
            do //this loop will insert the \n's
            {
                s = llInsertString(s,i*wrap,"\n"); //insert \n at i * wrap
                i++; //increase the interator
            }while(i<=(len / wrap)); //stop looping when i is greater than len / wrap
            return s; //return the string and exit
        }
        //if we have made it to this point there are spaces in the string
        i = 0; //set our interator at 0.
        do //this loop, like the one above, loops as many times as len / wrap
        {
            j = i * wrap; //j is the index of where to start wrapping from
            //this loop moves backwards from j till it finds a space it then
            //inserts a \n and starts the loop again from the next index.
            do
            {
                tmp = llGetSubString(s,j,j); //grab teh substring at j
                if(tmp == " ") //is it a space?
                {
                    s = llInsertString(s,j,"\n"); //its a space, insert \n
                    jump div; //jump out of this loop and back to main loop
                }
                j--; //space not found yet decrease j by 1 and try again
            }while(j>((i - 1) * wrap)); //keep looping till we have reached the start
           
        s = llInsertString(s,i*wrap,"\n"); //no spaces found, insert \n at wrap point
        //label used for jumping out of nested loop.
        @div;
        i++; //increase i by 1
        }while(i<=(len / wrap)); //loop till reach len / wrap
    }
    //llWhisper(0,"done");
    return s; //return the string
}

Written by tim

October 24, 2008 at 1:14 am

Follow

Get every new post delivered to your Inbox.