Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Listens

Max Pitre
Registered User
Join date: 19 Jul 2006
Posts: 370
04-12-2007 09:54
Made a script (from an existing forum script) to change an aspect of prim A. The change is controled with a menu from a remote prim (X) and a listen.
Made another script to change another aspect of the same prim A on another channel and menu set up from prim X. This all works great so far.
I do want to add more listens into the prim A, all controled through various menus from the remote prim x, maybe up to 3 more.
Now I will also have prims B through G all identical to prim A except they have different listen channels all still controled through pirm X. I already have made these prims and everything works great with the two original scripts useing different channels through the menu.
So in the end I will have prims A throuh H with a total of 35 different listen channels all controled through a single prim X.

How would this effect lag with so many muliple listens? Of course none are chat channels.

I feel there has to be a better way and linking the prims will be impossible due to the distances between the prims.

I hope this all makes sense.
Thanks :)
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
04-12-2007 10:44
From: Max Pitre
Made a script (from an existing forum script) to change an aspect of prim A. The change is controled with a menu from a remote prim (X) and a listen.
Made another script to change another aspect of the same prim A on another channel and menu set up from prim X. This all works great so far.
I do want to add more listens into the prim A, all controled through various menus from the remote prim x, maybe up to 3 more.
Now I will also have prims B through G all identical to prim A except they have different listen channels all still controled through pirm X. I already have made these prims and everything works great with the two original scripts useing different channels through the menu.
So in the end I will have prims A throuh H with a total of 35 different listen channels all controled through a single prim X.

How would this effect lag with so many muliple listens? Of course none are chat channels.

I feel there has to be a better way and linking the prims will be impossible due to the distances between the prims.

I hope this all makes sense.
Thanks :)



Why have different scripts and different channels for each attribute?
Use one script and one channel per prim. Just pass the attribute to change as well as the new value i.e. COLOUR:<1.0,1.0,1.0> or ALPHA:0.65 etc.
Max Pitre
Registered User
Join date: 19 Jul 2006
Posts: 370
04-12-2007 11:35
ummm, I dunno...

I want to have control over each attribute and each prim separately. Right now I have a menu that gives me a list of the prims to pick (or all), then the next menu lets me change an attribute for that single prim (or all). As of now, I guess I should have said this, I have another prim X(b) to change another attribute in the same way i.e.: pick the prim then change it but without affecting what was changed from the menu in prim X(a).
I guess what I need/want to do is combine the X prims into one along with adding the other attribute changes I need into the system without all being separate scripts and listens.

HEAD

All seems to be a bit over my head as how to implement or integrate into one script.
I'll figure it out...
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
04-12-2007 12:16
From: Max Pitre
ummm, I dunno...

I want to have control over each attribute and each prim separately. Right now I have a menu that gives me a list of the prims to pick (or all), then the next menu lets me change an attribute for that single prim (or all). As of now, I guess I should have said this, I have another prim X(b) to change another attribute in the same way i.e.: pick the prim then change it but without affecting what was changed from the menu in prim X(a).
I guess what I need/want to do is combine the X prims into one along with adding the other attribute changes I need into the system without all being separate scripts and listens.

HEAD

All seems to be a bit over my head as how to implement or integrate into one script.
I'll figure it out...



Each prim that is being controlled can have its own channel, but you only need one script which covers every attribute. The same script will be in each prim, just 'tuned' to a different channel which will be known to the controller.

If you look at youir existing scripts they will all be near enough identical, the differential will be the attribute that they control and the channel numbers they listen on. All you will do is make it such that you have one listen that handles all of the possibilities, but in stead of differentiating via channel number you will use a prefix on the message to identify the data

i.e.
CODE

integer Channel;

default
{
state_entry()
{
Channel = (integer)llGetObjectDesc(); // The channel number to use
llListen(Channel,"","","");
}

listen(integer channel, string name, key id, string msg)
{
// Expected input is COMMAND=value
list ldata = llParseString2List(msg,["="],[""]); // Split at =
string command = llList2String(ldata,0);
string parameter = llList2String(ldata,1);

if("COLOUR" == command)llSetColor( (vector)parameter);
else if("ALPHA" == command)llSetAlpha( (float)parameter);
else if("TEXTURE" == command)llSettexture(parameter, ALL_SIDES);

}

on_rez(integer num) { llResetScript(); }
}