AnkleLock

From Second Life Wiki
Jump to: navigation, search
KBnote.png Note: Due to licensing issues, all contributions to this wiki have stopped and the articles that we posted are just being maintained. This is one of the projects that has gone further and for updates you are cordially invited to the project page on our wiki.

Created by Kira Komarov.

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.

About

Since I am fairly obsessed by shoes, I have come across a beautiful pair that seemed to be different from the rest because they would mould on my foot regardless of my animation overrider or regardless what stand or position my avatar found itself. What happens, is that without a script and animation to lock your foot to the shoes you are wearing (including boots), your thighs and upper legs move but your feet do not move along with them. Thus, in some circumstances your shoes look wrong.

From what I could determine, the way this would work is using a script that triggers an animation which locks your foot into position so that when the rest of your body moves, the shoes you are wearing appear locked. I wanted to replicate that effect with a free wide-spread script that both creators and individuals could use when they own a pair of shoes that look odd when you move around.

Setup

I have kept the script as minimal as possible with an rolled-out version and an optimised version which you could use for production. In other words, the rolled-out version is for you to see how this works and the optimised 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:

AnkleLock - Better.png

You can leave the rest of the settings at their default values. However the settings above are mandatory (Yes, including the name! I'll show you later how you can change that if my stamp [K] bothers you).

  1. Copy the optimised 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

//////////////////////////////////////////////////////////
// [K] Kira Komarov - 2011, License: GPLv3              //
// Please see: http://www.gnu.org/licenses/gpl.html     //
// for legal details, rights of fair usage and          //
// 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"); llSetTimerEvent(5.0e-2); } } timer() { llSetTimerEvent(0); llStartAnimation("[K] AnkleLock - Animation"); llRequestPermissions(llGetOwner(),16); } }

Code - Unrolled Version

//////////////////////////////////////////////////////////
// [K] Kira Komarov - 2011, License: GPLv3              //
// Please see: http://www.gnu.org/licenses/gpl.html     //
// for legal details, rights of fair usage and          //
// 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");
            llSetTimerEvent(0.05);
        }
    }
    timer() {
        llSetTimerEvent(0);
        llStartAnimation("[K] AnkleLock - Animation");
        llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
    }
}