llDialog Issues
|
|
Brandon Chandler
Registered User
Join date: 15 Jul 2006
Posts: 9
|
05-28-2007 19:19
I am having some trouble getting this script to work correctly. It is suppose to allow you to touch it, dialog you with a list of the first 11 object in the inventory and a next button, if you press the next button it will bring up the next 11 objects and another next button. Once you reach the end, it will start back over at the first page. At the moment, it is showing the first 11 and the next button, but will not move through the rest of the pages. Any adivce, suggestions or help is most welcomed. // // //--------------------Globals list items; integer list_start = 0; list temp; integer g_listener = FALSE; integer randomChannel = 0; integer item_len; // // //--------------------Capsules loop() { //Search Integer Primer integer i; integer c; //Establish Objects in Inventory integer totalDetected = llGetInventoryNumber(INVENTORY_OBJECT) + 1; //Move into Comparision Loop for (i = 0; i < totalDetected; i++) { //Search Results string name = llGetInventoryName(INVENTORY_OBJECT,i); items += name; } item_len = llGetListLength(items) - 1; for(c = 0; c < (item_len - (11 + (item_len%11))) + 1; c++) { items += " "; } item_len = llGetListLength(items) - 1; temp = llList2List(items,list_start,list_start + 10 ) + "Next"; list_start = list_start + 11; return; } // // //--------------------States default { state_entry() { //Set Up a Listen llListenRemove(g_listener); // Add a random channel randomChannel = 10 + (integer)llFrand(100000); g_listener = llListen(randomChannel,"",llGetOwner(),""); } touch_start(integer num) { loop(); llDialog ( llGetOwner(),"Object",temp,randomChannel ); }
listen(integer channel, string name, key id, string msg) { if(channel == randomChannel) { if ( msg == "Next" ) { temp = llList2List(items,list_start,list_start + 10 ) + "Next"; list_start = list_start + 11; if ( list_start == item_len) { list_start = 0; temp = llList2List(items,0,10 ) + "Next"; llDialog ( llGetOwner(),"Object",temp,randomChannel); return; } if(list_start < item_len) { llDialog ( llGetOwner(),"Object",temp,randomChannel); return; } } llSay(0,msg); llResetScript(); } } }
|
|
Lyn Mimistrobell
(waiting)
Join date: 11 Jan 2007
Posts: 179
|
05-29-2007 02:23
When the list is read initially, the temp list is set to the first 11 items and list_start to point to the 12th. When "Next" is pressed, you generate a new temp list and increments list_start to point to the 23rd. If you only have 22 items in the total list, you reset list_start back to 0 and create a new temp list without having shown the 2nd list. I bet if you have over 22 items (eg 33), it will show the first 2 pages but never the last one. I suggest you remove the "list_start = list_start + 11;" from the loop() function and change the listen code to this: listen(integer channel, string name, key id, string msg) { if(channel == randomChannel) { if ( msg == "Next" ) { list_start = list_start + 11; if ( list_start >= item_len) { list_start = 0; } temp = llList2List(items,list_start,list_start + 10 ) + "Next"; llDialog ( llGetOwner(),"Object",temp,randomChannel); } else { llSay(0,msg); llResetScript(); } } }
There are some other improvements to be made like not having a variable named "temp", not have the temp list global, etc. but the above should fix your problem I think. Coditor
|
|
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
05-29-2007 02:36
By any chance are you in fact getting the error - llDialog: all buttons must have label strings.  Knowing this helps a lot.  Your main problem is that you're padding items with lots of blank entries which is giving rise to the error. I also gave up trying to tweak the listen Event Handler code and just simplified it. // // //--------------------Globals list items; integer list_start = 0; list temp; integer g_listener = FALSE; integer randomChannel = 0; integer item_len; // // //--------------------Capsules loop() { //Search Integer Primer integer i; //integer c; //Establish Objects in Inventory integer totalDetected = llGetInventoryNumber(INVENTORY_OBJECT) + 1; //Move into Comparision Loop for (i = 0; i < totalDetected - 1; i++) { //Search Results string name = llGetInventoryName(INVENTORY_OBJECT,i); items += name; } //item_len = llGetListLength(items) - 1; //for(c = 0; c < (item_len - (11 + (item_len%11))) + 1; c++) //{ //items += " "; //} item_len = llGetListLength(items) - 1; list_start = 0; temp = llList2List(items,list_start,list_start + 10 ) + "Next"; //list_start = list_start + 11; return; } // // //--------------------States default { state_entry() { //Set Up a Listen llListenRemove(g_listener); // Add a random channel randomChannel = 10 + (integer)llFrand(100000); g_listener = llListen(randomChannel,"",llGetOwner(),""); }
touch_start(integer num) { loop(); llDialog ( llGetOwner(),"Object",temp,randomChannel ); }
listen(integer channel, string name, key id, string msg) { if(channel == randomChannel) {
if ( msg == "Next" ) { list_start = list_start + 11; if (list_start > item_len) list_start = 0;
temp = llList2List(items, list_start, list_start + 10 ) + "Next"; llDialog ( llGetOwner(),"Object", temp, randomChannel); return; }
llSay(0,msg); llResetScript(); } } }
|
|
Chrysala Desideri
Scarlet Scriptrix
Join date: 4 Mar 2007
Posts: 65
|
Same Problem, managed to break solution...
08-24-2007 08:28
had the same problem with the next button simply having the menu die. on lsl editor acts completely different, just gives final button value and next, without any of the rest. Scripting noob here, trying to make a cute TP... here's my (mostly bungled) code first, and the notecard it's making it's lists from after (hope i know how to post this right, first time) //Script info /////////////SCC-TPC 0.1b
//Global Variables //////////////////
//base variables that won't change //////////////////////////////////
//key target;
list startMenu; list lBaseList; float fListenTime = 30.0; list src;
///////////////// //initialised varibles for variation ////////////////////////////////////
//--------------------Globals
integer list_start = 0; list temp;
integer item_len; //
string sMenuTitle;
integer iListenTimeout; integer MENU_CHANNEL; integer MENU_HANDLER; list lDesclist; integer COMCHAN; //= -12; vector destination; key kCoord; string coord = "coordinates"; integer iLinecount = 0; integer not_blank = 0; list lCoord; list lPointlist; integer linecoord; /////////////
////menu setup from forums///
menu(key user,string title,list buttons) //make dialog easy, pick a channel by itself and destroy it after 25 seconds
{ MENU_CHANNEL = (integer)(llFrand(99999.0) * -1); //yup a different channel at each use MENU_HANDLER = llListen(MENU_CHANNEL,"","",""); llDialog(user,title,buttons,MENU_CHANNEL); llSetTimerEvent(25.0); }
///////////////////
//////////////
//States ////////
default { on_rez(integer start_param) { llResetScript(); integer iLinecount = 0; //do i need to do this? integer not_blank = 0; } changed(integer change) { if(change & CHANGED_INVENTORY) { llSay(0,"State Reset"); //when i mess with notecard values llResetScript(); } } state_entry() { llListenRemove(MENU_HANDLER); // llResetScript(); lBaseList =[]; lDesclist= []; lPointlist =[]; // llSay(0,(string)llGetLinkNumber()); //eliminated stuff = for later use, once it works!
// target = llGetLinkKey(4); // llParticleSystem( [ ] ); // force particles off kCoord = llGetNotecardLine(coord, iLinecount); } /////////////////////////// touch_start(integer t) { //on touche rezzes beam from link child, beam listens on COMCHAN for destination
iListenTimeout = llGetUnixTime() + llFloor(fListenTime); COMCHAN = (integer)(llFrand(99999.0) * -1);
//llSay(0,(string)COMCHAN);
sMenuTitle = "Teleporter Unit"+"\n"+(string)lDesclist;
llMessageLinked(LINK_ALL_CHILDREN,COMCHAN,"rez",llDetectedKey(0)); list_start = 0; temp = llList2List(lBaseList,list_start,list_start + 10 ) + "Next"; menu(llDetectedKey(0),sMenuTitle ,temp); } timer() //so the menu timeout and close its listener { llSetTimerEvent(0.0); //llSay(0," llListenRemove(MENU_HANDLER);"); //stuff ffrom trying to figure out where it breaks down llListenRemove(MENU_HANDLER); } /////////////////
listen(integer channel,string name,key id,string message) { if (channel == MENU_CHANNEL) //in case you have others listeners {
if(message != "Next") //this works, debug messages show it gets all data.... { destination = (vector)llList2String( lPointlist,((integer) message - 1)); //llWhisper(0,(string)destination); llWhisper(COMCHAN,(string)destination); llPlaySound("ae9f6fe5-b77e-11bd-3e4d-c1a620d99ac0",0.5); llListenRemove(MENU_HANDLER); } if ( message == "Next" ) //debugs active, because this is where i lose it. they all return the values they are supposed to be getting, but the menu does not appear. llSay(0,"NextPressed"); //indeed it does list_start = list_start + 11;llSay(0,(string)list_start); if (list_start > item_len) {list_start = 0;}
temp = llList2List(lBaseList,list_start,list_start + 10 ) + "Next";
llSay(0,(string)temp); //returns "1213141516171819202122Next", buttons are just numbers, i use the description box to go over 24 chars.
menu(llDetectedKey(0),sMenuTitle ,temp);
//below were various tries i did to see if somehow it couldn't do the menu... noobish superstition, i don't know what's wrong!!
//llDialog(llDetectedKey(0),sMenuTitle, temp, MENU_CHANNEL); //MENU_CHANNEL = (integer)(llFrand(99999.0) * -1); //yup a different channel at each use //MENU_HANDLER = llListen(MENU_CHANNEL,"","",""); // llDialog(llDetectedKey(0),sMenuTitle,temp,MENU_CHANNEL); //llSetTimerEvent(25.0);
} } /////////////////// dataserver(key queryid, string data) { if (queryid == kCoord) { llSay(0,"Checking Notecard line: " + (string)iLinecount); if(data != EOF) { if(data != "") { not_blank+=1; lCoord = llParseString2List(data,[";"],[]); //make lines lists
vector point = (vector)llList2String(lCoord, 1); //get coordinates
//string srot =llList2String(lCoord, 2); //not sure how to do these yet
lBaseList= (lBaseList=[]) + lBaseList +(string)(not_blank); //numeric buttons
string desc = (string)(not_blank) + " "+llList2String(lCoord, 0) + "\n"; //description box entries
lDesclist =(lDesclist=[]) + lDesclist + desc; //build them up, seen it on forums lPointlist = (lPointlist=[])+lPointlist+point; //build them up, seen it on forums iLinecount+=1; //bump counter
item_len = llGetListLength(lBaseList) - 1; // not sure what this is doing
llSay(0,(string)not_blank); //debug
kCoord = llGetNotecardLine(coord, iLinecount); //find next line
//list_start = 0; //random attempts to mes with start, etc... looking for the culprit
temp = llList2List(lBaseList,list_start,list_start + 10 ) + "Next"; //build up temp
} else { kCoord = llGetNotecardLine(coord, iLinecount++);} //skip line? that is what this is right? } else { llSay(0,"READY"); //finished reading } // return; //possibly an error to add it, has made no difference, something's gumming it up after... } } }
Ok, that's my horrible frankenstein monster... now for the notecard. help me bring it to life! [CODE?] Mall-Casbah;<80.493,15.017,43.052> SkyMall;<211.708,70.458,389.053> SkyMall Lower Level;<125.62136, 56.98187, 371.26132> DanceClub-Casbah;<80.120,6.073,23.189> Alamout Palace;<239.920,101.880,82.023> Houri Tower;<214.274,101.829,114.539> Djinni Tower;<209.936,101.993,114.539> Sunset Tower;<200.618,121.653,66.600> Hashishins Garden;<225.806,126.500,48.279> Torre Scarlatta;<129.539,145.683,70.370> Villa Scarlatta;<99.227,145.495,56.686> Piazza Gynoi;<123,120,22.246> [/CODE] Anyway to have a look at what i'm trying to do, visit Turmus (mature) at the skymall lower level coords... from the notecard. the stuff is in the office, the box in the nw quarter of the floor. the tp's are pre-paging and have only 12 choices. the plywood box is where i'm trying this code with a doubled version of the notecard (card contents repeated) I'd be very thankful for any help soever! Ciao!
|
|
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
08-24-2007 09:28
llDetectedKey only works in Event Handlers that detect agents, so, menu(llDetectedKey(0),sMenuTitle ,temp); isn't going to work in the listen Event Handler ...but... menu(id,sMenuTitle ,temp); will!  BTW llSay(0,(string)llList2CSV(temp)); will give a better formated debug on a list.
|
|
Chrysala Desideri
Scarlet Scriptrix
Join date: 4 Mar 2007
Posts: 65
|
Thanks tons!!
08-24-2007 09:39
Popping off right now to try it, oddly enough not knowing ths at all (i thought i ould carry around the key continually lol) i had looked i had looked with suspiscion at key, but had no idea what to do about it.
Thanks a lot!
<edit - wrote pooping instead of popping>
|
|
Roj Snook
Registered User
Join date: 2 Jun 2007
Posts: 49
|
09-07-2007 07:52
(Chrysala Desideri) Just wondering if it all worked, and if so could you post the code here? 
|
|
Chrysala Desideri
Scarlet Scriptrix
Join date: 4 Mar 2007
Posts: 65
|
09-08-2007 08:36
yes, worked perfectly... the code is in a box free to copy, by the zen garden near the office now. having login trouble, but once i get in i'll copy it out here. should be about the same as above but with Pale's alteration... still working out how to do an access list on the TP's, and maybe some other glitter i'd like to have the dialog show a differently compiled llDialog as per whether the detected key is either: Owner, SameGroup/OnList, or Joe Blow. having quite a bit of trouble on that for now, so not quite ready for prime time, though good enough for in-home use 
|
|
Chrysala Desideri
Scarlet Scriptrix
Join date: 4 Mar 2007
Posts: 65
|
multipage dialog from notecard
09-08-2007 09:33
//Script info /////////////multipage dialog from notecard
////////////
//Use notes /////////// //gets notecard data, presents detailed list and numbered buttons on multiple pages //////////// //example written for warpPos teleporter, destinations from notecard
//Global Variables //////////////////
//base variables that won't change //////////////////////////////////
key target; list startMenu; list lBaseList; float fListenTime = 30.0; list src; key kCoordinates; string coordinates; key id; ///////////////// //initialised varibles for variation ////////////////////////////////////
//--------------------Globals
integer list_start = 0; list temp;
integer item_len; //
string sMenuTitle;
integer iListenTimeout; integer MENU_CHANNEL; integer MENU_HANDLER; list lDesclist; integer COMCHAN; //= -12; vector destination; key kCoord; string coord = "coordinates"; integer iLinecount = 0; integer not_blank = 0; list lCoord; list lPointlist; integer linecoord; /////////////
menu(key user,string title,list buttons) //make dialog easy, pick a channel by itself and destroy it after 25 seconds { MENU_CHANNEL = (integer)(llFrand(99999.0) * -1); //yup a different channel at each use MENU_HANDLER = llListen(MENU_CHANNEL,"","",""); llDialog(user,title,buttons,MENU_CHANNEL); llSetTimerEvent(25.0); }
///////////////////
//////////////
//States ////////
default { on_rez(integer start_param) { llResetScript(); integer iLinecount = 0; integer not_blank = 0; } changed(integer change) { if(change & CHANGED_INVENTORY) { llSay(0,"State Reset"); llResetScript(); } } state_entry() { llListenRemove(MENU_HANDLER); // llResetScript(); lBaseList =[]; lDesclist= []; lPointlist =[]; kCoord = llGetNotecardLine(coord, iLinecount); } /////////////////////////// touch_start(integer t) { iListenTimeout = llGetUnixTime() + llFloor(fListenTime); COMCHAN = (integer)(llFrand(99999.0) * -1); sMenuTitle = "Teleporter Unit"+"\n"+(string)lDesclist; llMessageLinked(LINK_ALL_CHILDREN,COMCHAN,"rez",llDetectedKey(0)); list_start = 0; temp = llList2List(lBaseList,list_start,list_start + 10 ) + "Next"; menu(llDetectedKey(0),sMenuTitle ,temp); } timer() //so the menu timeout and close its listener { llSetTimerEvent(0.0); llListenRemove(MENU_HANDLER); } ///////////////// listen(integer channel,string name,key id,string message) { if (channel == MENU_CHANNEL) //in case you have others listeners { if(message != "Next") { destination = (vector)llList2String( lPointlist,((integer) message - 1)); llWhisper(COMCHAN,(string)destination); llListenRemove(MENU_HANDLER); } if ( message == "Next" ) list_start = list_start + 11;llSay(0,(string)list_start); if (list_start > item_len) {list_start = 0;} temp = llList2List(lBaseList,list_start,list_start + 10 ) + "Next"; llSay(0,(string)temp); menu(id,sMenuTitle ,temp); } } /////////////////// dataserver(key queryid, string data) { if (queryid == kCoord) { llSay(0,"Checking Notecard line: " + (string)iLinecount); if(data != EOF) { if(data != "") { not_blank+=1; lCoord = llParseString2List(data,[";"],[]); vector point = (vector)llList2String(lCoord, 1); string srot =llList2String(lCoord, 2); lBaseList= (lBaseList=[]) + lBaseList +(string)(not_blank); string desc = (string)(not_blank) + " "+llList2String(lCoord, 0) + "\n"; lDesclist =(lDesclist=[]) + lDesclist + desc; lPointlist = (lPointlist=[])+lPointlist+point; iLinecount+=1; item_len = llGetListLength(lBaseList) - 1; kCoord = llGetNotecardLine(coord, iLinecount); list_start = 0; temp = llList2List(lBaseList,list_start,list_start + 10 ) + "Next"; } else { kCoord = llGetNotecardLine(coord, iLinecount++);} } else { llSay(0,"READY"); } return; } } }
cleaned it up much as possible. stick this and a notecard in a prim, then turn it into whatever you need  notecard lines for this example (a teleporter) are written with following format: DestinationName;VectorLocation;HeadingTag(or)Rotation
|
|
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
09-08-2007 09:46
From: Chrysala Desideri i'd like to have the dialog show a differently compiled llDialog as per whether the detected key is either: Owner, SameGroup/OnList, or Joe Blow. This is no where near a complete solution but you might find the following three conditions useful: uName = llKey2Name(id); if(id == llGetOwner()) // Owner : else if((llSameGroup(id) == TRUE) || (llListFindList(friendList, [uName]) != -1)) // Group plus an arbitary list of friend's names : else if(llListFindList(guestList, [uName]) != -1) // aribitary list of guest names : The two lists, friendList and guestList, might be read from a notecard.
|
|
Chrysala Desideri
Scarlet Scriptrix
Join date: 4 Mar 2007
Posts: 65
|
09-08-2007 13:46
mmm i've started an attempt but run into some problems right away.. first of all i think i was using samegroup wrong, but that's beside the point. What i've been doing so far is have the access level in the notecard info, and have the dataserver make 3 lists out of the notecard data... ownerlist (all the card) guestlist(group+list+general access) and general access. stack heap collision... plus doing it with a very reduced notecard (3 destinations) it's somehow getting the coordinates wrong (obviously i'm getting owner list.) Crashed out now, but going back in for the bits i've been experimenting with, will post here asap idea for now is to find a way to have one script handle access list and verifying (linkmessage to same prim)and "just give a match code"  but it seems the real problem is handling the difft lists. i'm not explaining very well.. off for the code...
|
|
Chrysala Desideri
Scarlet Scriptrix
Join date: 4 Mar 2007
Posts: 65
|
09-08-2007 13:57
Right, i got this tuff going on in dataserver event, m aking the lists seperately:
if(data != "") { lCoord = llParseString2List(data,[";"],[]); vector point = (vector)llList2String(lCoord, 1); string srot = llList2String(lCoord, 2); string access = llList2String(lCoord,3); string arrival = llList2String(lCoord,4);
//[.......]
if(llToLower(access)=="list"||llToLower(access)=="group" ||llToLower(access)=="all" || llToLower(access)=="")
//make list of group/guestlist destinations.
{ gNotblank+=1; gline = "V"+"|"+(string)(gNotblank); lGroupList= (lGroupList=[]) + lGroupList+gline ; desc = "VIPlist "+(string)(gNotblank) + ": "+llList2String(lCoord, 0) + "\n"; glDesclist =(glDesclist=[]) + glDesclist + desc; glPointlist = (glPointlist=[])+glPointlist+point; glRotlist = (glRotlist=[])+glRotlist+vWarpRot; } if(llToLower(access)=="owner"||llToLower(access)=="list"||llToLower(access)=="group"||llToLower(access)=="all" || llToLower(access)=="")
//make list of owner destinations
{ oNotblank+=1; oline = "O"+"|"+(string)(oNotblank); lOwnList= (lOwnList=[]) + lOwnList+ oline ; desc = "Owner "+ (string)(oNotblank) + ": "+llList2String(lCoord, 0) + "\n"; olDesclist =(olDesclist=[]) + olDesclist + desc; olPointlist = (olPointlist=[])+olPointlist+point; olRotlist = (olRotlist=[])+olRotlist+vWarpRot; } if(llToLower(access)=="all" || llToLower(access)=="")
//everybody else
{ not_blank+=1; lBaseList= (lBaseList=[]) + lBaseList +(string)(not_blank); desc = (string)(not_blank) + ": "+llList2String(lCoord, 0) + "\n"; lDesclist =(lDesclist=[]) + lDesclist + desc; lPointlist = (lPointlist=[])+lPointlist+point; lRotlist = (lRotlist=[])+lRotlist+vWarpRot; }
then back up in touch start...
touch_start(integer t) { iListenTimeout = llGetUnixTime() + llFloor(fListenTime); COMCHAN = (integer)(llFrand(99999.0) * -1); llMessageLinked(LINK_SET,COMCHAN,"rez",llDetectedKey(0)); particles(); lists = []; if(listed=TRUE&&llDetectedKey(0)!=llGetOwner()) { sMenuTitle = "Teleporter Unit"+"\n"+(string)glDesclist; lists = lGroupList; item_len = llGetListLength(lGroupList) - 1; } if(llDetectedKey(0)==llGetOwner()) { sMenuTitle = "Teleporter Unit"+"\n"+(string)olDesclist; lists = lOwnList; item_len = llGetListLength(lOwnList) - 1; } if(listed ==FALSE&&llDetectedKey(0)!=llGetOwner()) { sMenuTitle = "Teleporter Unit"+"\n"+(string)lDesclist; lists = lBaseList; item_len = llGetListLength(lBaseList) - 1; } list_start = 0; temp = llList2List(lists ,list_start,list_start + 10 ) + "Next"; menu(llDetectedKey(0),sMenuTitle ,temp ); }
the other script wil return true for listed if llDetectedKey(0) (passed as key id in linkmessage) is either same group or if llKey2Name(id) is on the list. do i simply want the script to do too much with the 3 lists? is there another less blinkered way of doing this?
|
|
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
09-08-2007 16:06
yup... stack heap collision is the inevitable result when lists get too big. How about... script 1 handles the Who: Owner, Group+friends, or Public. So it alone contains the list of people's names. Scripts 2, 3, and 4 handle the teleports for the different sets of people. Script 1 on CHANGED_INVENTORY reads the notecard of named people and touch_start determines owner access, group access, or general access, and then hands off the request to the other scripts. Script 2 on CHANGED_INVENTORY reads the notecard of destinations, including them all. link_message presents the Dialog Script 3 ...reads the notecard of destinations, only including the group and general destinations... etc. Script 4 ...includes just the general destinations... etc. Now, scripts 2, 3, and 4 can in fact contain identical code - they all do exactly the same thing just with a different list of destinations - using something like this in state_entry: if (llGetScriptName() == "Owner"  iClearence = 3; else if (llGetScriptName() == "Group"  iClearence = 2; else iClearence = 1; And then in link_message(integer sender_num, integer num, string str, key id) use: if (iClearence == num) ...to determine if the script should action the request. In a similar way, the variable iClearence can be used to selectively read the notecard of destinations or control any other 'features'. So, four scripts named: Main, Owner, Group, Public. Main carries the list of named people, identifies the clearence level of the clicker, and hands-off the request. touch_start(integer num_detected) { uName = llKey2Name(llDetectedKey(0)); if(llDetectedKey(0) == llGetOwner()) iClearence = 3; else if((llSameGroup(id) == TRUE) || (llListFindList(friendList, [uName]) != -1)) iClearence = 2; else if(llListFindList(guestList, [uName]) != -1) iClearence = 1; llMessageLinked(LINK_THIS, iClearence, "", NULL_KEY); } Owner, Group, and Public carry the lists of destinations, all contain the same dialog, listen, and teleport code - which is pretty much the code you already have in the original script.
|
|
Chrysala Desideri
Scarlet Scriptrix
Join date: 4 Mar 2007
Posts: 65
|
simple solution or lowered expectations?
09-09-2007 03:54
thanks, Pale! i had a feeling it would reach that point  i'm going to implement a 4 script version, to make sure i've got down the mechanism... messages to LINK_THIS, etc... But how is it on sim-ecology? is what follows going to be significantly lighter? i'm no expert but this came to me in bed... .... sleep may have brought wisdom and i think the most resource-friendly solution would be to just keep the one list, and based on if one is "verified" or not will decide whether to go to requested destination (cleared) or destination llGetPos (minus the z-adjustment for TP base, so they get a kick out of the booth too!) that is: a check of owner/listed/group before relaying destination, and if check is negative, relaying either GetPos as destination, or relaying a "no-go" message and have the rerouting done by the beam. i'm already compiling in to main list the access and z-offset codes (arrival type) from notecard, might as well simply use those! i was doubtless going overboard in having the script handle data, multiplying the lists and everything, once more using the computer like an abacus :-| Fact is i loved the idea of having it compile a difft menu based on user, but i've already made menu compilation heavy, button list is genereated, description too, and one for each parameter... the coolness has to give way to ecology at some point, after all one is meant to be setting up a port ring of these, each making use of the nifty multipages for > 12 destinations. Don't kill Mother Sim, Chryssy!!  However sooner or later i WILL want to write something that HAS to be made multiscript and this will be good practice! Thanks again for the great help, and i'll post the implementation of this scheme once i've done it for general reference!
|
|
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
09-09-2007 12:27
I'd say the scripts are pretty light-weight. What calculation they do is very intermittent and completely internal - the sim-ecology doesn't 'see' it. I think the only 'bad thing' that could happen by using many scripts is the potential for extra listens hanging around. If you want to make your scripts sim-friendly I would look at making the listens well managed. But then I would say that even if there was only one script. 
|
|
Chrysala Desideri
Scarlet Scriptrix
Join date: 4 Mar 2007
Posts: 65
|
09-10-2007 04:36
Well that is quite reassuring - i did realize that these scripts only do heavy lifting on startup or reset of the object, i was wondering if holding all those lists in memory gets heavy for sim, or if it's like on virtual memory or disk.
as for listens, should just have the COMCHAN listens timing out in half a minute.. id need heavy mall traffic to make it an issue at all, and i could add a listen remove before timer if dialog message !=Next.
That said i did bungle my way through having it TP to GetPos if unauthorised, but it looks and feels clunky. today i'll try the multi script solution (painless i'm hoping) and take this opportunity to ask about ListFindList -- returning integer "listed"
I had it llSay what it returns on touch, because it was not acting right calling "if(!listed..." etc, and seemed at first to give -1 for false and 0 for true...
but later touching another it returned a 1? now i've currently wired the if to "if (listed ==-1...." etc. and "if (listed>-1..."etc..
but not at all sure i'm doing this right.
gonna need to do this bit right whichever of the two solutions i use. off now to pass some time with wiki and rebellious connection.
thanks for all the help!
|
|
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
09-10-2007 11:21
 From: LSL Wiki: llListFindList Returns the position (index) of the first instance of test in src (or -1 if test isn't in src). So == -1 or <> -1 are probably the only two conditions relevant to you.
|
|
Chrysala Desideri
Scarlet Scriptrix
Join date: 4 Mar 2007
Posts: 65
|
09-12-2007 15:15
yes, precisely, i was in fact using it wrong... fixed that and tried the multi script version and it works wonderfully. now experimenting with having scripts turn on and off (i know unneccessary for this proj but opportunities to try stuff  )... also trying to find a way for the beam to know it's position relative to base and arrive with same relation to destination base if destination == a multi platform. rotations get more complicated the more i find need for them lol.
|