Jump to content

Holding pose does not work after walking


fswyvern Galaxy
 Share

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

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

Recommended Posts

hi all

 

i am try to make a animation script , where my avatar is always holding a bag with arms fixed, after walking/standing.

it always works when i attach the object but not when when i start walking, then back to standing position, i attached the script here..anyone able to guide me?

string HOLD_ANIM = "BrokeWrist2";


default
{
    on_rez(integer rezzed)
    {
        llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
       
    }
    
    attach(key attached)
    {
        if(attached != llGetOwner())
            if(llGetPermissions() &  PERMISSION_TRIGGER_ANIMATION)
                llStopAnimation(HOLD_ANIM);
    }
    
    run_time_permissions(integer perms)
    {
        if(perms &  PERMISSION_TRIGGER_ANIMATION)
            llStartAnimation(HOLD_ANIM);
          
      
       llSetTimerEvent(0.25);
    }
    timer()
    {
        if(llGetAgentInfo(llGetOwner()) & AGENT_WALKING)
        {          
            llStartAnimation(HOLD_ANIM);            
        }
    }
}
Link to comment
Share on other sites

Instead of using llGetAgentInfo, you might try using llGetAnimation to see which animations are running, as in

stopAnims(key Av){    list temp = llGetAnimationList(Av);    integer i = (temp !=[]);    while(~(--i))    {        llStopAnimation(llList2String(temp,i));    }}string HOLD_ANIM = "BrokeWrist2";   default   {      state_entry()      {         if(llGetAttached())         {             llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION);         }      }      run_time_permissions(integer parm)      {         if(parm == PERMISSION_TRIGGER_ANIMATION)         {            stopAnims(llGetOwner());            llStartAnimation(HOLD_ANIM);            llSetTimerEvent(1.0);         }      }               changed (integer change)      {          if (change & (CHANGED_REGION || CHANGED_TELEPORT))          {              llResetScript();          }      }            timer()      {          if((llGetAnimation(llGetOwner()) == "Sitting") ||(llGetAnimation(llGetOwner()) == "Sitting on Ground"))          {              llSetLinkAlpha(LINK_SET,0.0,ALL_SIDES);              llStopAnimation(HOLD_ANIM);          }          else if (llGetAnimation(llGetOwner()) == "Standing")          {              llSetLinkAlpha(LINK_SET,1.0,ALL_SIDES);              llStartAnimation(HOLD_ANIM);          }      }      on_rez(integer st)      {         llResetScript();      }      attach(key id)      {            if(id)            {                integer perm = llGetPermissions();                if(perm & PERMISSION_TRIGGER_ANIMATION)                {                    stopAnims(id);                     llStartAnimation(HOLD_ANIM);                    llSetTimerEvent(1.0);                }                else                {                    llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);                }            }      }   }
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2642 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...