Jump to content

Resilient

Resident
  • Posts

    20
  • Joined

  • Last visited

Posts posted by Resilient

  1.             llRequestPermissions(ToucherID, PERMISSION_TRIGGER_ANIMATION);            llRequestPermissions(llList2Key(gAvKeys,idx),PERMISSION_TRIGGER_ANIMATION); //llList2Keys(gAvKeys,idx) is the UUID of the chosen partner                    }    }    run_time_permissions(integer perm)    {        if(perm & PERMISSION_TRIGGER_ANIMATION) /// If your partner accepted .......        {                        llStartAnimation(llList2String(dances,gChoice)); // This is the particular dance you chose, remember?                                }

     well it does work with a single script but the problem as rightly mentioned in the previous post is in synchronization. What should be the logic for a second script or how do the scripts communicate with each other? Any clues..

  2. I just have one final thing with this script that i am stuck with..

     

    after a partner accepts , how do i make my avatar dance as well with the hud script? instead of manually selecting the animation from my inventory

     

    tried a few combinations of llStartAnimation but it's not working for me.

  3. actually I wear the object that has the script as a hud, so it does not add my name to the list of detected avatars

    i think what i said is right because when people are near me , and the second dialog box comes , my name is not shown on the buttons so i think my name is never saved to the list gAvNames

     

     

    secondly, if no one is near me ... my logic says it should tell me that "no one is near me" and the second dialog box will not appear either

     

    the second dialog box does not appear but the llOwnerSay function is not carried out

  4. was away from SL for a while but came back and played with this script , I added a new thing to it but can you tell me why it is not working , it compiles but does not give me the required output, i made comments at the end of the script where i added the 5 lines of code myself

     

    key ToucherID;list dances = ["Dance1","Dance2","Dance3"];integer channela = -10;integer channelb = -20;integer listen_id;string menuText = "Select your target:";integer gChoice;list gAvNames;list gAvKeys; integer z;default{    touch_start(integer total_number)    {        ToucherID = llDetectedKey(0);        listen_id = llListen(channela, "", ToucherID, "");  //Open listen channel first....        llDialog(ToucherID, "Choose your dance", dances, channela); // Then open dialog        llSetTimerEvent(60.0);  // Set a timer for timeouts    }    timer()    {        //timeout        llSetTimerEvent(0.0); //Shut off the timer        llListenRemove(listen_id);  // Kill the open listen handle    }        listen(integer channel, string name, key id, string msg)    {        if(channel == channela)        {            llListenRemove(listen_id); // Remove the dialog listener            gChoice = llListFindList(dances, [msg]);  //gChoice is the position of msg in your list of dances            llSensor("",NULL_KEY, AGENT, 50.0, PI );  // Look for a partner (kinda far away.....)        }        else if(channel==channelb)        {            llListenRemove(listen_id);// Remove the dialog listener            integer idx = llListFindList(gAvNames,[msg]); // Where is the chosen partner's name (msg) in the list of choices? // Gotta ask permission now ........            llRequestPermissions(llList2Key(gAvKeys,idx),PERMISSION_TRIGGER_ANIMATION); //llList2Keys(gAvKeys,idx) is the UUID of the chosen partner        }    }    run_time_permissions(integer perm)    {        if(perm & PERMISSION_TRIGGER_ANIMATION) /// If your partner accepted .......        {            llStartAnimation(llList2String(dances,gChoice)); // This is the particular dance you chose, remember?        }    }        sensor(integer numDetected)    {        gAvNames = []; //Empty these lists of previous information        gAvKeys = [];        integer i;        for (i=0;i<numDetected;++i)        {            gAvNames += [llGetSubString(llDetectedName(i),0,23)]; //Store truncated names            gAvKeys += [llDetectedKey(i)];  //And UUIDs        }        integer z = llGetListLength(gAvNames);  // these are the 5 lines that I added so that if no one is near the hud will say something back to me        if (z<1)                                             //   it compiles too but it does not say it when no one is near        {                                                     //            llOwnerSay("no one to dance with.");//         }                                                 //        llSetTimerEvent(60.0); // set timer for timeout        listen_id = llListen(channelb, "", ToucherID, "");  // Re-open the chat channel        llDialog(ToucherID, "Want to dance?", gAvNames, channelb);  //Ask partner    }}

     

  5. flowchart.jpg

     

     

    key ToucherID;string msg = "Choose your dance";list dances = ["Dance1","Dance2","Dance3"];integer channela = -10;integer channelb = -20;integer listen_id;string menuText = "Select your target:";list avatarsDetected = [ ];list keysDetected = [ ];integer index;integer indexx;default{touch_start(integer total_number){ ToucherID = llDetectedKey(0);   llDialog(ToucherID, msg, dances, channela);   listen_id = llListen(channela, "", ToucherID, "");   llSetTimerEvent(60);}listen(integer channel, string name, key id, string choice) {    if(channel == channela)      {        if (choice == "Dance1")             {            llSensor("", NULL_KEY, AGENT, 50, PI);                }        else if (choice=="Dance2")        {            llSensor("",NULL_KEY, AGENT, 50, PI );        }        else if (choice=="Dance3")        {            llSensor("",NULL_KEY, AGENT, 50, PI );        }            }    else if(channel==channelb)    {       integer index = llListFindList(avatarsDetected, []);             if (index != -1)       {           integer indexx = llListFindList(dances, []); // I know this part is wrong but cant think of how to solve this           if (indexx==0)           {           llOwnerSay("hi");        }        else if (indexx==1)        {            llOwnerSay("bye");        }        }    }   }sensor(integer numDetected){if (numDetected > 2) numDetected = 2;integer nextStep;string nextAvatarName;string nextAvatarKey;avatarsDetected = [ ];keysDetected = [ ];for (nextStep = 0; nextStep < numDetected; nextStep++){ nextAvatarName = llDetectedName(nextStep);nextAvatarKey = llDetectedKey(nextStep);if (llStringLength(nextAvatarName) > 24) nextAvatarName = llGetSubString(nextAvatarName, 0, 23);avatarsDetected = (avatarsDetected=[]) + avatarsDetected + nextAvatarName; keysDetected = (keysDetected=[]) + keysDetected + nextAvatarKey; }llDialog(ToucherID, menuText, avatarsDetected, channelb);listen_id = llListen(channelb, "", ToucherID, ""); }}

     

  6. key ToucherID;string msg = "Choose your dance";list dances = ["Dance1","Dance2","Dance3"];integer channela = -10;integer channelb = -20;integer listen_id;string menuText = "Select your target:";list avatarsDetected = [ ];list keysDetected = [ ];string zero;string one;default{touch_start(integer total_number){ ToucherID = llDetectedKey(0);   llDialog(ToucherID, msg, dances, channela);   listen_id = llListen(channela, "", ToucherID, "");   llSetTimerEvent(60);}listen(integer channel, string name, key id, string choice) {    if(channel == channela)      {        if (choice == "Dance1")             {            llSensor("", NULL_KEY, AGENT, 50, PI);                }        else if (choice=="Dance2")        {            llSensor("",NULL_KEY, AGENT, 50, PI );        }        else if (choice=="Dance3")        {            llSensor("",NULL_KEY, AGENT, 50, PI );        }            }    else if(channel==channelb)    {            }   }sensor(integer numDetected){if (numDetected > 2) numDetected = 2;integer nextStep;string nextAvatarName;string nextAvatarKey;avatarsDetected = [ ];keysDetected = [ ];for (nextStep = 0; nextStep < numDetected; nextStep++){ nextAvatarName = llDetectedName(nextStep);nextAvatarKey = llDetectedKey(nextStep);if (llStringLength(nextAvatarName) > 24) nextAvatarName = llGetSubString(nextAvatarName, 0, 23);avatarsDetected = (avatarsDetected=[]) + avatarsDetected + nextAvatarName; keysDetected = (keysDetected=[]) + keysDetected + nextAvatarKey; }llDialog(ToucherID, menuText, avatarsDetected, channelb);listen_id = llListen(channelb, "", ToucherID, ""); }}

     I tried my best to combine the 2 listens however I do have two queries

     

    01. How do I extract the detected avatar names as choices for the second time i.e. in channelb

    02. How do I match the correct animation(choices for the first time i.e. in channela) to the detected avatar?

     

    Any help is much appreciated.

  7. I got stuck again..

     

    cant figure out a way around this 

     

    key ToucherID;string msg = "Choose your dance";list dances = ["Dance1","Dance2","Dance3"];integer channel = -10;integer listen_id;integer listen_idd;string menuText = "Select your target:";list avatarsDetected = [ ];list keysDetected = [ ];key avKey;default{  touch_start(integer total_number)  {    ToucherID = llDetectedKey(0);       llDialog(ToucherID, msg, dances, channel);       listen_id = llListen(channel, "", ToucherID, "");       llSetTimerEvent(60);  }    listen(integer channel, string name, key id, string choice)      {   if (choice == "Dance1")          {          llSensor("", NULL_KEY, AGENT, 100, PI);     }   }   sensor(integer numDetected) {if (numDetected > 2) numDetected = 2;integer nextStep;string nextAvatarName;string nextAvatarKey;avatarsDetected = [ ];keysDetected = [ ];for (nextStep = 0; nextStep < numDetected; nextStep++) {   nextAvatarName = llDetectedName(nextStep);  nextAvatarKey = llDetectedKey(nextStep);  if (llStringLength(nextAvatarName) > 24) nextAvatarName = llGetSubString(nextAvatarName, 0, 23);  avatarsDetected = (avatarsDetected=[]) + avatarsDetected + nextAvatarName;   keysDetected = (keysDetected=[]) + keysDetected + nextAvatarKey;  }llDialog(ToucherID, menuText, avatarsDetected, channel);listen_idd = llListen(channel, "", ToucherID, ""); }listen(integer channel, string name, key id, string nextavatarName) //(54,58):Error: Name previously declared within scope ... right after choice{    string zero=llList2String(avatarsDetected, 0);    string one=llList2String(avatarsDetected, 1);    if (nextavatarName == zero )    {        avKey=llList2String(keysDetected, 0);        llRequestPermissions(avKey,PERMISSION_TRIGGER_ANIMATION);    }}            run_time_permissions(integer perm)            {                if (perm & PERMISSION_TRIGGER_ANIMATION)                {                    llStartAnimation("dance1");                }            }  }

     

  8. I had thought of the same logic too but I had got an error in syntax right before the event sensor,

    can you help me why i am getting this or my code not working

    key ToucherID;string msg = "Choose your dance";list dances = ["Dance1","Dance2","Dance3"];integer channel = -10;integer listen_id;string menuText = "Select your target:";list avatarsDetected = [ ];list keysDetected = [ ];default{touch_start(integer total_number){ ToucherID = llDetectedKey(0);   llDialog(ToucherID, msg, dances, channel);   listen_id = llListen(channel, "", ToucherID, "");   llSetTimerEvent(60);}listen(integer channel, string name, key id, string choice)   {if (choice == "Dance1")     {    llSensor("", NULL_KEY, AGENT, 50, PI);}{sensor(integer numDetected); //line number 26{if (numDetected > 12) numDetected = 12;integer nextStep;string nextAvatarName;string nextAvatarKey;avatarsDetected = [ ];keysDetected = [ ];for (nextStep = 0; nextStep < numDetected; nextStep++){ nextAvatarName = llDetectedName(nextStep);nextAvatarKey = llDetectedKey(nextStep);if (llStringLength(nextAvatarName) > 24) nextAvatarName = llGetSubString(nextAvatarName, 0, 23);avatarsDetected = (avatarsDetected=[]) + avatarsDetected + nextAvatarName; keysDetected = (keysDetected=[]) + keysDetected + nextAvatarKey; }}llDialog(ToucherID, menuText, avatarsDetected, channel);llListenRemove(listen_id); }}}  

     (26,0):Error:Syntax Error

  9. string msg = "What do you want to do?";

    list dances = ["Dance1","Dance2","Dance3"];

    integer channel=-10;

    key ToucherID;

    integer listen_id;

    default

    {

    touch_start(integer total_number)

    ToucherID = llDetectedKey(0);   

    llDialog(ToucherID, msg, dances, channel);   

    listen_id = llListen( channel, "", ToucherID, "");   

    llSetTimerEvent(60);

    }

    listen(integer channel, string name, key id, string choice)    

    {    

    if (choice == "Dance1")     

    {

    llDialog(ToucherID, 2ndmenumsg, *(avatarsDetected)*, channel);[this is where I need to detect the avs and make them appear as  a list for the 2nd menu]

    }
    llListenRemove(listen_id); 

    }                           

    else if (choice == "Dance2")

    {and so on.. 

×
×
  • Create New...