ChangLog

  • 15-12-2011

Thanks to Miana Siabonne we figured out that the article had the old link to the old animation and with the old settings. The link has been corrected and the new settings added as a picture.

  • 18-10-2011

Jitter correction: it should not wobble at all now. Please download the file again, the animation has been updated.

  • 29-11-2011

Fix for poseballs and other animations. Inserted delay and removal, reapplication of animation to reach top of stack.

Shortnote

The following script locks the avatar's ankles in order to replace the default avatar feet with primitive sculpted feet (or shoes). This ensures that once you attach an object to your foot, the object will not move along with the AO.

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 feet.

  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] AnkleLock - 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] AnkleLock - 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.

  1. Copy the optimized version of the script below and paste it in a new script called [K] AnkleLock - 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] AnkleLock - Animation
[K] AnkleLock - Controller

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

You are now set and you will notice that your shoes do not look funny anymore.

Code - Rolled Version

This script was tested and works on OpenSim version 0.7.4!

anklelock.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] AnkleLock - Animation"); llStartAnimation("[K] AnkleLock - 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!

anklelock.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] AnkleLock - Animation");
            llStartAnimation("[K] AnkleLock - Animation");
            llSetTimerEvent(1.175494351E-38);
        }
    }
    timer() {
        llSetTimerEvent(0);
        llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
    }
}

secondlife/avatar_animation_locks/anklelock.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.