Jump to content
  • 0

Object Inspect


Asimos
 Share

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

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

Question

I want to write a script that will work like the 'inspect' function, ie. I click on an object and I can get the object details back (perhaps using the function llGetObjectDetails).

Which function/event should I use to get the object id when I click on it?

I looked into the collition and touched evens but those do not seem to be the right events to use.

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

You don't want to be clicking on the object itself.  It won;t tell you anything unless it is scripted to do so.  I'd suggest using a sensor, triggered by the touch_start event in your own object.  Look for

llSensor("","",ACTIVE|PASSIVE,10.0,PI);

and then look for llDetectedKey() and llDetectedName() for each object that the scan detects.

  • Like 1
Link to comment
Share on other sites

  • 0

Of course I want to click on my target, how else to choose the target (I do not know the object's/avi's name or their UUID). The most natural way is to be able to click on my target and get, object's/avi's key so I can then use it to get all the necessary info that my scripts need. Think of the Right-click/inspect function of the viewer, or the right-click on a target avatar and start an IM session. I do not think they use an IISensor() or similar type of function.

Link to comment
Share on other sites

  • 0

As I explained, you cannot do that with LSL. Unless the object you are clicking on contains a script that will tell you its UUID, you cannot get the information that way. You have no choice but to use a sensor. The right-click/Inspect function is a feature of the viewer, not an LSL scripting feature.

Link to comment
Share on other sites

  • 0

Maybe I'm missing something.

Let's say there are 3 objects around me.

I use the sensor and with llDetectedName I get 3 names: Obj-A, Obj-B, Obj-C.

How does this help me to identify my target?

 

Link to comment
Share on other sites

  • 0

Let's not carried away and loose focus. I'm sure you understand that I'm trying to do a concept proof before I start scripting. Therefore, I would like to refocus the discussion on the main requirement and not how llDetectedKey() or llDetectedName() works. That is really trivial.

The issue is how to target an object or an avatar using your mouse (once I get soem sort of ID, a name or a UUID back, the rest is easy).

Link to comment
Share on other sites

  • 0

And what I am telling you is that you cannot do that with LSL. The Inspect feature that you are interested in is a built-in feature of the viewer, not accessible with a LSL script. The only way to get the information you want with LSL is to scan for it with a sensor. You can't use llGetObjectDetails unless you already have some way to identify the object by its UUID, which is exactly the bit of information you are looking for.

Link to comment
Share on other sites

  • 0

I have no way to identify the object other than pointing at it. What a disappointment again by the limitations of LSL. I wonder how those combat sites and the various guns in SL work.

 

By the way, thanks for the objects/scripts that you have send me. As you might have already realized, all you get are information about he objects around you and nothing to point out to you which object is the one you are looking at. I have done a similar script using the sensor, just last week to check if the master of a slave is in the same sim to activate the leash particles (among other things). In that case I know the name of the master (and therefore the UUID of the master) and I can do an if statement to identify them and their position. Also I have done a scanner (long time ago) that you can enter the name or the UUID of an avatar and get back their real online status. I'm sending you a copy. Very useful for keeping an eye on cheating bf and/or gf :-)

 

You wrote "The only way to get the information you want with LSL ....". Is there any other way that I can do it? I can code in java, python, C, C++, VB and VB.net I haven't seen an external application wrapper in SL yet.

 

Link to comment
Share on other sites

  • 0

What if I attach an object on my avatar (let's call that Hammer) and I go through the list of objects around me (the list I get from sensor scan) and I hit each one on the head (I can get their position and I can move/position the Hammer on those x/y/z coordinates). Will that raise a collision event to get their id?

Link to comment
Share on other sites

  • 0

So, you asked, "Is there any other way that I can do it? I can code in java, python, C, C++, VB and VB.net I haven't seen an external application wrapper in SL yet." No, sorry. You cannot use any language other than LSL in SL..

 

Hitting each object is certainly one way to do it. Essentially, fire a bullet at the object and telegraph back the UUID of what you hit. An easier way is to fire a cast ray ( using llCastRay ) at the target. That has the advantage of not requiring you to rez anything -- problematic in some areas.

  • Like 1
Link to comment
Share on other sites

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