Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Link Message Help

Lance Sismondi
Registered User
Join date: 28 Apr 2006
Posts: 21
02-05-2008 19:39
I've looked in the wiki and found the area dealing with link messages to be a bit sparse. I am new to scripting and need to build a menu driven script that will list bullet type options for RP combat weapons and send a message to the main script to rez the appropriate bullet when fired.

I am really interested in different methods for accomplishing this with minimal lag as many RP sims suffer from tremendous lag. I am very interested in a good tutorial reference for the different usages of link message communications between scripts in the same prim and also in linked child prims & between a HUD and an object. It's a tall order I know. But I could really use any help I can get. My preference is to do it myself with a nice heavily commented script to assist in developing my scripting competence.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-05-2008 20:24
link messages are only good within a linkset, so using them for sommunication between hud and other objects is out the window, llSay on an off channel with filters for either name or preferably owner items (llGetOwnerKey() == llGetOwner()) for that.

otherwise just treat them the same as says/listens, with 3 type of messages that can be sent at one.

instead of channels you have link numbers, with LINK_SET being like a built in channel 0, other than that, link numbers act like a channel that only the prim with the same number can hear.

the link_message gets the prim number that sent the message (kind of like knowing the channel to send back to), and three types of messages instead of one. (an integer, a string, and a key, which could optionally be used for text). to specify which script within a prim sent the message you can include a code for it in one of the message fields, or instead use a code to tell the recieving script what it's supposed to do with the message.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Rob Adelaide
Cream Cheese Fanatic
Join date: 19 Oct 2006
Posts: 34
02-05-2008 20:30
If you are using the menu directly to rez an object when you click, you could forgo the LinkMessage entirely.

The dialog simply says whatever is on the button you click, as the avatar that clicks it, on the channel you specify in llDialog. You could simply have a listen in the rezzing prim that responds by creating the object when it hears the appropriate command from your menu.

(I may be off, but I assume you mean Dialog when you say menu-driven)

-R
Lance Sismondi
Registered User
Join date: 28 Apr 2006
Posts: 21
02-06-2008 08:12
Correct. I do mean dialog. But U need the dialog menu to communicate to the main weapons script to use a no-push damage only bullet. This is what I need help with.

Regarding the HUD communications, thanks for the tip. I will use LLSay to communicate on a specific channel to the weapon.

I need a good tutorial resource for link message communications so that I can become self sufficient. Any help would be appreciated. Thanks!
Haruki Watanabe
llSLCrash(void);
Join date: 28 Mar 2007
Posts: 434
02-06-2008 09:28
did you try the lsl-wiki, yet?

http://www.lslwiki.net/lslwiki/wakka.php?wakka=HomePage

These pages have quite some examples as well as a more detailed description - usually :)
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-06-2008 10:00
one gotcha that I forgot, scripts sending link messages to LINK_SET, LINK_THIS, LINK_ROOT (if they're in the root) or a specific numbered prim that is the same as the one the script is in, can hear their own link messages, unlike says, beware blindly operating on data recieved without a proper check
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -