Jump to content

llSay (ch,string); issue


pixstudio
 Share

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

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

Recommended Posts

workin on script for pass data from hud to object i found this strange issue

the script accept the data correctly and trasmit to object........ but say in local the uuid of texture sent, when the script have an integer channel  different from local

here the code


list gDataLines1;
list gDataLines2;

integer ch1;

default
{
    

   
    state_entry()
{  
 }
         link_message(integer sender_num, integer num, string msg, key id)
{
     if (num == -1)
{
    gDataLines1 += msg;
    key A=(llList2String(gDataLines1,0));
    llSetTexture(A, ALL_SIDES);
 }
 
      else if (num == -6)
{
    gDataLines2 += msg;
    string B=(llList2String(gDataLines2,0));
   
 }
}
    
    
   
    
    
     touch_start(integer tn)
{
    key A=(llList2String(gDataLines1,0));
   
    string B=(llList2String(gDataLines2,0));
    integer ch1 =((integer) B);    
       
        if (A  != NULL_KEY)
        if (ch1 == ch1)   
{
       llSay((integer)B,A); }
       
   
 }
        
 }

Link to comment
Share on other sites

Your problem might be happening because the variables A / B are not global. Reformatting your script so it's readable...

list gDataLines1;
list gDataLines2;

integer ch1;

default
{



	state_entry() {
	}

	link_message(integer sender_num, integer num, string msg, key id) {
		if (num == -1) {
			gDataLines1 += msg;
			key A=(llList2String(gDataLines1,0));
			llSetTexture(A, ALL_SIDES);
		} else if (num == -6) {
			gDataLines2 += msg;
			string B=(llList2String(gDataLines2,0));
		}
	}

	touch_start(integer tn) {
		key A=(llList2String(gDataLines1,0));
		string B=(llList2String(gDataLines2,0));
		integer ch1 =((integer) B);

		if (A  != NULL_KEY)
			if (ch1 == ch1) {
				llSay((integer)B,A);
			}
	}
}

As it stands, taking B... The line at fault is

string B=(llList2String(gDataLines2,0));

Once the script leaves that If/Else the variable is discarded.

The fix is to define the variable B globally, so:

list gDataLines1;
list gDataLines2;
key A;
string B;
integer ch1;

default
...
...

 

Also, I'd make comment that this line is a bit redundant:

if (ch1 == ch1) {

and you seem to have some weird typecasting in

key A=(llList2String(gDataLines1,0));

that I would think could lead to problems

 

Also, the way you write this, if the user touches before a link message is recieved the script will crash.

Lastly, the way you push the message onto a list, then immediately use a 0 index in a llList2String commands means you will always use the first link message recieved no matter how many are sent. The User will clik-click-click-click-clik until the memory fills and overflows and the script crashes, but it will always apply the first texture it got.

 

 

Edited by Callum Meriman
Link to comment
Share on other sites

tnx Callum

gdatalines1 is my way to pass many data to the obj , but the issue was in gdatalines2 with the channel integer..........the strange thing , if the integer for local is 0 ( and this explain the uuid passed in local ) why the item that recive info collect correctly the info ( integer channel 00358 )

making some modify on the script , solved in different mode and now work with out local chat

Edited by pixstudio
Link to comment
Share on other sites

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