Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

link_message can't hear me

SegmentationFault String
Registered User
Join date: 18 Jan 2009
Posts: 13
09-16-2009 09:33
I'm trying to have a child prim send a message to the root prim when I sit on the child.

I followed the examples from lslwiki (http://lslwiki.net/lslwiki/wakka.php?wakka=ExampleLinkMessage) and added this message to the sit event in the child prim: llMessageLinked(LINK_THIS, 0, "Touched.", NULL_KEY);

... then I created a script in the root prim to receive the message:
default
{
// Waits for another script to send a link message
link_message(integer sender_num, integer nChannel, string cMessage, key id)
{
llWhisper(0,"Sender #" + (string)sender_num + " says on channel #" + (string)nChannel + ": '" + cMessage + "'";);
}
}

When I sit on the child prim, the root does not spit out its confirmation message. On the advice of the in-world scripting tutorial group I changed LINK_THIS to LINK_ROOT and then LINK_SET, and neither had any effect. I took the item back to my inventory and re-rezzed it to restart the scripts, but that didn't help either.

What am I doing wrong? I want to do the right thing and use link_message to minimize lag, but I'll have to resort to say/listen if I can't get this to work.

EDIT: after trying llsay in the child, lllisten in the root... Dang, that didn't work either! It's like the root prim has gone completely deaf.
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
09-16-2009 09:36
LINK_THIS

...means "Send the message only to this prim", so the root prim will never see it.

Try LINK_SET to send it to every prim in the object, LINK_ROOT to send it only to the root prim, etc.


The rest *should* be ok, are you close enough to hear the llWhisper?


... oh and a take and re-rez does not restart the scripts. Edit the object, then Tools, Reset Scripts in Selection is what you would want.

(adding once again, make sure that the listening script is set as running, open it with the editor to see. IT's easy to get the script set as not-running with even a typo sort of error, then get a successful compile, and not notice that it is still set as not running.)
SegmentationFault String
Registered User
Join date: 18 Jan 2009
Posts: 13
09-16-2009 10:03
Thanks, Viktoria. I did indeed try both LINK_SET and LINK_ROOT (as noted in my original gripe) with no difference. I'm standing in the 10x16 room that is the object of my experiment, but just to be 100% sure I'll change whisper to say (I always use whisper for diagnostic messages so as not to disturb others around me).

Not sure I understand your explanation of how to confirm that a script is running... can you go through that click-by-click as though you were speaking to an idiot?
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
09-16-2009 10:10
In the root prim, open the script the usual way, like you are editing it. Peek at the checkboxes at the bottom, make sure that "running" is checked. You might try a tiny edit (just add and remove a space or something) and compile one more time, just to make sure it is really running. A "hi there" in state_entry can't hurt, just to make sure the thing is alive.

You could also use "set scripts to running" from the Tools menu, but the feedback in that window is a little vague.

For the noisy llSay problem, llOwnerSay can be a nice alternative for debugging. That will find you anywhere in the sim.
SegmentationFault String
Registered User
Join date: 18 Jan 2009
Posts: 13
09-16-2009 10:16
Oh, for the love of Linux... I overestimated the distance llWhisper would carry, and *assumed* I could hear it from the far side of a 16-meter-long room. Changed my diagnostic message to llSay, and all is well.

See, there's a reason I told you to treat me like an idiot. {facepalm}
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
09-16-2009 10:19
llOwnerSay is good for debugging - it will reach you, and only you, anywhere in the region.
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Indeterminate Schism
Registered User
Join date: 24 May 2008
Posts: 236
09-16-2009 15:00
Glad you're sorted. But; sit event?
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
09-16-2009 15:18
From: Indeterminate Schism
Glad you're sorted. But; sit event?

/me guesses that's shorthand for a change event plus the standard poseball code that goes with it.
_____________________
Sick of sims locking up every time somebody TPs in? Vote for SVC-3895!!!
- Go here: https://jira.secondlife.com/browse/SVC-3895
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left