AnkleLock
De DigiWiki.
(→Setup) |
|||
Ligne 8 : | Ligne 8 : | ||
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. | 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. | ||
- | # [http:// | + | # [http://www11.zippyshare.com/v/85076046/file.html 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. |
# Upload the animation into Second Life using File->Upload->Animation (L$10)... And select the file '''[K] AnkleLock - Animation.bvh''' file. | # Upload the animation into Second Life using File->Upload->Animation (L$10)... And select the file '''[K] AnkleLock - Animation.bvh''' file. | ||
# 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: | # 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: |
Version actuelle en date du 30 octobre 2014 à 02:52
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.
- 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.
- Upload the animation into Second Life using File->Upload->Animation (L$10)... And select the file [K] AnkleLock - Animation.bvh file.
- 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:
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).
- Copy the optimised version of the script below and paste it in a new script called [K] AnkleLock - Controller.
- 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); } }