Jump to content

Huggable


Charolotte Caxton
 Share

You are about to reply to a thread that has been inactive for 4642 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I'll send you a simple hugging animation :) In addition to the animation, you need one of the following scripts. The first script simply plays the animation when the object is attached:

 

default{    on_rez(integer nevermind)    {        llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);            }    run_time_permissions(integer perm)    {        if(perm) llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION,0));    }            }

 

The problem is that the animation will likely be overridden as soon as your AO animation changes. The next script more or less solves this problem by restarting the hug animation every second:

 

string anim;default{    on_rez(integer nevermind)    {        llSetTimerEvent(0);        llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);         anim = llGetInventoryName(INVENTORY_ANIMATION,0);            }    run_time_permissions(integer perm)    {        if(perm) llSetTimerEvent(1);    }                timer()    {        llStartAnimation(anim);    }}

 

The next script does the same, but it also allows the user to stop hugging the object by clicking it. Another click will start the hug animation again:

 

string anim;integer toggle;default{    on_rez(integer nevermind)    {        llSetTimerEvent(0);        llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);         anim = llGetInventoryName(INVENTORY_ANIMATION,0);            }    run_time_permissions(integer perm)    {        if(perm) llSetTimerEvent(1);    }    timer()    {        llStartAnimation(anim);    }    touch_start(integer total_number)    {        toggle=!toggle;        if(toggle)         {            llSetTimerEvent(0);            llStopAnimation(anim);        }        else llSetTimerEvent(1);    }}

 

Note that some AO animations will override the hugging animation no matter what. There are too many animations with priority 4 in SL, which is the highest priority, so they will fight for control if you play multiple animations at the same time. But in most cases it should work.

Link to comment
Share on other sites

Yes, you will need Hug animations as well. I can't find any for objects. But, I only searched for "object hug" and the search is....well, to literal slanting. It doesn't 'guess' to much.

It is very possible no one has made any general ones. Many objects are such different sized.

edit: Oh, the whole reason I posted. You can use QAvimator to easily make animations. There are lots of tutorials. And then you upload it and name them and put the name into the string anim part liek this:

string anim = "Big Hug"

I mean, IF the hug is named Big Hug. The name you see in inventory is what is used..oh, and put the script and the ainimation into the objects contents to....though this might have been mentioned. But, my idea was that you can make big, medium and small hugs. Then you can open those files and make them different when you need to and then upload the new adjusted one that works better. Test on beta grid for free uploads. Beta can also work for quick pics of things you can't afford to upload as well. Uh...ok, that is all.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4642 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...