Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llDialog help??

Alain Talamasca
Levelheaded Nutcase
Join date: 21 Sep 2005
Posts: 393
10-27-2005 09:06
The docs say that llDialog allows up to 4 buttons, but I have seen as many as 12 (in a really great dance machine).

How is this done? Are they somehow combining multiple dialog boxes into one??

Or are the docs just wrong?

I am at work right now, scribbling up a muli-node teleport net and was hoping to have this ready to drop in by the time I got home, but I have more than 4 nodes in the net.

Each TP node should be able to select any other TP node in the net. All are within 200m of each other, so the method of the TP is not a problem.

I just am trying to save time by drawing on the expertise of this well seasoned group of scripters instead of re-inventing the wheel.

Anyone know the answer?
_____________________
Alain Talamasca,
Ophidian Artisans - Fine Art for your Person, Home, and Business.
Pando (105, 79, 99)
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
10-27-2005 09:18
12 buttons is correct...and you can even have one button pull up a 2nd Dialog-box to give you another 12 buttons....etc...


The only limitation to 4 buttons I've seen is on the new SetPrice function.
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
Trimda Hedges
Creator of Useless Prims
Join date: 19 Nov 2003
Posts: 247
The Wiki is your friend.
10-27-2005 09:38
The 4 button limit was increased a little bit back to 12. I recommend going to the wiki instead of the included HTML docos for anything LSL. LL is notoriously bad with not updaing their included reference guide. I have noticed large numbers of discrepencies of what the LSL doco has and is actual fact (and agrees with the Wiki).
_____________________
C. Create useless prims... Then delete... Rinse... Repeat.

"The problem is us, and the solution is within us all."
-- Merwan Marker

"Trimda - do us both a favor and please put me on ignore."
-- blaze Spinnaker
Alain Talamasca
Levelheaded Nutcase
Join date: 21 Sep 2005
Posts: 393
10-27-2005 10:15
Cool!

Thanks guys..
This make s things MUCH easier...



Now if we could just dig deeply underground to make bunkers and shelters.
_____________________
Alain Talamasca,
Ophidian Artisans - Fine Art for your Person, Home, and Business.
Pando (105, 79, 99)
Gaz Hornpipe
Registered User
Join date: 29 Sep 2005
Posts: 36
10-27-2005 13:24
Here's a snippet of code from one of my teleporter scripts. It handles many destinations all with a dialog. the gDest_list list is created by reading data from a notecard, and the index variable is a global variable that keeps track of the currently displayed part of the list and once the user makes a selection will hold the number of the list item.

CODE

touch_start(integer num)
{
string text = "Please choose a destination: ";
list buttons;
integer i;
integer len = llGetListLength(gDest_list);
index = 0;
if(len < 13)
{
for(i = 0; i < len; i++)
{
text += "\n" + (string)(i + 1) + ". " + llList2String(gDest_list,i);
buttons += [(string)(i + 1)];
}
llDialog(llDetectedKey(0),text,buttons,gInput);
gListen = llListen(gInput,"",llDetectedKey(0),"");
return;
}
else
{
buttons += ["More..."];
for(i = 0; i < 11; i++)
{
text += "\n" + (string)(i + 1) + ". " + llList2String(gDest_list,i);
buttons += [(string)(i + 1)];
}
index = i;
llDialog(llDetectedKey(0),text,buttons,gInput);
gListen = llListen(gInput,"",llDetectedKey(0),"");
return;
}
}
}

listen(integer chan, string name, key id, string message)
{
llListenRemove(gListen);
if(message == "More...")
{
integer i;
integer len = llGetListLength(gDest_list);
string text = "Destinations: ";
list buttons;

if((len - index) < 12)
{
for(i = index; i < len; i++)
{
text += "\n" + (string)(i + 1) + ". " + llList2String(gDest_list,i);
buttons += [(string)(i + 1)];
}
llDialog(id,text,buttons,gInput);
gListen = llListen(gInput,"",id,"");
return;
}
else
{
buttons += ["More..."];
for(i = index; i < (index + 10); i++)
{
text += "\n" + (string)(i + 1) + ". " + llList2String(gDest_list,i);
buttons += [(string)(i + 1)];
}
index = i;
llDialog(id,text,buttons,gInput);
gListen = llListen(gInput,"",id,"");
return;
}
}

index = (integer)message - 1;
}


The index will be the selection from the list gDest_list (-1 of the number because the list starts from 0)