Jump to content

NavigateTo a rez prim name! How do i do this?


Cindy Kraai
 Share

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

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

Recommended Posts

I was trying to get my animesh back to its home using a dedicated rezzed prim (at a parcel) with a particular name, i'm n

string home_base = "homeObject";
vector prim_pos;
ReturnHome() 
{
    list primsinparcel = [ home_base];
    integer l_length   = llGetListLength( primsinparcel );
    list objdetails; 
    for ( ; l_length  > -1; --l_length  )
    {
        objdetails = llGetObjectDetails(llList2String(primsinparcel,l_length),[OBJECT_NAME]);
        if ( llList2String(objdetails,0) == home_base )
        {
            vector prim_pos = llList2Vector(llGetObjectDetails(l_length, [OBJECT_POS]), 0);
            llNavigateTo(prim_pos, []);
        }
    }
}

ew to pathfinding please help! 

Link to comment
Share on other sites

It seems you want help finding that named destination prim. Most applications will have the destination prim's key by other means - for example, it may be the object that rezzed the pathfinding character, or maybe it's scripted to respond to a query on a particular channel, or whatever -- but if you really need to find it by name, a one-shot llSensor() might do the trick, assuming it's the only object with that name, and it's within 96m of the character when the sensor scans. (There's no function that queries for all objects on a parcel.)

If you're worried about spoofing or accidental name collisions, a sensor event detects up to 16 nearest objects matching its filter, so you could wade through those checking whatever object details you think make a good signature of the object you really want. (Hint: You have a lot of control over OBJECT_LAST_OWNER_ID).

  • Like 1
Link to comment
Share on other sites

If it is dedicated, and you don't need to worry about sim resets etc,

you could just get the base prim's key and use pursue?

 ReturnHome()
 { llPursue(BASE_PRIM_KEY_HERE, [PURSUIT_OFFSET, <-1.0, -1.0, 0.0>, PURSUIT_FUZZ_FACTOR, 0.2]);

   }

 

Edited by Xiija
  • Like 1
Link to comment
Share on other sites

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