Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llSensor and llDialog

Christina Tyles
Registered User
Join date: 18 Apr 2008
Posts: 1
04-22-2008 13:00
I'm sorry if this is a dumb question, but how would I take a llDetectedName list from llSensor and make those names the choices in llDialog? Here's basically what I'm working with, just a tester:

touch(integer num_detected)
{
llDialog(llDetectedKey(0), "Choose Target", [what goes here?], channel);
llSensor("", NULL_KEY, AGENT, 30, PI);
}
sensor(integer total_number)
{
llOwnerSay((string)total_number + " targets detected";);
integer i;
for (i=0; i < total_number; i++)
{
llOwnerSay("Target: " + llDetectedName(i));
}
}

Rather than llOwnerSay the list of targets, I'd like them to show up in the menu. Does it have anything to do with that list2string business? That was confusing me.

Also, does llDialog not run when it's in sensor or attach? So far I can only get it to come up when it's in touch.
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
04-22-2008 13:18
nameList += [llGetSubString(llDetectedName(i), 0 ,23)];

Where listName is a list.

...the substring bit is important... push a list item of more than 24 characters into llDialog and it'll get very unhappy. Also remember any one llDialog menu can only handle 12 items at a time. :)