Jump to content

Get Avatar name from clicking on them or nametag


Dominic Damiano
 Share

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

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

Recommended Posts

There are very specialized ways to do something similar, but as Wulfie says, there's no direct way to detect that you've clicked another object or avatar.

  • It's possible to know where the avatar's cam is pointing (in general, and especially in mouselook) and llCastRay in that direction to see which avatar it intersects first.
  • Or, to be able to click somewhere other than exactly where the cam is directed, a HUD covering the full display can detect clicks and project them into 3D space although this is fraught with complexity, some of which will be reduced by new features in the upcoming Gingerbread release, notably LlWorldPosToHUD. (Also perhaps of interest: llGetCameraAspect() and -FOV.)

Obviously this is all a lot more bother than just a touch*() event.

Edited by Qie Niangao
(typo)
  • Like 1
Link to comment
Share on other sites

I just detect everyone around and use it to populate a dialog menu. Somewhere in this forum there's even at least a few examples of how to do this (probably posted by Rolig and/or Innula). You can also click on their name in the menu dialog to have it do something else with their name in a script, like speak to them in local chat, or even send an instant message.

I used this approach when I made my rabid, flying, attack bunny swarm summoner. Even as far as using their name in a llSay() message to tell the bunnies who to swarm.

Edited by PheebyKatz
Link to comment
Share on other sites

4 hours ago, PheebyKatz said:

Somewhere in this forum there's even at least a few examples of how to do this

I was prompted recently to post a rather old script I wrote that did such in the LSL library. It's actually rather subtle and tricky to do in a way that 100% won't crash in a room full of people with crazy (long&/funny symbols) names. (said example does crash)

  • Thanks 1
Link to comment
Share on other sites

9 hours ago, Quistess Alpha said:

I was prompted recently to post a rather old script I wrote that did such in the LSL library. It's actually rather subtle and tricky to do in a way that 100% won't crash in a room full of people with crazy (long&/funny symbols) names. (said example does crash)

Kinda why it's so handy to be able to just grab their username and avoid display names, though it throws some people off when they see the usernames and don't recognize anyone, because display names, lol.

For what it's worth, I'm pretty sure what I tend to use was crafted out of the very one that you made, and it's never given me any problems at all since I worked the few itsy kinks it had out of it. Pretty sure Rolig's example of a menu somewhere helped, also. At least it works for my purposes well enough that it's my go-to menu making module for anything involving "targeting" people on the sim.

  • Like 1
Link to comment
Share on other sites

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