Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

messagge linking, two questions

Danielz Shackle
Registered User
Join date: 30 Apr 2006
Posts: 100
06-02-2006 23:45
ok, awhile back i learned how to message link objects, and someone gave me idea of using list to send multiple variables between the objects... example would be

ON SENDING PRIM

list values = [a,b,c,d,e,f,g];

string str_values = llDumpList2String(values, "+";);

llMessageLinked(-1,0,str_values,"id";);

ON RECIEVING PRIM

link_message(integer sender, integer num, string msg, key id)
{
list values = llParseString2List(msg, ["+"],[]);

a=llList2Integer(values,0);
b=llList2Integer(values,1);
c=llList2Integer(values,2);
d=llList2Integer(values,3);
e=llList2Integer(values,4);
f=llList2Integer(values,5);
g=llList2Integer(values,6);
__________________

okay, now this works great for integers, my problem is im now wanting to send multiple user/object keys as well. I have tried to add them to list, and many errors come up no matter how i try to send it. I havent worked much with lists, im assuming you cant mix things in list, but ive tried sending list of keys and cant get that working eaither.

im shooting to add key on same list as h & i if possible, but any way to send list of keys with message linked would work

can someone point me towards right code to send keys?
Angela Salome
Registered User
Join date: 6 Oct 2005
Posts: 224
06-03-2006 00:11
CODE

list values = llParseString2List(msg, ["+"],[]);
a=llList2Integer(values,0);
b=llList2Integer(values,1);
c=llList2Integer(values,2);
d=llList2Integer(values,3);
e=llList2Integer(values,4);
f=llList2Integer(values,5);
g=llList2Integer(values,6);

The problem is that llParseString2List, is splitting the string msg into strings, not integers. You'll need to type cast properly, like:
CODE

a = (integer) llList2String (values, 0);
h = (key) llList2String (values, 7);
Danielz Shackle
Registered User
Join date: 30 Apr 2006
Posts: 100
thanks
06-03-2006 00:43
i was declaring the integers as global variables, but u pointed out the one thing i was forgetting, the easiest part, i forgot to change to List2String, i was keeping it list2integer and chaning the rest of scripts... ergh. thanks for the help