Jump to content

strange behavior using llGetObjectDetails


Robin Mapp
 Share

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

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

Recommended Posts

Hi All,

trying to use the below snippet to grab the object details of an object , weird behavior is the the script doesn't detect an object in contact with the prim containing the script. It does however detect and grab the details of an avatar when the collision is made. I have tried linked prims and a single prim colliding with the script containing prim to no avail.  Any suggestions would be apprciated.

 

collision_start(integer n)


{
key uuid=llDetectedKey(0);
list a = llGetObjectDetails(uuid, ([OBJECT_NAME,OBJECT_DESC, OBJECT_POS]));
llSay(0,"\nName: \"" + llList2String(a,0) + "\"" +
"\nDescription: \"" + llList2String(a,1) + "\"" +
"\nPosition: " + llList2String(a,2));

llShout(23, llDetectedName(i) );
llSay(PUBLIC_CHANNEL, llGetObjectDesc() );
}

Link to comment
Share on other sites

THANK YOU! That solves the dilemma but creates a new one, what I am trying to do is :

 

I have a prim scanning for a named object, upon it sensing the named object it rezs another prim to the sensed objects location as a beacon of sorts. I would like this beacon to capture the object details of the named object and instant message them to owner of the beacon. I was hoping the collision event that would occur upon the rezz event could be used as the trigger. I could script another sensor in the beacon but was having issues with llGetObjectDetails from within the sensor state.

 

Any other ideas?

 

 

Thanks!

Link to comment
Share on other sites

One possibility would be to use the already sensing object to send the information to the ava in question. Or you could have the sensing object pass on the information to the rezzed object. I guess there are a few other possibilities - but in order to identify the options, it would be helpfull to understand the use case in some more detail.

Link to comment
Share on other sites

if you scan for a specific object you don't need to send any collision probe after it because you already have the object uuid from the scan, as well as it's name and position via llDetectedName(), llDetectedPos(). all you have left is query for description via llGetObjectDetails.

There is no additional object parameter that can be obtained from collision as compared with scan.

 

Link to comment
Share on other sites

so here is the scanning script I wrote to detect the named object, where I am having issues, is when I plug in the llGetObject details the script fails, All I am trying to do is set a beacon at the pos of the named object and message that pos and the object desc to the owner,

 

integer type = 2;
integer on = TRUE;
string objectname = "[Named Object]";

default
{

touch_start(integer total_number)
{
on = llAbs(on - 1);
if (on)
{
llSetTimerEvent(2.5);
llOwnerSay("Scanning");
llSetText("Scanning",<0,1,0>, 1);
llTargetOmega(<0,0,0>,0.1,PI);

}
else
{
llSetTimerEvent(0);
type = 2;
llSay(0,"Scanner is Off");
llOwnerSay("Scanner is Off");
llSetText("Scanner is Off",<1,0,0>, 1);

}
}

timer()
{
llSensor(objectname, "", type, 10, PI);
type = type * 2;
if (type > 8) type = 2;
}

sensor(integer total_number)
{
integer i;
for (i = 0; i <total_number; i++)
{

llRezObject("Beacon", llDetectedPos(i), <0.0,0.0,0.0>, <0.0,0.0,0.0,1.0>, 0);
}


}
}

//

Thanks for any help guys!

Link to comment
Share on other sites

You're already rezzing a new beacon each time the sensor spots the same object, so you need to fix that problem and the description issue at the same time.  You nmight try something like this....

integer type = 2;integer on = TRUE;string objectname = "[Named Object]";list gNamedObjects;default{    touch_start(integer total_number)    {        on = llAbs(on - 1);    // Or, better, on = !on;        if (on)        {            llSetTimerEvent(2.5);            llOwnerSay("Scanning");            llSetText("Scanning",<0,1,0>, 1);            llTargetOmega(<0,0,0>,0.1,PI);    //This spin was never turned on. It's also client-side, so won't affect the scanner.        }        else        {            llSetTimerEvent(0.0);            type = 2;            llSay(0,"Scanner is Off");            llOwnerSay("Scanner is Off");            llSetText("Scanner is Off",<1,0,0>, 1);        }    }    timer()    {        llSensor(objectname, "", type, 10.0, PI);        type = type * 2;        if (type > 8) type = 2;    }    sensor(integer total_number)    {        integer i;        for (i = 0; i <total_number; i++)        {            if ( !~llListFindList(gNamedObjects,[(string)llDetectedKey(i)])) //We haven't detected this object before, have we?            {                string Desc = llList2String(llGetObjectDetails(llDetectedKey(i),[OBJECT_DESC]),0);    // Get object description                llRegionSayTo(llGetOwner(),0,"Object with description " + Desc + " is located at "+ (string)llDetectedPos(i));                gNamedObjects += [(string)llDetectedKey(i)];    //Add object's key to the detected list                llRezObject("Beacon", llDetectedPos(i), ZERO_VECTOR, ZERO_ROTATION, 0);    // Rez a beacon            }        }    }}

 As the sensor discovers one of your named objects, it sets a beacon and sends you the information you wanted, and it then stores the object's UUID so that it ignores it on subsequent scans.  You may want to make a provision for clearing that list somewhere, perhaps when you shut your device off in the touch_start event.

  • Like 1
Link to comment
Share on other sites


Robin Mapp wrote:

[...]

now can you fix the 10M rezz limit :matte-motes-big-grin-wink:

 

Yes!  I have been experimenting recently, thanks to a comment that Lucinda made in another thread.  It turns out that Linden Lab quietly changed the rez limit sometime last year, probably when they made it possible to create 64m megaprims.  With a little guidance from a voice from beyond, I have determined that the rez range now is approximately

float Range = llVecMag( 0.5 * llGetScale()) + 10.0;

I say "approximately" because the formula doesn't apply at all to prims that are sub-megasized.  Your rezzer has to be at least 10.1m x 10.1m (Z doesn't seem to make much difference).  Also, the "0.5" factor is almost right, but a slight underestimate for really large rezzer prims.  

Link to comment
Share on other sites

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