pixstudio Posted October 3, 2018 Share Posted October 3, 2018 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 More sharing options...
Love Zhaoying Posted October 3, 2018 Share Posted October 3, 2018 This means B = 0 somehow. 0 is the channel for local chat. I suggest you use llOwnerSay to debug gDatalines. Example: llOwnerSay(llDumpList2String(gDatalines, “,”); This way, you can see if it’s missing the entry that results in B. Link to comment Share on other sites More sharing options...
Callum Meriman Posted October 4, 2018 Share Posted October 4, 2018 When you post code, please click the <> icon in the compose area, then paste it in there. Link to comment Share on other sites More sharing options...
Callum Meriman Posted October 4, 2018 Share Posted October 4, 2018 (edited) 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 October 4, 2018 by Callum Meriman Link to comment Share on other sites More sharing options...
pixstudio Posted October 4, 2018 Author Share Posted October 4, 2018 (edited) 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 October 4, 2018 by pixstudio Link to comment Share on other sites More sharing options...
Recommended Posts
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