Jump to content

Hi Need help asap with sit & listen scripts - error message, etc.


Pixels Sideways
 Share

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

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

Recommended Posts

 Hello:

I have an object that when you sit on it, it moves.  It works ok except I get an error message when the avatar stands.  Ideally I'd like to boot the avatar off after the object returns to its start position and is done moving.  

This is the error message:   Object: Unable to find specified agent to request permissions.

How do i fix that and how would I auto "stand" the avatar after the object finishes moving?

this is the sit script -  the  //commented out parts relate to another object pos / scale i used to calculate simultaneous movement.

integer channel = -27369;

default
{
    state_entry() {
        llSitTarget(<-0.12048, -0.24196, 0.17443>, <0.06935, -0.00361, -0.64607, 0.76011>);
                
    }
        
    changed(integer change) {
        if (llAvatarOnSitTarget() != NULL_KEY)
        
                llSay(0, "IT'S GO TIME!");
                llSleep(01);
                llSay(channel,"gogogo3");
                
                
            llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION);  
                

   
    }
    
    run_time_permissions(integer perm) {
        string anim = llGetInventoryName(INVENTORY_ANIMATION, 0);
        if (anim != "") {
            llStopAnimation("sit");
            llStartAnimation(anim);
                            
                //starting position X
   // llSetScale(<1.00000, 1.00000, 0.5>); 
    llSetRegionPos(<217.05243, 193.47339, 22.83974>);
    //<217.05243, 193.47339, 22.60000> 
    llSleep(5);
          
//position 2 UP X
   // llSetScale(<1.00000, 1.00000, 1.0>); 
       llSetRegionPos(<217.05243, 193.47339, 23.3000>);
    //llSetRegionPos(<217.05243, 193.47339, 22.8000>);
    llSleep(5);
          
//position 3 UP X
   // llSetScale(<1.00000, 1.00000, 2.0>); 
       llSetRegionPos(<217.05243, 193.47339, 24.05000>);
    //llSetRegionPos(<217.05243, 193.47339, 23.3000>);
    llSleep(5);
  
 //position start - return to startposition  X
    //llSetScale(<1.00000, 1.00000, 0.5>); 
        llSetRegionPos(<217.05243, 193.47339, 22.83974>);
    //llSetRegionPos(<217.05243, 193.47339, 22.60000>);
    llSleep(5); 
        }
    }
}

 

Also... 

 

the listen in the sit script triggers another object that grows-moves in tandem.  It works except when the avatar stands. it runs through another move- grow cycle then stops which i don't want to happen.  So how do I stop it after the avatar stands?

This is that script:


vector startingSize=<1.00000, 1.00000, 0.5>;
vector startingPos=<217.05243, 193.47339, 22.60000>;


default {
     state_entry() {
        startingSize = llGetScale();
        startingPos = llGetPos();
        
        llListen( -27369, "", NULL_KEY, "" );
     }
listen( integer channel, string name, key id, string message )
     
     {    if ( message == "gogogo3" )
          
//starting position
    llSetScale(<1.00000, 1.00000, 0.5>); 
    llSetRegionPos(<217.05243, 193.47339, 22.60000>);
    llSleep(5);
          
//position 2 UP
    llSetScale(<1.00000, 1.00000, 1.0>); 
    llSetRegionPos(<217.05243, 193.47339, 22.8000>);
    llSleep(5);
          
//position 3 UP
    llSetScale(<1.00000, 1.00000, 2.0>); 
    llSetRegionPos(<217.05243, 193.47339, 23.3000>);
    llSleep(5);


 //position start - return to start position
    llSetScale(<1.00000, 1.00000, 0.5>); 
    llSetRegionPos(<217.05243, 193.47339, 22.60000>);
    llSleep(5);
 
          
     }

 

I need to sort this out today as it's for the SL19B event and need to have it working by end of today.  I can work with it as it is but it is kinna sloppy with the error message and double cycle thing and would like to fix those things..  

Thank you for your help.  

pixels xo

 

Edited by Pixels Sideways
Link to comment
Share on other sites

  • Pixels Sideways changed the title to Hi Need help asap with sit & listen scripts - error message, etc.

 this part is missing { and } braces

changed(integer change) {
        if (llAvatarOnSitTarget() != NULL_KEY)
        
                llSay(0, "IT'S GO TIME!");
                llSleep(01);
                llSay(channel,"gogogo3");
                
                
            llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION); 
    }

should be:

changed(integer change) {
        if (llAvatarOnSitTarget() != NULL_KEY) {
        
                llSay(0, "IT'S GO TIME!");
                llSleep(01);
                llSay(channel,"gogogo3");
                
                
            llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION);  
       }    
}

without the braces for the IF clause then when an avatar stands then llAvatarOnSitTarget is NULL_KEY, and as wrote requests permissions from NULL_KEY, which gives the error

Edited by Mollymews
this
Link to comment
Share on other sites

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