Jump to content

problems with llDetectedLinkNumber


Tabris Daxter
 Share

You are about to reply to a thread that has been inactive for 4764 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

hey all,

i'm having some problems with llDetectedLinkNumber().

i want to add the link number touched to a list so i can bulk process further down in the script, however it's only picking up the last touch depending on where i put the "add to list bit"

Code follows:

 

string gNotecard;
key gQueryId;
integer gLineNum = 0;
list room_status = [];
string room_status_data;

default
{
    state_entry()
    {
        llSetLinkPrimitiveParams(LINK_SET,[PRIM_TEXT,"",ZERO_VECTOR,0]);
    }

    touch_start(integer num_detected) // this is where i'm having the problems. it's almost line for line copied from the wiki.
    {
        /*gNotecard = llGetInventoryName(INVENTORY_NOTECARD,0);
        gQueryId = llGetNotecardLine(gNotecard, gLineNum);*/
        integer i;
        for(i = 0; i < num_detected; ++i) 
        {
            llDetectedLinkNumber(i);  // depending on how i "phrase" these 2 lines it either gets the last touch only or nothing at all.
            room_status = llCSV2List((string)i+","+"In Use");
        }
        
    }
    
    /*dataserver(key lquery_id, string ldata) // was for proof of concept. adapted from my holodeck.
    {
        if (gQueryId == lquery_id)
            {
                if (ldata != EOF)
                    {
                        room_status_data = ldata;
                        llMessageLinked(LINK_THIS,666,"RUN","PRINT");
                    }
                }
                gQueryId = llGetNotecardLine(gNotecard, ++gLineNum);
    }*/
    
    link_message(integer Sender_Num, integer num, string Str, key id) //processing bit
    {
        list POSLISTTemp = room_status;
        if (id =="PRINT" && Str == "RUN")
        {

            integer POSPointer = 0;
            
            while(POSPointer < llGetListLength(POSLISTTemp))
            {
                integer Room = llList2Integer(POSLISTTemp, POSPointer++);
                string Status = llList2String(POSLISTTemp, POSPointer++);
                if (Status == "In Use")
                    {
                        llSetLinkPrimitiveParamsFast(Room,[PRIM_TEXT,Status,<1.0,0.0,0.0>,1]);
                        llSetLinkPrimitiveParams(Room,[PRIM_COLOR,ALL_SIDES,<1.0,0.0,0.0>,1]);
                    }
                else if (Status == "Vacant")
                    {
                        llSetLinkPrimitiveParamsFast(Room,[PRIM_TEXT,Status,<0.0,1.0,0.6>,1]);
                        llSetLinkPrimitiveParams(Room,[PRIM_COLOR,ALL_SIDES,<0.0,1.0,0.6>,1]);
                    }
            }
        }
        
    }
}

 

 

Link to comment
Share on other sites

I guess I wouldn' t ever expect num_detected to be more than 1 or 2.  When you click and activate touch_start, the queue clears VERY fast, so there's almost never much of a queue. 

ETA:  And what Peter said.. :smileywink:

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4764 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...