I know WHY this script I wrote is not working for me, I just need a suggestion or two on how to fix it. First, the script (still very much work-in-progress):
[CODE}
// menu items
list Menu = ["Serapis", "Baths", "Ankh", "Djed", "Ma'at", "Scarab", "Quay", "Beach", "Palace of Joy"];
//destinations and their vectors now follow
string dest = "Sukka Mire";
vector v00 = <223,38,29>;
vector v01 = <223,38,29>;
vector v02 = <223,38,29>;
vector v03 = <223,38,29>;
vector v04 = <223,38,29>;
vector v05 = <223,38,29>;
vector v06 = <223,38,29>;
vector v07 = <223,38,29>;
vector v08 = <223,38,29>;
//other variables
integer handle;
default
{
state_entry()
{
llSetText("Palace Teleporter",<0.875,0.746,0.547>,1);
}
touch_start(integer num)
{
key id = llDetectedKey(0); //get id of person touching
handle = llListen(45, "", id, ""
;llDialog(id, "Select destination -", Menu, 45);
llSetTimerEvent(30);
}
listen(integer channel, string name, key id, string message)
{
llListenRemove(handle);
llSetTimerEvent(0);
integer index = llListFindList(Menu, [ message]);
llSay(0, (string) index); //for debug only
if(index == 2); //tp code here
{
llMapDestination(dest, v02, v02);
}
}
timer()
{
llListenRemove(handle);
llSetTimerEvent(0);
llWhisper(0, "Menu timeout."
;}
}
[/CODE]
The user touches the prim. A menu appears containing the destinations to choose from. A series of 'if' statements then follows, based on the index number of the destination chosen from the menu. In this example I am using index number 2, in other words, if the user chooses 'Ankh' the index would be equal to 2, and at this point I want the llMapDestination command to present the user with the World Map in order for him to teleport (after pressing the teleport button).
The problem is that llMapDestination only works inside a touch event, and I have mine inside the listen event, and it is ignored. But I need the touch event to trigger the menu, so how can I have the map appear based on the choice?
Rock