Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Scripted object: Fetching the avatar's (owner's) name

Mylenne Aluveaux
Registered User
Join date: 27 Sep 2007
Posts: 11
02-05-2008 23:40
Hi!

I'm new to scripting with LSL.

I just wanted - for exercise purposes - to display the name in 'clear text' of an avatar owning the object with that script in it. I either get this cryptic user ID key or just '0'. How do I translate the UUID into the avatar's 'real' name? Search didn't help so far... :o(


LG

/Mylenne
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
02-05-2008 23:54
llKey2Name(llGetOwner());




:)
Mylenne Aluveaux
Registered User
Join date: 27 Sep 2007
Posts: 11
02-06-2008 00:12
Thanks!

Hm, I think I went over these already. So I must have used them the wrong way. Let me check later today on it again. -- The situation is that the object containing the script is rezzed but not attached to an avatar. It should 'print' the avatar's name when one (he/she) touches the object.


LG

/Mylenne
Kaluura Boa
Polygon Project
Join date: 27 Mar 2007
Posts: 194
02-06-2008 00:28
Saying the name of the "toucher". From the top of my head:

default
{
touch_start(integer num)
{
key toucher = llDetectedKey(0);
llSay(0, llKey2Name(toucher));
}
}
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
02-06-2008 00:58
There is also llRequestAgentData() and the 'dataserver' event, in case the agent you are interested in is not currently around.

http://www.lslwiki.net/lslwiki/wakka.php?wakka=llRequestAgentData
Mylenne Aluveaux
Registered User
Join date: 27 Sep 2007
Posts: 11
02-06-2008 15:26
From: Kaluura Boa
Saying the name of the "toucher". From the top of my head:

default
{
touch_start(integer num)
{
key toucher = llDetectedKey(0);
llSay(0, llKey2Name(toucher));
}
}


So, this only works within touch_start(), right? In state_entry() I just get this UUID and / or an empty string.


LG

/Mylenne
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
02-06-2008 15:40
in state entry try this

CODE

default
{
state_entry()
{
llSay(0, "I am owned by "+llKey2Name(llGetOwner()));
}
}
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
02-06-2008 15:43
From: Mylenne Aluveaux
So, this only works within touch_start(), right? In state_entry() I just get this UUID and / or an empty string.


LG

/Mylenne

"Note: The llDetected* functions will only return a meaningful value in the collision(), collision_start(), collision_end(), sensor(), touch(), touch_start(), or touch_end() events."
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
02-06-2008 16:38
From: Kaluura Boa
Saying the name of the "toucher". From the top of my head:

default
{
touch_start(integer num)
{
key toucher = llDetectedKey(0);
llSay(0, llKey2Name(toucher));
}
}

Or just llSay(0, llDetectedName(0));