Jump to content
You are about to reply to a thread that has been inactive for 3217 days.

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

Recommended Posts

Posted

Hallo,

Completely new to scripting and only started glancing through it after 3 years of SecondLife..and I'm having a little trouble..

Experimenting with a nose kissing script that was a full perm script I came across and edited it to what little I know of..and simply I'm trying to get it so it shows display names instead of legacy names..I have it to show the display name of the owner, but not the recipient who clicks on it.

 I've fiddled around but keep getting a lot of errors..I know I'll look so bad to experienced scripters lol..but any help is appreciated.

 

default
{
state_entry()
{
llPreloadSound("");
}
on_rez(integer start_param)
{
llResetScript();
}
touch_start(integer total_number)
{
integer i;
for (i = 0;i < total_number;i += 1)
{
llPlaySound("", 0.4);
string origName = llGetObjectName();
string owner;
owner = llGetDisplayName( llGetOwner() );
owner = llList2String( llParseString2List( owner, [" "], [] ), 0 );
string avName;
avName = llDetectedName(i);
avName = llList2String( llParseString2List( avName, [" "], [] ), 0 );
llSetObjectName( avName );
llSay(0, "/me kisses " + owner + "'s Nose.");
llSetObjectName( origName );
}
}
}

 Edit: Solution is below..sent some Kudos out..thank you all who helped~

Posted

How about

string Display_name = llGetDisplayName(llDetectedKey(0));

?

You should be aware, of course, that llGetDisplayName, like llKey2Name and other name functions, will only work if you give it the UUID of an avatar who is in the same region at the time. If you can't count on that, you'll have to take the longer route of using llRequestAgentData, which won't give you a display name.

  • Like 1
Posted


TamFoxxy wrote:

 

 
avName = llDetectedName(i);

 

Here's the line you want.

Change it to:-

avname = llGetDisplayName(llDetectedKey(i));

This uses the DetectedKey to return a UUID key (not a string name, which is only the legacy name), to determine the Display Name in the same way you have done for the owner.

  • Like 1
Posted

Looks like the original script's geared toward Western/Roman style names that have their given name at the beginning, as is typical in SL in general.

I've not written a script that produced a Legacy Name in local chat since they were deployed. "Chinese-looking" or not, preference beats indexing when it comes to referencing identity for casual needs. IMO this is a good change, never-updated SL scripts are significantly more detrimental than naming aesthetics.

  • Like 2
Posted

Even new to the SL forum so I have no idea if multi-quoting is supported..agh.

 

Rolig Loon Freya Mokusei

Read through the wiki and some basic tutorials, I do know they must be in the same region(edit: I mean area/sim/place, not too familiar with the terminology.) for it to work, this script would only be used by people in the same area...both suggestions work the way I want it..thank you both. If SL forums have a rep system I'll send some reps both your ways. Thanks again!

 

default{state_entry(){llPreloadSound("");}on_rez(integer start_param){llResetScript();}touch_start(integer total_number){integer i;for (i = 0;i < total_number;i += 1){llPlaySound("", 0.4);string origName = llGetObjectName();string owner;owner = llGetDisplayName( llGetOwner() );owner = llList2String( llParseString2List( owner, [" "], [] ), 0 );string avName;avName = llGetDisplayName(llDetectedKey(i));avName = llList2String( llParseString2List( avName, [" "], [] ), 0 );llSetObjectName( avName );llSay(0, "/me kisses " + owner + "'s Nose.");llSetObjectName( origName );}}}

 

 

 

Posted

Woot woot. :)

Glad to hear of your success. The llDetected... (Name, Key, Pos, others) functions are very good to know.

You can click the Kudos button on our posts if you like (that's this forum's reputation system, although it doesn't work well) - I (and I'm sure Rolig, too) am not playing for points, just a relief to have someone enjoy figuring out the solution. :)

Posted

Well, yes, connected to the same server. :smileywink:  The avatar must be a main or child agent of the region, which is to say that s/he must either be in the region or must have only recently left it. An avatar is a child agent if his/her client is still connected to the region's server, which is typically true for a few minutes after the avatar has left the region.  For all practical purposes, though, it's best not to count on that nuance for doing important work, because there's no guarantee that the length of that child agent period will be consistent. 

Posted

LOL, I say LOL.

Is it important to know the display name of someone when kissing the nose of someone who isn't in the same region (or was in the region recently but has now departed)?  Perhaps.

So I remind that there is available llRequestDisplayName.

Joining in the nitpicking I'll mention that some, even though they have display names, have no wish to be referred to by them.

Finally I suggest this display name:  Areso Arnott

Posted

Hehe ... I agree.  It's only relevant if the OP rezzes his object and walks away.  In that case,

owner = llGetDisplayName( llGetOwner() );

will come up empty, and massive confusion will ensue.  ;)

Thank you for the reminder about llRequestDisplayName, though. I avoid display names like the plague myself, so I wasn't thinking of that function earlier.

(BTW, Why would someone go to the trouble of creating a display name if she didn't want to be called by it?  In the very unlikely case that I ever create one -- like Goingita Loon -- I'd either wear it proudly or change it again.)

Posted


Rolig Loon wrote:

...(BTW, Why would someone go to the trouble of creating a display name if she didn't want to be called by it?  In the very unlikely case that I ever create one -- like Goingita Loon -- I'd either wear it proudly or change it again.)

People do the strangest things.  Who knows why.  Before display names people would put other stuff over their heads using group titles and floating text.  Sometimes it was something they wanted to be called but not necessarily. When display names arrived some people used that as an additional/alternative way to put other stuff over their heads.

You are about to reply to a thread that has been inactive for 3217 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
×
×
  • Create New...