Jump to content

Prim Object to send current UUID to other Prim Object help!


Syngravez
 Share

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

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

Recommended Posts

Hello forums! 

 

I need help regarding my script , i need help to get the current prim's UUID to send to another prim object and get it to say the others UUID out in chat.

 

So far i have this at the moment which probably has no revalence to what i am requesting but it should get what I'm getting at.

 

Sender:

integer rcv = -32455;

default
{
state_entry()
{
string GETUUID ;
GETUUID = (string)llGetKey();
llSetObjectDesc(GETUUID );    
}

touch_start(integer _det)

{
llRegionSay(rcv,"Test");
}}

 

Reciever:

integer rcv = -32455;
default
{

state_entry()
{
llListen(rcv,"","","");
}

listen(integer _src, string _name, key _id, string _msg)
{
if(_msg == "Test")
{
llSay(0, "I am listening don't worry!");
}
}}

 

If this can be done please help out , it would be much appericated!

 

 

Thanks in adavanced!

Link to comment
Share on other sites

You don't have to go to much trouble.  When you create a listen event, the third parameter it receives is the sender's UUID.  So, send ANY message.  Then

listen (integer chnnel, string name, key id, string msg){    llSay(0, "The sender's UUID is " + (string)id);}

The only time you'll have a problem is when you want to know the UUID of a specific prim in a linkset, rather than the UUID of the linkset itself.  In that case, you really will need to send llGetLinkKey(llGetLinkNumber()) .

  • Thanks 1
Link to comment
Share on other sites

Why thank you very much Rolig! 

 

Just that i'm trying to get the other prim(client)  to get the other prim(server) to get the UUID so i don't have to keep inputting a new key everytime i rez the product server!

 


P.S:  I have solved this with your help Rolig , thank you yet again! but for who wanted to know how this works.

 

Sender:

integer rcv = -32455;default{state_entry(){string GETUUID;GETUUID = (string)llGetKey();llSetObjectDesc(GETUUID);    }touch_start(integer _det) {llRegionSay(rcv,"Test");}}

 

Reciever:

integer rcv = -32455;ReadIt(){string GetKeyNow;    GetKeyNow = llGetObjectDesc();llSay(0, "The sender's UUID is " +GetKeyNow);   }default {state_entry(){llListen(rcv,"","","");}listen(integer _src, string _name, key _id, string _msg) {if(_msg == "Test"){llSay(0, "Currently setting the servers UUID in the current prim's description!");ReadIt();llSleep(3);llSetObjectDesc(_id);llSay(0, "Done!");}}}

 

Link to comment
Share on other sites

Since the thing to start this all off is the rezzing of a new server prim, why not add an on_rez event in it which gets the key and then sends it via an llRegionSay, using a message of the form "Server key is", and then does a script reset or initialisation.

Then the listening prims simply have to have a clause in their listen events to recognise that message, take the id, and update their own stored version of the server key.

Link to comment
Share on other sites

Oh.  Well, the answer is still fairly simple as long as the server and the client are in the same sim.  Just put

llRegionSay(-32455, "Hello");

in your server's on_rez event.  If they aren't in the same sim, though, it becomes trickier.  In that case, you may want to have your objects communicate through an external server by HTTP.

Link to comment
Share on other sites

Hmm , i'm not to sure how it's gonna work through that because i'm a little bit rusty with LSL at the moment.

How for example would i make this work via different sim through HTTP?

Like maybe get the server UUID to send to the HTTP and get it to write an .txt document with the key. Then get the client to read it from there ?

Link to comment
Share on other sites

  • 6 years later...
On 7/21/2013 at 10:33 PM, Rolig Loon said:

listen (integer chnnel, string name, key id, string msg){ llSay(0, "The sender's UUID is " + (string)id);}

Thank you sooooooo much!

Even 6 years later its almost impossible to find a simple and way of getting all the object details without manually adding them to each prim.
Now i can use this for RLV games cus the objects can be moved and rezzed by anyone and still work by sending RLV commands.

Link to comment
Share on other sites

Well i duno if im doing it wrong but 
it listens to its own UUID

 

Quote

integer chan = 666; //testing use regular RLV channel

key target;

//object details list
list pos;
//coordinate pharsing
vector vec;
float x;
float y;
float z;
//=====================DEBUGGIG===========================//
debug(string info)
{
    //debugging messages
    llSay(DEBUG_CHANNEL, "TELEPORT: "+(string)x+"/"+(string)y+"/"+(string)z );
}
//=========================================================//
default
{
    state_entry()
    {
        llListen(chan, "","","");
        target = llGetKey();

    }
    touch_start(integer say)
    {
        debug(""); //if it messes up
    }
    listen (integer channel, string name, key id, string msg)
    {

        if (msg == "contact")
        {
            id = llGetKey();
            list pos = llGetObjectDetails(id, ([ OBJECT_POS]));
            vector vec = llList2Vector(pos,0);
            //Vector Pharsing
            x = vec.x;
            y = vec.y;
            z = vec.z;
            
            debug(""); //if it messes up
            llSay(DEBUG_CHANNEL, "The RTD's UUID is " + (string)id);
            llSay(DEBUG_CHANNEL, "The RTD's UUID is " + (string)target);
        }
    }

}
 

 

Link to comment
Share on other sites

Melkana, as wrote the script overwrites the uuid of the sender passed in the listen parameter: key id

overwrites means this line:

 id = llGetKey();

which assigns the uuid of the prim the script is in to the variable id. Which is not what you want. Try the script again with this line removed

Link to comment
Share on other sites

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