Jump to content

issue on llMessageLinked


pixstudio
 Share

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

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

Recommended Posts

hi i have a little problem with this comand.....

i have created a configurator

the configurator read notecard and send to hud  the data (this part work because llSay show me the correct data trasfer)

but when i press any button on hud i recive error and the llSay check show me only the first letter of the message

 

this part is correct?

 link_message(integer sender_num, integer num, string msg, key id)  
  { if (llGetSubString (msg, 0, 1) == "A")
     {

//A1=message -A
string A1 =(llGetSubString(msg,1,-1));   
       llSay(0,"A"+msg);    }

 

Link to comment
Share on other sites

Hi Pixstudio,

Formatted your code to read a bit better, is this what you meant?

link_message(integer sender_num, integer num, string msg, key id)  
{
    if (llGetSubString(msg, 0, 1) == "A")
    {
        string A1 =(llGetSubString(msg,1,-1));  
        llSay(0,"A"+msg);   
    }
}

If that is the case not quite clear what you are trying here.

  • the if will never read TRUE, llGetSubString(msg, 0, 1) will read in the first two characters of msg. If you only want the first it should be llGetSubString(msg, 0, 0)
  • your llSay is just going to say the full message with an 'A' added to the front.

 

  • Like 1
Link to comment
Share on other sites

This is a bit of a guessing game, since we can't see your code. but if you're sending a UUID via link message, and putting the UUID in the final, id, field of the llMessageLinked call, then 

link_message(integer sender, integer num, string str, key id){
	llOwnerSay((string)id);
}

in the receiver prim will tell you what "id" is.

Otherwise, please post, at least, the code you are using to send the link message and the whole of the link_message event that receives the UUID.

Link to comment
Share on other sites

you are correct Innula with no specific info noone can help

so for the transmiter

    if (llGetSubString (msg, 0, 0) == "A")

{

     string riga00 =(llGetSubString(msg,1,-1));       
     llMessageLinked(LINK_THIS,-1,"A"+(string)riga00,"");
     llSay(0,"A"+(string)riga00);


for the receiver

 link_message(integer sender_num, integer num, string msg, key id)  
 
  {

if (llGetSubString (msg, 0, 0) == "A")
 { 

     llSay(0,"primocheck"+msg);//check
    string A1 =(llGetSubString(msg,1,-1));
     key A=A1;  
     llSay(0,"secondocheck"+A1);    //check

}

 

i think the problem is relative to touch event, beacuse the two check work correctly, but when i press a button i recive error and llSay of button show me only A

Edited by pixstudio
Link to comment
Share on other sites

Thanks.   What code do you have inside the touch event?

And when you say "i recive error and llSay of button show me only A," what does that refer to?  What does the sender script say to you, and what does the receiver say?   What does it say in "primocheck" and what does it say in "secondocheck"?

I must say that, on the face of it, this seems an over-complicated way of doing things.    As far as I can tell, the logic of your code is that if the first letter of the message in the transmitter is "A", you want to send that message to the receiver.   So the only test you need, I think, is

if(llGetSubString(msg,0,0)=="A"){
	llMessageLinked(LINK_THIS,-1,msg,"");
}

There's no need to keep chopping bits off the string and then reassembling it, which is what your code seems to do,

  • Like 1
Link to comment
Share on other sites

thanks Innula , i found the error , in reciver i forget to do  llgetsubstring (msg,1,-1) my fault ........ but every error give a lesson to undestand and remember for improving   ^ _^

another question

channel used for listen have an uuid ther is a way for create integer used for channel using an iternal string , and something write in description

example

offset= 12

obj description = red12   ( letter string give  number 0  )

integer desc = (integer) (llGetObjectDesc() );

integer ch = (desc + offset);

not sure that work the final channel must be in that example 01212

Link to comment
Share on other sites

As long as the answer is logical, unique, and reproducible, you can use any scheme you like for choosing your channel number.  Your only guidelines are that the channel must be an integer (preferably negative and preferably non-zero )  And it should be chosen in such a way that you can avoid crosstalk with other scripted objects in the region and can be sure that whatever is listening to a script that sends a message on that channel either knows what the channel is or is capable of finding out easily.

  • Like 1
Link to comment
Share on other sites

sure Rolig uuid must be unic to avoid any crosstalk with other scripted item in region i use the example above only for an advice if is possible to use any random info for generate uuid

thinking on your message , give me an idea to use owner uuid for generate uuid + a suffix in obj description adding "-" in the integer obtained in this way

example

integer offset = (integer) (llGetObjectDesc() );

 

integer ch = (integer) ("-" + llGetSubString(llGetOwner(),0,6) + offset);

Edited by pixstudio
Link to comment
Share on other sites

 integer g_chan =  0x80000000 | (integer)("0x"+(string)llGetOwner()) ;  
        integer offset;
        if( offset = (integer)llGetObjectDesc()  *  -1 ) 
       { g_chan += offset;
        }

 

... or, you could hard code offsets for your projects,

and keep a notecard with all the offsets for each build you have made

to avoid crosstalk between scripts.

 

Edited by Xiija
Link to comment
Share on other sites

5 hours ago, pixstudio said:

integer ch = (integer) ("-" + llGetSubString(llGetOwner(),0,6) + offset);

That specific formula won't work, but you have the general idea.  Using any UUID as the base will work, so your own UUID, or the owner's, or the key of the object itself, or the rezzer that produced it.  To make it negative, you can use Xijia's suggestion, or

integer g_chan = (integer) ("0xF" + llGetSubString(llGetOwner(), 0,6));

or just multiply it by -1:

integer g_chan = -1 * (integer) ll llGetSubString(llGetOwner(), 0,6);

 

Link to comment
Share on other sites

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