mischief Goldshark Posted January 13, 2012 Share Posted January 13, 2012 is there a way to send a list from 1 object to another in 1 message?i need to send a list of keys from 1 object to another, the list may have 0-10 keys in it..thanks Link to comment Share on other sites More sharing options...
Darkie Minotaur Posted January 13, 2012 Share Posted January 13, 2012 No and yes. No, you can't pass a list to a different script directly. But you can dump the list into a string, send the string and parse it into the list again in the receiving string. Look at llDumpList2String and llParseString2List. How you send the message - saying it in some way (llSay, llWhisper ...) depends on the situation. 1 Link to comment Share on other sites More sharing options...
mischief Goldshark Posted January 13, 2012 Author Share Posted January 13, 2012 great, just what i needed thanks Darkie :smileyhappy: Link to comment Share on other sites More sharing options...
Shihan Feiri Posted January 14, 2012 Share Posted January 14, 2012 I work on similar thing, and have list with keys. But something I am making wrong... List that i recive ( list t) is uuid1,uuid2,uuid3,uuid4,uuid5 string tex1; string tex2; string tex3; string tex4; string tex5; default { state_entry() { llListen(1, "", "", ""); } listen( integer channel, string name, key id, string message ) { if (channel == 1) { list t= [message]; // on list are 5 texture UUID's integer i = 0; integer end = llGetListLength(t); for (; i<end; ++i) llSay(0,message); //Test of listen event tex1=llList2String(t,1); tex2=llList2String(t,2); tex3=llList2String(t,3); tex4=llList2String(t,4); tex5=llList2String(t,5); llSetTexture((key)tex1,1); llSetTexture((key)tex2,2); llSetTexture((key)tex3,4); llSetTexture((key)tex4,5); llSetTexture((key)tex5,6); } } on_rez(integer param) { llResetScript(); } } Link to comment Share on other sites More sharing options...
Darkie Minotaur Posted January 14, 2012 Share Posted January 14, 2012 You never parse the message into a list list t = llParseString2List(message, [","], []); Link to comment Share on other sites More sharing options...
Shihan Feiri Posted January 14, 2012 Share Posted January 14, 2012 umm, thank you I need to get glasses ... Link to comment Share on other sites More sharing options...
Yingzi Xue Posted January 17, 2012 Share Posted January 17, 2012 Keep in mind also that if you run into a null key or a null value and you try to send it, if a specific order is expected on the receiving end your values will be out of sync (missing the null values). Always check for null values before sending the string to the receiving end. Replace null values with a place-holder value so that the receiving end knows what it is. 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