Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

~How to use llLinkMessage for advanced stuff~

Shippou Oud
The Fox Within
Join date: 11 Jul 2005
Posts: 141
12-24-2006 14:18
I've gotten into a debate on this subject, and found a lot of folks do not know you can use LinkMessage to manipulate individual prims in a linked set. If anyone out there knows an easier way of obtaining the link numbers of each individual prim, let me know.
Here is a sample of LinkColor.


Now what does this mean, and do?
The first number ( 19 ) is the prim that is going to be affected, the second set of numbers ( <9,.1,.5> ) is the color, and the "ALL_SIDES" means...well, it affects all the sides of the prim.

Now this seems simple right? One problem, what prim is #19, and how did I find it out?
Once you link objects together, they get an unchanging Link Number assigned to them, the problem is how to get that number out of each prim.
Put this script in EACH prim, get out a pen and paper, clicking on each prim, will reveal it's individual number (it will NOT work if you simply stick it in the root prim, and trying to click on the individual prims)

touch_start(integer total_number)
integer ww1;
ww1 = llGetLinkNumber();
llInstantMessage(llGetOwner(), "This prim's link # is; " + (string) ww1");

Remember to delete the script after it's usefulness is done.

Now on for LinkMessage.


llMessageLinked(22, 0, "cc", "NULL_KEY");


link_message(integer int,integer num,string str,key id)
if (str == "cc")
v1 = llFrand(1.0);
v2 = llFrand(1.0);
v3 = llFrand(1.0);
c1 = < v1,v2,v3 >;
llSetColor (c1,ALL_SIDES);

The first one sends out a message to prim #22, the message is "cc".
The second one listens for a message , and if the message is "cc" is generates a random color.

This is how I know how to manipulate individual prims, with Link Message, as I said before, if anyone knows an easier way with out creating massive lag, let me know.
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Discussion Thread
12-24-2006 20:51
i've got nothing. ;)