sábado, 1 de mayo de 2010

Mirror reflection script

// Simulates a mirror reflexion in Second Life by changing camera position on sit, i.e. reflects the image of an avatar in a mirror.
// Put script 1 (mirror) in a prim resembling a mirror and put script 2 (looking_a_mirror) in a chair or stool. Put the stool in front of the mirror. Tip: to cover the camera trick, integrate the mirror in a dressing table.

//  Script I: Mirror
//==========
// Made by Seagel Neville
// Retrieved from from Free SL Scripts on http://www.freeSLscripts.com or www.gendersquare.org/sl
// put me in a prim resembling a mirror. To cover the camera trick, do not forget to build a thin wall (i.e. a mirror with a mirror texture) behind the simulated reflexion of the avatar

default
{
    state_entry()
    {
        llSay(0, "Hello, Avatar!");
    }


    touch_start(integer total_number)
    {
        llSay(0, "Touched.");
    }
}


///  Script II: Looking_a_mirror
//====================


// Made by Seagel Neville
// Retrieved from from Free SL Scripts on http://www.freeSLscripts.com or www.gendersquare.org/sl




string DISPLAY_TEXT = "Sit";
string ANIMATION;
string GESTURE;
integer is_sitting;


list GESTURE_BUTTON =
[
"point_you", "point_me", "peace",
"nyanya", "toungue out", "blowkiss",
"wink#1", "wink#2", "embarassed",
"laugh", "surprise", "cry"
];


list GESTURE_LIST =
[
"point_you", "point_me", "peace",
"nyanya", "express_tongue_out", "blowkiss",
"wink_hollywood", "express_wink", "express_embarrased",
"express_laugh", "express_surprise", "express_cry"
];


opendialog_gestures()
{
    llDialog(llAvatarOnSitTarget(), "What do you want to do in front of this mirror?", GESTURE_BUTTON, 696543);
}


default
{
    state_entry()
    {
        llListen(696543, "", NULL_KEY, "");
        ANIMATION = llGetInventoryName(INVENTORY_ANIMATION, 0);
        is_sitting = 0;
        llSitTarget(<-0.63, 0, 0>,llEuler2Rot(<180, -90, 0>*DEG_TO_RAD));
        llSetText(DISPLAY_TEXT,<1,1,1>,1);
        llSetCameraEyeOffset(<-1, 0, 0>);
        llSetCameraAtOffset(<-5, 0, -100>);
    }
    
    changed(integer change)
    {
        if(change & CHANGED_LINK)
        {
            key av = llAvatarOnSitTarget();
            
            if(av != NULL_KEY)
            {
                llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);
            }
            else
            {
                if((llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) && is_sitting)
                {
                    llMessageLinked(LINK_SET, 0, "standing", NULL_KEY);
                    is_sitting = 0;
                    llStopAnimation(ANIMATION);
                    llSetText(DISPLAY_TEXT,<1,1,1>,1);
                    llUnSit(av);
                    llOwnerSay("Press \"Ignore\" button if you want to remove the menus.");
                }
            }
        }         
        ANIMATION = llGetInventoryName(INVENTORY_ANIMATION, 0);
    }
    listen(integer channel, string name, key id, string message)
    {
    if (llListFindList(GESTURE_BUTTON, [message]) != -1)  // verify dialog choice
    {
        opendialog_gestures();   // The dialog box keeps showing until you choose "Ignore".
        GESTURE = llList2String(GESTURE_LIST, llListFindList(GESTURE_BUTTON, [message]));
        llStartAnimation(GESTURE);
        }
    }
    run_time_permissions(integer perm)
    {
        if(perm & PERMISSION_TRIGGER_ANIMATION)
        {
            llMessageLinked(LINK_SET, 0, "sitting", NULL_KEY);
            is_sitting = 1;
            llStopAnimation("sit_generic");
            llStopAnimation("sit");
            llStartAnimation(ANIMATION);
            llSetText("",<1,1,1>,1);
            opendialog_gestures();
        }
    }
    on_rez(integer start_param)
    {
        llResetScript();
    }

Profile pics


Your profile pic is important because it is the image that defines you when other residents aren’t immediately around to see you, and it represents your main (or dominant) manifestation.
The two most asked questions about profile pics in Second Life are:
  1. What should my profile pic dimensions be?
  2. Where can I get my picture taken?
In this guide to profile pics, we tackle both and add some helpful hints along the way. Our recommendations:

1. What should my profile pic dimensions be?

Easy Answer:

  • Any image that is scaled to a 4:3 ratio.

How to do it:

  • First of all, you need Photoshop or a similar image-editing program. It doesn’t need to be too horribly fancy to pull this off:
  1. Take a photo of your avatar from within Second Life, or pick an image you’d like to use as your profile picture.
  2. Open the image in Photoshop or a similar image-editing program.
  3. If your program has a cropping tool, crop your image to the general area that you want to use.
  4. Find the image dimensions in pixels. In Photoshop, you’ll go to Image->Canvas Size… and choose to view the dimensions in pixels.
  5. Decide whether you want to retain the image’s HEIGHT or WIDTH.
  6. For this example we will chose to retain the image’s HEIGHT (to retain the WIDTH, just reverse this step). Take the image’s HEIGHT and divide it by 3. Add the result to the original HEIGHT and assign that number to the WIDTH. For example:   
  • You have an image that measures 1102×810 pixels, and you want to retain the HEIGHT of 810 pixels because you don’t want to chop off the top or the bottom of the image.
  • Divide 810 by 3: 810/3 = 270
  • Add 270 to 810 (the original HEIGHT): 270+810 = 1080
  • Your new width needs to be 1080 pixels
  • Crop the image to 1080×810 pixels. This will give you a perfect 4:3