Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Linking Scripts

Badd Haul
Registered User
Join date: 17 Sep 2006
Posts: 5
10-12-2006 19:08
I would like to know if there is a way to have one script, when some criteria is matched, call another script.

I am trying to set a mutli user permission script built for a door work on a tint. If I copy the script code into the permissions script I get a lot of syntax errors.

If there is a better script that someone knows of for this action that would be cool too, but I am tired of other people changing my tint values without permissions.
Russell Hansen
Texi pets are here!
Join date: 11 Apr 2006
Posts: 107
10-12-2006 19:24
I'm not sure I understand your second and thrid paragraphs, but the simplest way to have one script respond to another, in the same object, is to use llMessageLinked to pass messages between them.
_____________________
Russell Hansen - Texi Pet Creator
Texi Pets, your SL Companions and Personal Assistants
http://texipets.com
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
10-12-2006 19:27
It sounds like you need to limit that script which triggers your tint changes to only respond when you interact with it. If you touch a button to change the tint.. then you need to add something within yor touch_start() event like:
CODE
touch_start(integer start_param) {
if (llDetectedKey(0) == llGetOwner()) { // check to see if the toucher is the owner (you)
// all the code for whatever it does when clicked
}
}


or, if your script responds to chat commands rather than clicking... you need to modify a single line in your script. Look for a line with the llListen() function and replace the second double-quotes inside the parenthesis with llGetOwner(). You should have something like:
llListen(0, "", llGetOwner(), "";);
Badd Haul
Registered User
Join date: 17 Sep 2006
Posts: 5
10-21-2006 17:46
I'm not sure I understand your second and thrid paragraphs, but the simplest way to have one script respond to another, in the same object, is to use llMessageLinked to pass messages between them.

what is the llMessageLinked?
what is the syntax..an example maybe?
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
10-21-2006 19:13
you discribed it, it sends messages tru linked prims (as one object)

sender
CODE

default
{
touch_start(integer total_number)
{
llMessageLinked(0,0,llDetectedName(0), llDetectedKey(0));
}
}

CODE

llMessageLinked(integer linknum, integer num, string str, key id)

integer linknum , in multi prim objects you can assign messages to go directly to a pirm in a linkset or you can use these constants

LINK_ROOT 1 root prim in linked set (but not in a single prim, which is 0)
LINK_SET -1 all prims in object
LINK_ALL_OTHERS -2 all other prims in object besides prim function is in
LINK_ALL_CHILDREN -3 all child prims in object
LINK_THIS -4 prim script is in

integer num, any valid whole number you can also use this as a filter (sorta like radio channels)

string str, any valid string
str may be blank, ("";) or as long as desired. str and id are only limited by the amount of available memory. (i wouldnt push it tho)

key id, any valid UUID , with typecasting on the receiver end you can use this as a extra 36 charater string feild, may be blank or NULL_KEY

receiver
its an event, like state entry or listen
CODE

default
{
link_message(integer sender_num, integer num, string str, key id)
{
llOwnerSay(llGetScriptName() + " output " + str +" UUID =" + (string)id);
}
}



integer sender_num, which prim sent the message
integer num, the number you sent
string str, the string you sent
key id, the UUID you sent
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
10-22-2006 02:33
I've written a similar system for AJ Trumbo for Windows. Sets both tint and alpha.
The 'control' prim displays a dialog when touched allowing setting of the required parameters. It them broadcasts this information to all associated windows.
Current version is using standard llShout calls on a specified channel, Mainly because that is the way I originally wrote it, the control object isnt apart of the house link set.