Shortnote

Similar to the AnkleLock, we can create a script and an animation that locks wrists in order to replace the default avatar hands with primitive sculpted hands. This ensures that once you attach an object to your hand, the object will not move.

Setup

I have kept the script as minimal as possible with an rolled-out version and an optimized version which you could use for production. In other words, the rolled-out version is for you to see how this works and the optimized version is the one you should use. I have created both the script and the animation for the hands.

  1. Download the BVH file as plain text and make sure you rename it so it has the .bvh extension instead of .txt: You should end up with a file called [K] WristLock - Animation.bvh somewhere on your desktop or wherever you place your files.
  2. Upload the animation into Second Life using File->Upload->Animation (L$10)... And select the file [K] WristLock - Animation.bvh file.
  3. Now you have to upload the animation and the settings for the animation before the download are important. Here is what you should make sure you have configured on the upload popup for the animation:

The only setting that may vary between servers and viewers is the animation priority. Ideally, the higher the priority the better so the animation priority should be set at the maximal value you can set it to. In this case, the priority is 5, if the settings will not let you to set it to 5, the next highest value will do. You can leave the rest of the settings at their default values. However the settings above are mandatory including the name.

  1. Copy the optimized version of the script below and paste it in a new script called [K] WristLock - Controller.
  2. Dump both these scripts in one of your shoes (either left or right is fine).

The shoe you picked should now contain two files:

[K] WristLock - Animation
[K] WristLock - Controller

where [K] WristLock - Animation is the animation you just uploaded and [K] WristLock - Controller is the script from below.

Code - Rolled Version

This script was tested and works on OpenSim version 0.7.4!

wristlock.lsl
///////////////////////////////////////////////////////////////////////////
//  Copyright (C) Wizardry and Steamworks 2011 - License: GNU GPLv3      //
//  Please see: http://www.gnu.org/licenses/gpl.html for legal details,  //
//  rights of fair usage, the disclaimer and warranty conditions.        //
///////////////////////////////////////////////////////////////////////////
 
default { state_entry() { llRequestPermissions(llGetOwner(),16); } on_rez(integer start_param) { llRequestPermissions(llGetOwner(),16); } run_time_permissions(integer perm) { if ((perm & 16)) { llStopAnimation("[K] WristLock - Animation"); llStartAnimation("[K] WristLock - Animation"); llSetTimerEvent(1.175494351E-38); } } timer() { llSetTimerEvent(0); llRequestPermissions(llGetOwner(),16); } }

Code - Unrolled Version

This script was tested and works on OpenSim version 0.7.4!

WristLock.lsl
///////////////////////////////////////////////////////////////////////////
//  Copyright (C) Wizardry and Steamworks 2011 - License: GNU GPLv3      //
//  Please see: http://www.gnu.org/licenses/gpl.html for legal details,  //
//  rights of fair usage, the disclaimer and warranty conditions.        //
///////////////////////////////////////////////////////////////////////////
 
default
{ 
    state_entry() {
        llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
    }
    on_rez(integer start_param) {
        llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
    }
    run_time_permissions(integer perm)
    {
        if (perm & PERMISSION_TRIGGER_ANIMATION)
        {
            llStopAnimation("[K] WristLock - Animation");
            llStartAnimation("[K] WristLock - Animation");
            llSetTimerEvent(1.175494351E-38);
        }
    }
    timer() {
        llSetTimerEvent(0);
        llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
    }
}

secondlife/avatar_animation_locks/wristlock.txt · Last modified: 2017/02/22 18:20 (external edit)

Access website using Tor


For the copyright, license, warranty and privacy terms for the usage of this website please see the license and privacy pages.