Jump to content

Error type mismatch LLGetObjectName/Desc


TonyBowlin
 Share

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

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

Recommended Posts

Here I am trying to get Object name and Desc and use them as position values but think I confused myself on this one. I can't get this to work and I've been staring at this for hours. Any help would be great. Just note this is a linked object.

 

//vector close_position = <-0.00011, -0.26520, 0.17491>;
//vector open_position = <-0.00011, -0.26520, 0.20384>;
vector close_position;
vector open_position;
integer steps = 3;
float sleep = 0.01;
integer channel = 4;
integer close_open;
integer handle;
integer sitting;
vector step_position;
float stepsb;
vector vLin(vector x, vector y, float t){
    return x*(1-t) + y*t;
}
rotation slerp( rotation a, rotation b, float t ) {
   return llAxisAngle2Rot( llRot2Axis(b /= a), t * llRot2Angle(b)) * a;
}
close()
{
    float step;
    float stepsb = steps;
    while(stepsb--)
    {
        step_position = vLin(open_position, close_position, step);
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POS_LOCAL, step_position]);
        step = step + (1.0 / steps);
        llSleep(sleep);
    }
    llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POS_LOCAL, close_position]);
}
open()
{
    float step;
    float stepsb = steps;
    while(stepsb--)
    {
        step_position = vLin(close_position, open_position, step);
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POS_LOCAL, step_position]);
        step = step + (1.0 / steps);
        llSleep(sleep);
    }
    llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POS_LOCAL, open_position]);
}
close_or_open()
{
    if(llGetLocalPos() != open_position)
        open();
    else
        close();
}
default
{
    state_entry() {
        llListen(666,"", NULL_KEY, "");
        
        close_position = llGetObjectName();
        open_position = llGetObjectDesc();
        
        }
         listen(integer channel, string name, key id, string message)
        {
            integer z;
            integer A = 1;
            if (message == "test")
        {
            for(z = 1; z <= A; ++z)
            open();
            llSleep(5);
            close();
        }
    }
}

Link to comment
Share on other sites

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