Jump to content

Get Avi UUID on click?


Irene Aedipo
 Share

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

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

Recommended Posts

default{    touch_start(integer num_det)    {        llSay(0,(string)llDetectedKey(0));    }}

 The trick is the 'llDetectedKey' there, it works alongside num_det. Because several people can be 'touching' a prim at once, it detects the touch only of the first touching user each time, resolving uniquely with each separate touching user. Especially considering the event is touch_start not touch

ETA: Seeing Darkie's questions below made me re-read your post. In order for this script to work that user whose key you need would need to click the prim containing this script. To obtain someone elses key without them touching a scripted prim, follow Darkie's helpful advice.

Link to comment
Share on other sites


Irene Aedipo wrote:

I'm stuck. I have tried to figure out how to obtain the UUID of an avatar when I click directly on the Avatar. Is it possible and if it is - please help me out here. I have no idea how to get this done right.

Not possible.

Alternative: A hud using raytrace or a scanner probably gives decent results, but depends what purpose you have.

Link to comment
Share on other sites


Darkie Minotaur wrote:

Do you mean by script= You can't script an ava. You can put a script in an attachement that say the key of the owner when touched using llGetOwner().

Do you mean through the menu that pops up un a right click? In Firestorm, if you open the Profile, the keyx is shown under the name.

Well if you can get the key by right click -> profile? I might be out of it but isn't there any way of - how do I say this - get that key through programming? Or am I off and need another approach?

Link to comment
Share on other sites

Not possible.


Maybe a hud that uses llCastRay and gets target info on mouseclick will work. Most probably mouselook is required for proper aiming.

Or use llSensor to get nearby avatars and choose target from a menu.

Click on world is not possible because a script can not obtain the position of your mousepointer.

Link to comment
Share on other sites


Nova Convair wrote:

Not possible.

 

Maybe a hud that uses llCastRay and gets target info on mouseclick will work. Most probably mouselook is required for proper aiming.

Or use llSensor to get nearby avatars and choose target from a menu.

Click on world is not possible because a script can not obtain the position of your mousepointer.

Then my only approach must be llSensor and a menu to choose avatar from. Now I might be too frank, forgive me, but are there any help to get? I have no idea on how to get this accomplished. Can anyone please help me out with the start? I might get the finetuning right myself but I do not know how to script this - I dont have the starting base to make this right. Maybe there is a simple solution that I dont know yet?

Link to comment
Share on other sites

llSensorllDialogListen (event) will all be useful to you.

You basically want to create a sensor that builds a list, and then once complete send llDialog to llGetOwner (you), containing the output list from the sensor. The script then listens to your selection, and returns their key.

Returning key would have to be done by a second sensor, or by using the initial sensor to store two lists. One containing names, the other containing keys.

Link to comment
Share on other sites

Irene Aedipo wrote:


[...]  Now I might be too frank, forgive me, but are there any help to get? I have no idea on how to get this accomplished. Can anyone please help me out with the start? I might get the finetuning right myself but I do not know how to script this - I dont have the starting base to make this right. Maybe there is a simple solution that I dont know yet?

If you are willing to learn, that's what this forum is for.  We are not here to provide free scripts, undercutting work that you should be able to hire other scripters to do.  Give a good try at writing your script, though, and post the results here as you get stuck at specific spots.  We'll be glad to share insights about how to build on your scripting, and argue about alternatives.  We have each learned that way.

Link to comment
Share on other sites

Well... a slightly different approach would be to llRayCast for agents in the direction you're looking. I'm talking about a one-dimensional ray, so I mean in the exact direction your cam is looking, as with using Control-Alt-drag to swivel the cam around a focused-upon object. It's not the same as clicking, but it's not that clumsy, either.

For a script that does some of what you'd want (and just enough more to be confusing), go to http://maps.secondlife.com/secondlife/Bay%20City%20-%20Dennis/133/229/26 and look down for a little black box that wants to sell you a free, full perm, "Cammed Object Info HUD".

One thing you'd want to change is the call to llCastRay() to reject all types but agents. Then, instead of all the details about script time and memory that it gets now, just show the name and keep track of the UUID in a global variable, so you can use it in a touch_start event to target your particles. I'm not sure whence the particles will emit, if triggered from a HUD... probably your crotch, actually... so if that's a problem, you can fiddle with using something other than, or in addition to, the HUD.

(While you're there, you can sit on the blue-cushioned chair and play with my Cam Tutor thingy. I keep hoping somebody will take an interest in it. :matte-motes-bashful-cute: )

Link to comment
Share on other sites

I agree with Rolig that this forum is not the place to ask for free scripts, but I am not sure that is what you did.

Having said that I can see that what you want to do is quite heavy stuff and not simple at all
It is not a thing a beginner should do as the first thing
It includes all kinds of disciplines found in LSL

Here is a script, as short as I could make it, that can be used to capture an agent's key:

// click agent for key, script by Dora Gustafson, Studio Dora 2013// 1. Place script in an attathced prim// 2. Go in mouselook: press key "M" on the keyboard// 3. Point agent and left click// The agent key will show in a floating text above the prim// The text is cleared when no agent is founddefault{    attach(key id)    {        if (id) llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS);        else llReleaseControls();    }    run_time_permissions(integer perm)    {        if(PERMISSION_TAKE_CONTROLS & perm) llTakeControls( CONTROL_ML_LBUTTON, TRUE, TRUE);    }    control(key id, integer level, integer edge)    {        if ( level & edge )        {            list L = llCastRay( llGetRootPosition(), llGetRootPosition()+50.0*llRot2Fwd(llGetRootRotation()),                [RC_REJECT_TYPES, RC_REJECT_PHYSICAL | RC_REJECT_NONPHYSICAL | RC_REJECT_LAND, RC_MAX_HITS, 1]);            if ( llList2Integer( L, -1) >0 ) llSetText( "Agent key: "+llList2String( L, 0), <1.0, 1.0, 1.0>, 1.0);            else llSetText("", ZERO_VECTOR, 0.0);        }    }}

 

Note that it only captures the agent key. It has no particle stuff at all
Also note it has a distance limit max 50 meters (in: 50.0*llRot2Fwd(llGetRootRotation()))

:smileysurprised::):smileyvery-happy:

Link to comment
Share on other sites

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