[Opensim-dev] Trying to understand llDetected* functions

Dahlia Trimble dahliatrimble at gmail.com
Tue Jun 17 08:07:43 UTC 2008


On Tue, Jun 17, 2008 at 12:39 AM, Mike Mazur <mmazur at gmail.com> wrote:

> Hi Dahlia,
>
> On Tue, 17 Jun 2008 00:23:57 -0700
> "Dahlia Trimble" <dahliatrimble at gmail.com> wrote:
>
> > I'll take a shot at these from a perspective of having used most of
> > them in sl scripts
> >
> > On Mon, Jun 16, 2008 at 11:54 PM, Mike Mazur <mmazur at gmail.com> wrote:
> >
> > <SNIP>
> >
> > > What exactly do these values represent? According to
> > > OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
> > > line 152, _key is "detected key" and _key2 is "owner key". What are
> > > these exactly? The position, velocity, rotation and _string (name)
> > > properties make sense, but the _bool and _int ones don't.
> >
> >
> > llDetectedKey() returns the UUID of the agent (avatar) or object that
> > was detected
> > llDetectedOwner() returns the UUID of the owner of the object that was
> > detected.
>
> What does it mean to be "detected"? Let's take a simple example of a
> box with a script inside that calls llDetectedKey() and
> llDetectedOwner() in touch_start. Then both would return the UUID of my
> avatar?



the llDetected() fuctions should only work when called within the code block
of an event handler. For example, if I wanted to know which avatars were
nearby, I would call llSensor(), specifying AGENTS as the type. If there
were any qualified agents nearby, a sensor() event would be called within
the script. I would then probably use some code such as:

sensor( integer num_detected )
{
  integer i;

  for ( i = 0; i < num_detected; i++ )
  {
    float distance = llVecDist( llGetPos(), llDetectedPos( i ) );
    llSay( 0, "agent " + llDetectedName( i ) + " detected at distance: " +
(string) distance + " meters" );
  }
}

>
>
> Also, how can an object "touch" another object, with some function call?


I think the only way to touch an object is to click it with a mouse, which
would generate the touch() events. Other objects cannot touch it, but they
can collide with it or be detected with a sensor scan.


>
>
> > I dont know of any llDetected() functions that return booleans.
>
> I think I was unclear, the _key, _key2, _int, _bool, etc. variables are
> defined in the llDetectParams struct
> (OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
> line 152).
>

I havent looked at that code, but I dont think a script can access those.


>
> Thanks for the help thus far though. Things are becoming clearer.
>
> Mike
> _______________________________________________
> Opensim-dev mailing list
> Opensim-dev at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20080617/59a327db/attachment-0001.html>


More information about the Opensim-dev mailing list