list mainMenu;
integer iChan = -22;
integer iLsn;
integer length;
string main = "What would you like to do?";
string temp;
default
{
state_entry()
{
iLsn = llListen(iChan,"","","");
}
touch_start(integer total_number)
{
llOwnerSay("Touched");
if(iLsn == 1)
{
llDialog(llDetectedKey(0), main, mainMenu, -12);
llSay(0,"you made it");
}
else
{
llSay(0, "retrieving data, one sec please");
}
}
listen(integer channel, string name, key id, string message){
if(channel == iChan) {
temp=message;
mainMenu=llParseString2List(temp, [", "], []);
}
}
}
So decided to finally dive into LSL after what... 15 years. About time, I guess. I am just trying to figure out how I can access my mainMenu variable in the touch_start event via the listen event, cause this causes a hickup in my script.
Long story short. I have one object that looks into its own inventory and spits out a list in string format on channel -22. If i use the llSay command with the temp message within the listen, i can get it no problem. So i comma seperated them into a list. But when I try to call up the list within my on touch event, i get nada. Occasionally i get something, but i can hardly reproduce it, so to speak i dont know where i have to look for it. I tried to build in items so i could see what happens, but it stays blank for me. If i remove the listen state event call in the state entry, i do get through the system, giving me the retrieveing data, one sec message. So something goes wrong with i guess the parsing or my code just doesnt want to handle it. Can someone take a peak?.
Script compile is fine.