Jump to content

llwhisper


DelizaLove
 Share

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

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

Recommended Posts

1.) If you want to let an object talk with a different name in chat you should first, save the existing object name to a global varialbe with llGetObjectName( ).

2.) Then get the name of the owner. Be aware that you will get a different output format if you use llKey2Name or llGetUserName. Try the example below (the example works with touch and not the owner). You will see that for your purpouse, llKey2Name is the better option. (By the way: You need to change this code snippet if you want to get the Key of the object owner and not the person who touches...)

 

default{    touch_start(integer total_number)    {        key id = llDetectedKey(0);        string name1 = llKey2Name(id);        llSay(0, name1);                string name2 = llGetUsername(llDetectedKey(0));        llSay(0, name2);            }}

 

3.) Change the name of the object vie llSetObjectName(string name)

4.) Say something in chat

5.) Set the name of the object back to the original object name with the global variable (see step 1).

Link to comment
Share on other sites

You could use llSetText and put the message on the hud itself which might be better than using chat.

 

-------------------------------

 

                                              <- main hud

Space for text to display

-------------------------------

                                              <- message prim

-------------------------------

Link to comment
Share on other sites

You could set the HUD object's name every time it is worn....it will revert to the

 name you gave it when removed...

something like this.....

 

string name;
string MYname;

init()
{    
     name =  llKey2Name( llGetOwner() );
     MYname = llGetSubString(name,0,llSubStringIndex(name," "));
     llSetObjectName(MYname);
}   

default
{
    state_entry()
    {   init();
    }
    on_rez(integer param)
    {   init();
    }
     attach(key id)
    {   init();

     }

}

_______________________________

 

 now when the HUD whispers, it will use the wearer's first name :)

Link to comment
Share on other sites

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