Jump to content

Tabris Daxter

Resident
  • Posts

    129
  • Joined

  • Last visited

Posts posted by Tabris Daxter

  1. 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]);
                        }
                }
            }
            
        }
    }

     

     

  2. Hey all,

    in the MLP system is there a Link Message or Chat Message that can be send from a prim (static channel) to STOP or START the system.

    I'm going to be using MLP furniture in a holodeck and want to remove the balls before changing scene and/or begin bootup on scene rez.

  3. @innula

    i already have that in the texture setting section.

     

     this is the output of a llGetPrimitiveParams([PRIM_TEXTURE,0])

    (in a separate script in a different prim to the "builder" script)

    build deck - master - http test a:

    00000000-0000-0000-0000-000000000000
    <0.000000, 0.000000, 0.000000>
    <0.000000, 0.000000, 0.000000>
    0.000000

     

    also tried it with ALL_SIDES the same data but x 6

    just noticed that it flashes with the right texture for about 0.5 of a second then fubb's

  4. ok, i found out that Prim 1, Face 0 gets mangled.

    TEX=1, 0, 00000000-0000-0000-0000-000000000000, <0.000000, 0.000000, 0.000000>, <0.000000, 0.000000, 0.000000>, 0.000000, <0.000000, 0.000000, 0.000000>, 1.000000,

    is there anything in the folowing code that would cause it?

     

    {            integer side = 0;            integer linksides = llGetLinkNumberOfSides(0)-1;            while (side <= linksides)            {               list params1 = llGetLinkPrimitiveParams(1,[PRIM_TEXTURE,side,PRIM_COLOR,side]);               list params2 = llGetLinkPrimitiveParams(2,[PRIM_TEXTURE,side,PRIM_COLOR,side]);               list params3 = llGetLinkPrimitiveParams(3,[PRIM_TEXTURE,side,PRIM_COLOR,side]);               list params4 = llGetLinkPrimitiveParams(4,[PRIM_TEXTURE,side,PRIM_COLOR,side]);               list params5 = llGetLinkPrimitiveParams(5,[PRIM_TEXTURE,side,PRIM_COLOR,side]);               list params6 = llGetLinkPrimitiveParams(6,[PRIM_TEXTURE,side,PRIM_COLOR,side]);               Tex_data += ["TEX="+(string)1,(string)side] + params1;               Tex_data += ["TEX="+(string)2,(string)side] + params2;               Tex_data += ["TEX="+(string)3,(string)side] + params3;               Tex_data += ["TEX="+(string)4,(string)side] + params4;               Tex_data += ["TEX="+(string)5,(string)side] + params5;               Tex_data += ["TEX="+(string)6,(string)side] + params6;               llSleep(0.1);               g_keyHTTPRequestID = llHTTPRequest(location, [HTTP_METHOD, "POST", HTTP_MIMETYPE,"application/x-www-form-urlencoded"], "test="+llEscapeURL(llStringTrim(llList2CSV(Tex_data),STRING_TRIM)));               side++;            }

     

    so guys/girls/other any ideas?

     

  5. Yeah just the first prim.

    Completely mangles it.

    i haven't done a llGetPrimitiveParams() to get the actual values after it FUBB's but from observation it sets the Key,Repeats,Color & alpha to 0.0.

     

    all the others work perfect just not the floor(root)

     

    EDIT:

    i tried changing the llOwnerSay() in the grabber to llInstantMessage() and it still gets cut off

  6. @Darkie here we go.

    both the "grabber" and "builder"

     

    //Grabber

    list dialoglst = ["Props","Textures","Output All", "Clear All","Done","Clear Scene"];
    string Mainmsg = "Master Building Suite";
    list params = [];
    list propdata = [];
    list Tex_data = [];
    key ToucherID;
    integer gdialogBroadcast;
    integer gListenChan;
    integer gChanBroadcast;
    integer DELETESELF;
    integer listen_id;
    integer listen_id2;
    integer listen_id3;

    default
    {
    on_rez(integer start)
    {
    llResetScript();
    llSetLinkPrimitiveParamsFast(LINK_SET,
    [PRIM_TEXTURE,ALL_SIDES,TEXTURE_DEFAULT,ZERO_VECTOR,ZERO_VECTOR,0,
    PRIM_COLOR,0,<1,1,1>,1]);
    }

    state_entry()
    {
    /*llSetLinkPrimitiveParamsFast(LINK_SET,
    [PRIM_TEXTURE,ALL_SIDES,TEXTURE_DEFAULT,<1.0,1.0,0.0>,ZERO_VECTOR,0,
    PRIM_COLOR,0,<1,1,1>,1]);*/
    params = [];
    propdata = [];
    params = [];
    Tex_data = [];
    llSetObjectName("Master Builder");
    gdialogBroadcast = 111222333;
    gListenChan = 222333444;
    gChanBroadcast = 333444555;
    DELETESELF = -666999666;
    }

    /*touch_start(integer bad_touch)
    {
    ToucherID = llDetectedKey(0);
    llDialog(ToucherID, Mainmsg,dialoglst, gdialogBroadcast);
    listen_id = llListen( gdialogBroadcast, "", ToucherID, "");
    listen_id2 = llListen( gListenChan, "", "", "");
    listen_id2 = llListen( gChanBroadcast, "", "", "");

    llSetTimerEvent(30);
    }*/

    timer()
    {
    //TIME'S UP!
    llListenRemove(listen_id);
    llSetTimerEvent(0.0);
    }

    listen(integer lchan, string lname, key lid, string lmsg)
    {
    if (lchan == gdialogBroadcast && lmsg == "Props")
    {
    llWhisper(gChanBroadcast,llList2CSV(llGetPrimitiveParams([PRIM_POSITION,PRIM_ROTATION])));
    //llOwnerSay(llList2CSV(llGetPrimitiveParams([PRIM_POSITION,PRIM_ROTATION])));
    }
    if (lchan == gdialogBroadcast && lmsg == "Textures")
    {
    integer side = 0;
    integer linksides = llGetLinkNumberOfSides(0)-1;
    while (side <= linksides)
    {
    list params1 = llGetLinkPrimitiveParams(1,[PRIM_TEXTURE,side,PRIM_COLOR,side]);
    list params2 = llGetLinkPrimitiveParams(2,[PRIM_TEXTURE,side,PRIM_COLOR,side]);
    list params3 = llGetLinkPrimitiveParams(3,[PRIM_TEXTURE,side,PRIM_COLOR,side]);
    list params4 = llGetLinkPrimitiveParams(4,[PRIM_TEXTURE,side,PRIM_COLOR,side]);
    list params5 = llGetLinkPrimitiveParams(5,[PRIM_TEXTURE,side,PRIM_COLOR,side]);
    list params6 = llGetLinkPrimitiveParams(6,[PRIM_TEXTURE,side,PRIM_COLOR,side]);
    Tex_data += ["TEX="+(string)1,(string)side] + params1 + "\n";
    Tex_data += ["TEX="+(string)2,(string)side] + params2 + "\n";
    Tex_data += ["TEX="+(string)3,(string)side] + params3 + "\n";
    Tex_data += ["TEX="+(string)4,(string)side] + params4 + "\n";
    Tex_data += ["TEX="+(string)5,(string)side] + params5 + "\n";
    Tex_data += ["TEX="+(string)6,(string)side] + params6 + "\n";
    side++;
    }


    }
    else if (lchan == gdialogBroadcast && lmsg == "Output All")
    {
    llWhisper(gChanBroadcast,"GIVE ME THE MONKEY");
    llOwnerSay("\n" + llList2CSV(propdata));
    //llOwnerSay("\n" + llList2CSV(Tex_data));
    llOwnerSay("\n" + llList2CSV(Tex_data));
    }
    else if (lchan == gdialogBroadcast && lmsg == "Clear All")
    {
    llWhisper(gChanBroadcast,"TRASH IT");
    propdata = [];
    Tex_data = [];
    }
    else if (llGetSubString(lmsg,0,2) == "POS")
    {
    llOwnerSay("i'm Listening");
    propdata += lmsg + "\n";
    }
    else if (lchan == gdialogBroadcast && lmsg == "Done" && ToucherID == llGetOwnerKey(llGetKey()))
    {
    llWhisper(DELETESELF,"FiNiShEd PoSiTiOnInG kIlL sCrIpT");

    }
    else if (lchan == gdialogBroadcast && lmsg == "Clear Scene" && ToucherID == llGetOwnerKey(llGetKey()))
    {
    llWhisper(DELETESELF,"FiNiShEd WiTh ScEnE");

    }
    }

    link_message(integer Sender_Num, integer num, string Str, key id)
    {
    if (Sender_Num == 254 | Str == "Build All Menu")
    {
    ToucherID = id;
    llDialog(ToucherID, Mainmsg,dialoglst, gdialogBroadcast);
    listen_id = llListen( gdialogBroadcast, "", ToucherID, "");
    llSetTimerEvent(30);
    llOwnerSay("Recieved " + llGetScriptName());
    listen_id = llListen( gdialogBroadcast, "", ToucherID, "");
    listen_id2 = llListen( gListenChan, "", "", "");
    listen_id2 = llListen( gChanBroadcast, "", "", "");
    }
    }

    }

     

    //Builder

    list dialoglst = ["DEPLOY","REZ"];
    string dialogmsg = "COMBINED DEPLOY";
    list params = [];
    list propdata = [];
    key ToucherID;
    //chat
    integer gChanBroadcast;
    integer gdialogBroadcast;
    integer gListenChan;
    integer listen_id;
    integer listen_id2;
    //Notecard Variables.
    string gNotecard;
    integer gLineNum = 0;

    string gNotecardDataPOS;
    string gNotecardDataTEX;
    //dataserver stuff
    key gQueryId; //Textures

    default
    {
    state_entry()
    {
    gdialogBroadcast = llListen(556677,"","","");

    llSetText("",ZERO_VECTOR,0);
    }

    touch_start(integer bad_touch)
    {
    ToucherID = llDetectedKey(0);
    llDialog(ToucherID, dialogmsg,dialoglst, gdialogBroadcast);
    listen_id = llListen( gdialogBroadcast, "", ToucherID, "");
    llSetTimerEvent(30);
    }

    timer()
    {
    //TIME'S UP!
    llListenRemove(listen_id);
    llSetTimerEvent(0.0);
    }

    listen(integer lchan, string lname, key lid, string lmsg)
    {
    if (lchan == gdialogBroadcast && lmsg == "DEPLOY")
    {
    if (llGetSubString(llGetInventoryName(INVENTORY_NOTECARD,0),0,4) == "SCENE")
    {
    gNotecard = llGetInventoryName(INVENTORY_NOTECARD,0);
    gQueryId = llGetNotecardLine(gNotecard, gLineNum);
    }
    }
    else if (lchan == gdialogBroadcast && lmsg == "REZ")
    {
    llResetScript();
    }
    else if (lchan == gdialogBroadcast && lmsg == "Deploy All Menu")
    {
    ToucherID = llDetectedKey(0);
    llDialog(ToucherID, dialogmsg,dialoglst, gdialogBroadcast);
    listen_id = llListen( gdialogBroadcast, "", ToucherID, "");
    llSetTimerEvent(30);
    }
    }


    dataserver(key lqueryid, string ldata)
    {
    if (gQueryId == lqueryid)
    {
    if (ldata != EOF)
    {
    //llSay(0,"Reading " + gNotecard);
    list tmp = llParseString2List(ldata, ["="], []);
    string setting = llList2String(tmp,0);
    if (setting == "TEX")
    {
    gNotecardDataTEX = llList2String(tmp,1);
    //llOwnerSay(gNotecardDataTEX);
    llMessageLinked(LINK_SET,255,"Ready","TEX");
    }
    else if (setting == "POS")
    {

    gNotecardDataPOS = llList2String(tmp,1);
    //llMessageLinked(LINK_SET,255,"Ready","POS");
    }
    }

    gQueryId = llGetNotecardLine(gNotecard, ++gLineNum);


    }

    }

    link_message(integer Sender_Num, integer num, string Str, key id)
    {
    if (id =="POS" && Str == "Ready")
    {
    //llOwnerSay("Starting Rez");
    integer POSPointer = 0;
    list POSLISTTemp = llCSV2List(llStringTrim(gNotecardDataPOS,STRING_TRIM));
    while(POSPointer < llGetListLength(POSLISTTemp))
    {
    string Sname = llList2String(POSLISTTemp, POSPointer++);
    vector Pos = (vector) llList2String(POSLISTTemp, POSPointer++);
    rotation Rot = (rotation) llList2String(POSLISTTemp, POSPointer++);
    llRezAtRoot(Sname, llGetPos() + Pos, ZERO_VECTOR, llGetRot() * Rot,99);

    }
    }
    else if (id =="TEX" && Str == "Ready")
    {
    integer TEXPointer = 0;
    list TEXLISTTemp = llCSV2List(llStringTrim(gNotecardDataTEX,STRING_TRIM));
    llOwnerSay(llDumpList2String(TEXLISTTemp,"\n"));
    while(TEXPointer < llGetListLength(TEXLISTTemp))
    {
    integer wall = (integer)llList2String(TEXLISTTemp, TEXPointer++);
    string tex_name = llList2String(TEXLISTTemp, TEXPointer++);
    vector repeats = (vector) llList2String(TEXLISTTemp, TEXPointer++);
    vector offsets = (vector) llList2String(TEXLISTTemp, TEXPointer++);
    float rot = (float) llList2String(TEXLISTTemp, TEXPointer++);
    vector color = (vector) llList2String(TEXLISTTemp, TEXPointer++);
    float alpha = (float) llList2String(TEXLISTTemp, TEXPointer++);
    llSetLinkPrimitiveParamsFast(wall,
    [PRIM_TEXTURE,0,tex_name,repeats,offsets,rot]);
    llSetLinkColor(wall,color,0);
    }
    }
    else if (Sender_Num == 254 | Str == "Deploy All Menu")
    {
    ToucherID = id;
    llDialog(ToucherID, dialogmsg,dialoglst, gdialogBroadcast);
    listen_id = llListen( gdialogBroadcast, "", ToucherID, "");
    llSetTimerEvent(30);
    llOwnerSay("Recieved " + llGetScriptName());
    }
    }
    }

    ^^ builder has not been updated to deal with the new grabber code for the textures ^^

     hope this helps with the diagnosis .

     

  7. been experimenting with the ALL_SIDES thing.

    i found out that it'll just "wall of text" me.

    this is probably a VERY DIRTY AND UGLY way of doing it.

     

    integer side = 0;            integer linksides = llGetLinkNumberOfSides(0)-1;            while (side <= linksides)            {               list params1 = llGetLinkPrimitiveParams(1,[PRIM_TEXTURE,side,PRIM_COLOR,side]);               list params2 = llGetLinkPrimitiveParams(2,[PRIM_TEXTURE,side,PRIM_COLOR,side]);               list params3 = llGetLinkPrimitiveParams(3,[PRIM_TEXTURE,side,PRIM_COLOR,side]);               list params4 = llGetLinkPrimitiveParams(4,[PRIM_TEXTURE,side,PRIM_COLOR,side]);               list params5 = llGetLinkPrimitiveParams(5,[PRIM_TEXTURE,side,PRIM_COLOR,side]);               list params6 = llGetLinkPrimitiveParams(6,[PRIM_TEXTURE,side,PRIM_COLOR,side]);               Tex_data += ["TEX="+(string)1,(string)side] + params1 + "\n";               Tex_data += ["TEX="+(string)2,(string)side] + params2 + "\n";               Tex_data += ["TEX="+(string)3,(string)side] + params3 + "\n";               Tex_data += ["TEX="+(string)4,(string)side] + params4 + "\n";               Tex_data += ["TEX="+(string)5,(string)side] + params5 + "\n";               Tex_data += ["TEX="+(string)6,(string)side] + params6 + "\n";               side++;            }

     

     

    now my problem is i have the results outputing to chat (ownersay)

     

    TEX=1, 0, ab62013d-ad1b-7871-1977-f710f2798206, <1.000000, 1.000000, 0.000000>, <0.000000, 0.000000, 0.000000>, 0.000000, <1.000000, 1.000000, 1.000000>, 1.000000, , TEX=2, 0, 5748decc-f629-461c-9a36-a35a221fe21f, <1.000000, 1.000000, 0.000000>, <0.000000, 0.000000, 0.000000>, 0.000000, <1.000000, 1.000000, 1.000000>, 1.000000, , TEX=3, 0, 5748decc-f629-461c-9a36-a35a221fe21f, <2.000000, 1.000000, 0.000000>, <0.500046, 0.000000, 0.000000>, 0.000000, <1.000000, 1.000000, 1.000000>, 1.000000, , TEX=4, 0, 5748decc-f629-461c-9a36-a35a221fe21f, <2.000000, 1.000000, 0.000000>, <0.500015, 0.000000, 0.000000>, 0.000000, <1.000000, 1.000000, 1.000000>, 1.000000, , TEX=5, 0, 5748decc-f629-461c-9a36-a35a221fe21f, <2.000000, 1.000000, 0.000000>, <0.500015, 0.000000, 0.000000>, 0.000000, <1.000000, 1.000000, 1.000000>, 1.000000, , TEX=6, 0, 5748decc-f629-461c-9a36-a35a221fe21f, <2.000000, 1.000000, 0.000000>, <0.500015, 0.000000, 0.000000>, 0.000000, <1.000000, 1.000000, 1.000000>, 1.000000, , TEX=1, 1, 5748decc-f

     

    as you can see it cuts off after the first face

     

     

    EDIT for typo

     

  8. tried that. still didn't work :manmad:

    side question:

    how would i get this bit to get the texture from all faces not just 0?

     

    integer side = 0;            integer prims = llGetNumberOfPrims();            integer link = llGetLinkNumber();            while (link <= prims)            {                //integer linksides = llGetLinkNumberOfSides(link);                while(side <= llGetLinkNumberOfSides(link))                {                    params = llGetLinkPrimitiveParams(                    link,                    [                    PRIM_TEXTURE,side,                    PRIM_COLOR,side                                    ]);                    Tex_data += ["TEX="+(string)link,(string)side] + params + "\n";                    side++;                }                link++;

     

    i think i'm on the right track but ATM it's only getting the texture data from the first prim.

     

  9. hey all,

    i'm having some problems with a "wallpaper applier" that uses llSetLinkPrimitiveParams().

    on walls 2 - 6 it works perfect on the floor(root prim) not so good.

    code following is the grabber and applier (seperate scripts)

     

    //GRABBER

    integer side = 0;
    integer prims = llGetNumberOfPrims();
    integer link = llGetLinkNumber();
    integer linklist = llGetLinkNumber()-1;
    while (link <= prims)
    {
    params = llGetLinkPrimitiveParams(
    link,
    [
    PRIM_TEXTURE,0,
    PRIM_COLOR,0
    ]);
    Tex_data += ["TEX="+(string)link] + params;
    link++;
    }

     

     

    //Applier
    
    {
                
                incomming_data = llCSV2List(lmsg);
                integer Pointer = 0;
                //llOwnerSay(llDumpList2String(incomming_data,"\n"));
                while(Pointer < llGetListLength(incomming_data))
                {
                    integer wall = (integer)llDeleteSubString(llList2String(incomming_data, Pointer++),0,3);
                    string tex_name = llList2String(incomming_data, Pointer++);
                    vector repeats = (vector) llList2String(incomming_data, Pointer++);
                    vector offsets = (vector) llList2String(incomming_data, Pointer++);
                    float rot = (float) llList2String(incomming_data, Pointer++);
                    vector color = (vector) llList2String(incomming_data, Pointer++);
                    float alpha = (float) llList2String(incomming_data, Pointer++);
                    llSetLinkPrimitiveParamsFast(wall,
                    [PRIM_TEXTURE,0,tex_name,repeats,offsets,rot,
                    PRIM_COLOR,0,color,alpha]);
                }
            }

     

    //sample notecard -- delete this line
    TEX=1, c16e480b-f1f3-1088-ec1a-a7aea23ff316, <5.000000, 5.000000, 0.000000>, <0.000000, 0.000000, 0.000000>, 0.000000, <1.000000, 1.000000, 1.000000>, 1.000000, 
    TEX=2, 5748decc-f629-461c-9a36-a35a221fe21f, <1.000000, 1.000000, 0.000000>, <0.000000, 0.000000, 0.000000>, 0.000000, <0.976471, 0.960784, 0.835294>, 1.000000, 
    TEX=3, 9f8c90a0-cd5b-2e7b-de36-ffc334d2ec64, <2.000000, 1.000000, 0.000000>, <0.500046, 0.000000, 0.000000>, 0.000000, <1.000000, 1.000000, 1.000000>, 1.000000, 
    TEX=4, c406aa48-5c14-5cb3-4e29-19d88c61799c, <2.000000, 1.000000, 0.000000>, <0.500015, 0.000000, 0.000000>, 0.000000, <1.000000, 1.000000, 1.000000>, 1.000000, 
    TEX=5, 8c52b32b-2fa6-c79c-90fc-b1eb658b8b24, <2.000000, 1.000000, 0.000000>, <0.500015, 0.000000, 0.000000>, 0.000000, <1.000000, 1.000000, 1.000000>, 1.000000, 
    TEX=6, 7783df50-e2eb-4438-1f3c-d8ac01b950b0, <2.000000, 1.000000, 0.000000>, <0.500015, 0.000000, 0.000000>, 0.000000, <1.000000, 1.000000, 1.000000>, 1.000000,

     

    TY in advance

     

     

     

  10. i have an object that is full perms in my inventory but when i rez it it becomes no copy/no mod because of the animations and scripts.

    if i were to use this in a holodeck would it be lost on the first rez or would it stay in the object inventory?

  11. ok. 90% of the code works now.

    i'm still having problems with rezzing.

    below is the relevent sections of code instead of posting the whole thing again as not much has changed.

    the Data server event

     

     dataserver(key lqueryid, string ldata)
    {
    if (gQueryId == lqueryid)
    {
    if (ldata != EOF)
    {
    list tmp = llParseString2List(ldata, ["="], []);
    string setting = llList2String(tmp,0);
    if (setting == "TEX")
    {
    llWhisper(666777888,ldata);
    }
    //here to
    else if (setting == "POS")
    {
    //gNotecardDataPOS = llDeleteSubString(ldata,0,3);
    gNotecardDataPOS = llList2String(tmp,1);
    llMessageLinked(LINK_SET,255,"Ready","POS");
    }
    //here is the relevent code for the position data
    gQueryId = llGetNotecardLine(gNotecard, ++gLineNum);


    }
    }
    }

     

     

    instead of doing ALL the processing here i'm just extracting the data.

    below is where i'm processing it.

     

     

    link_message(integer Sender_Num, integer num, string Str, key id)    {        if (id =="POS" && Str == "Ready")        {            //llOwnerSay("Starting Rez");            integer Pointer = 0;            list POSLISTTemp = llCSV2List(gNotecardDataPOS);            //llOwnerSay(gNotecardDataPOS);            while(Pointer < llGetListLength(POSLISTTemp))                {                    string Sname = llList2String(POSLISTTemp, Pointer++);                    vector Pos = (vector) llList2String(POSLISTTemp, Pointer++);                     rotation Rot = (rotation) llList2String(POSLISTTemp, Pointer++);                                llRezObject(Sname, llGetPos() + Pos, ZERO_VECTOR, llGetRot() * Rot,99);                                    }            llSetText("DONE",<0.0,1.0,1.0>,1);        }}

     

     

    here is the notecard data.

    POS=foo,<-0.817398, -2.522522, 1.779785>,<-0.999962, 0.000000, 0.000000, -0.991272>,
    POS=foo,<0.256226, -2.533379, -0.725098>,<0.000000, 0.000000, 0.000000, 0.000000>,
    POS=foo,<-1.941086, -2.544228, 3.023682>,<-0.999962, 0.000000, 0.000000, -0.991272>,
    POS=foo,<0.256226, -2.544228, 3.023682>,<-0.999962, 0.000000, 0.000000, -0.991272>,
    POS=foo,<-0.817398, -2.533379, 0.518799>,<0.000000, 0.000000, 0.000000, 0.000000>,
    POS=foo,<-1.941086, -2.533379, -0.725098>,<0.000000, 0.000000, 0.000000, 0.000000>

    and finally the error message.

    Master Builder: Could not find object ''.

     

    i think i have narrowed the problem down to somewhere in the loop for rezzing as when i had it [llOwnerSay((string)llGetListLength(POSLISTTemp));] for the first 5 runs it would show 4 list items and on the 6th it would show 3 (the right number).

    i think it is picking up the ENTER after the end of each line as a record BUT when i take it out and make it one continous line it will not read right.

    POST is long enough

  12. Void, from the wiki

     


     

    Vectors & Rotations

    Anything between "<" and ">" is considered a single value regardless of the existence of a comma between.

    This ensures that vectors and rotations get treated as a single value, with no additional cleanup needed afterward.

    Note, though, that for every "<" there needs to be a corresponding ">" or it will consume the rest of the string. For example,

    •  llCSV2List("<>,>,a") returns ["<>", ">", "a"] (Second ">" is isolated)
    •  llCSV2List("<<>,>,a") returns ["<<>,>", "a"] (Regularly paired)
    •  llCSV2List("<<<>,>,a") returns ["<<<>,>,a"] (Third "<" lost its opposite one)

     


     

    thats why i use llCSV2List() and it's opposite llList2CSV().

     

    i finally figured it out.

    it was here gNotecardDataPOS = CSV; (this is the fixed version) i was i think converting the list to a string and back too many times and buggered it up somewhere, i was also trimming out substring too many tims and it was messing with the names and values.

    i've fixed the rezzing bit, now onto the textures /facepalm

  13. Hey all,

    I'm trying to make a "simple" holodeck

    CODE FOLLOWS

     

    list dialoglst = ["DEPLOY","REZ"];
    string dialogmsg = "COMBINED DEPLOY";
    list params = [];
    list propdata = [];
    key ToucherID;
    //chat
    integer gChanBroadcast;
    integer gdialogBroadcast;
    integer gListenChan;
    integer listen_id;
    integer listen_id2;
    //Notecard Variables.
    string gNotecard;
    integer gLineNum = 0;
    list gNotecardDataTEX;
    list gNotecardDataPOS;
    //dataserver stuff
    key gQueryId; //Textures
    
    default
    {
        state_entry()
        {
            gdialogBroadcast = llListen(556677,"","","");
        }
        
        touch_start(integer bad_touch)
        {
            ToucherID = llDetectedKey(0);
            llDialog(ToucherID, dialogmsg,dialoglst, gdialogBroadcast);
            listen_id = llListen( gdialogBroadcast, "", ToucherID, "");
            llSetTimerEvent(30);
        }
        
        timer()
        { 
            //TIME'S UP!
            llListenRemove(listen_id);
            llSetTimerEvent(0.0);
        }
        
        listen(integer lchan, string lname, key lid, string lmsg)
        {
            if (lchan == gdialogBroadcast && lmsg == "DEPLOY")
            {
                llOwnerSay("PING");
                if (llGetSubString(llGetInventoryName(INVENTORY_NOTECARD,0),0,2) == "TEX")
               {
                   gNotecard = llGetInventoryName(INVENTORY_NOTECARD,0);
                   gQueryId = llGetNotecardLine(gNotecard, gLineNum);
                }
            }
            
        }
        
        /*link_message(integer Sender_Num, integer num, string Str, key id)
        {
            if (id == "tex" && Str == "change")
            {
                llOwnerSay("Redecorating");
                integer Pointer = 0;
                while(Pointer < llGetListLength(gNotecardDataTEX))
                {
                    Pointer++;
                    //llWhisper(666777888,llList2CSV());
                    llOwnerSay(llList2CSV(gNotecardDataTEX));
                }
            }
            else if (id == "pos" && Str == "rez")
            {
                llOwnerSay("Rezzing");
                integer Pointer = 0;
                while(Pointer < llGetListLength(gNotecardDataPOS))
                {
                string Sname = llList2String(gNotecardDataPOS, Pointer++);
                rotation Rot = (rotation) llList2String(gNotecardDataPOS, Pointer++);
                vector Pos = (vector) llList2String(gNotecardDataPOS, Pointer++);
                //llOwnerSay(Sname + "\n" + (string) Pos + "\n" + (string) Rot);
                llRezObject(Sname, llGetPos() + Pos, ZERO_VECTOR, llGetRot() * Rot,             99);
                }
            }
        }*/
        
        dataserver(key lqueryid, string ldata)
        {
            if (gQueryId == lqueryid)
            {
                if (ldata != EOF)
                    {
                        list tmp = llParseString2List(ldata, ["="], []);
                        string setting = llList2String(tmp,0);
                        list CSV = llCSV2List(llList2String(tmp,1));
                         if (setting == "TEX")
                            {
                                
                                //llMessageLinked(LINK_THIS, 254,"change","tex");
                                //llOwnerSay(llDeleteSubString(llList2CSV(tmp),0,3));
                                gNotecardDataTEX += llDeleteSubString(llList2CSV(CSV),0,3);
                                llWhisper(666777888,llList2CSV(gNotecardDataTEX));
                            }
                            else if (setting == "POS")
                            {
                                llOwnerSay("Finished Objects, Deploying");
                                //llMessageLinked(LINK_THIS, 254,"rez","pos");
                                //llOwnerSay(llDeleteSubString(llList2CSV(tmp),0,3));
                                gNotecardDataPOS += llList2CSV(CSV);
                                //llOwnerSay(llList2String(gNotecardDataPOS,0));
                                integer Pointer = 0;
                                while(Pointer < llGetListLength(gNotecardDataPOS))
                                    {
                                        string Sname = llList2String(gNotecardDataPOS, Pointer++);
                                        rotation Rot = (rotation) llList2String(gNotecardDataPOS, Pointer++);
                                        vector Pos = (vector) llList2String(gNotecardDataPOS, Pointer++);
                                        //llOwnerSay(Sname + "\n" + (string) Pos + "\n" + (string) Rot);
                                       // llRezObject(Sname, llGetPos() + Pos, ZERO_VECTOR, llGetRot() * Rot,99);
                                       llOwnerSay(llDumpList2String(gNotecardDataPOS,"\n"));
                                    }
                            }
                            
                        //gNotecardData += ldata;             
                        gQueryId = llGetNotecardLine(gNotecard, ++gLineNum);
                        llSetText((string)gLineNum,<0.0,0.0,0.0>,0);
                    }
            }
        }
    }

     

     

    NOTECARD FOLLOWS

     

    TEX=1,87dfd082-f83b-673b-e86b-5fa2d64bedf8,<1.000000, 1.000000, 0.000000>,<0.000000, 0.000000, 0.000000>,0.000000,<0.111596, 0.143980, 0.475304>,1.000000
    TEX=2,1a846dac-dfa5-cfbc-5d53-0389575b2545,<1.000000, 1.000000, 0.000000>,<0.000000, 0.000000, 0.000000>,0.000000,<0.746924, 0.975448, 0.677933>,1.000000
    TEX=3,948f4aa8-8d5e-71e0-03c2-b20b117bcdea,<1.000000, 1.000000, 0.000000>,<0.000000, 0.000000, 0.000000>,0.000000,<0.557596, 0.853893, 0.974349>,1.000000
    TEX=4,4411f334-838e-8a2e-dffa-14571c89db7d,<1.000000, 1.000000, 0.000000>,<0.000000, 0.000000, 0.000000>,0.000000,<0.983629, 0.524983, 0.721262>,1.000000
    TEX=5,b7990774-5ee5-f9fe-79f7-bc1dfe345b25,<1.000000, 1.000000, 0.000000>,<0.000000, 0.000000, 0.000000>,0.000000,<0.210421, 0.717405, 0.081727>,1.000000
    TEX=6,6d7056ab-1d42-26e6-92d9-80d2c705c5ea,<1.000000, 1.000000, 0.000000>,<0.000000, 0.000000, 0.000000>,0.000000,<0.211569, 0.406867, 0.393395>,1.000000
    POS=125.125,<0.000000, 0.000000, 0.000000, 0.000000>,<-3.000000, -3.000000, 0.274902>
    POS=128.126,<0.000000, 0.382683, 0.000000, -0.076120>,<0.000000, -2.000000, 0.274902>
    POS=130.128,<0.382683, 0.000000, 0.000000, -0.076120>,<2.000000, 0.000000, 1.000000>
    POS=125.131,<0.000000, 0.000000, 0.000000, 0.000000>,<-3.000000, 3.000000, 2.000000>

     

     

    now here is the problem i'm having,

    in line 100 - 116 ( the dataserver event starting with else if (setting == "POS"))

    it's meant to separate the list into the component parts and feed it into llRezObject() however it's not separating the values

     

    any help/ feedback apprecieated.

     

    (i know the formatting SUCKS cleaning it up when i get it to work)

  14. the notecard bit is copied and pasted directly from the wiki but here it is

     

    dataserver(key lqueryid, string ldata)    {        if (gQueryId == lqueryid)        {            if (ldata != EOF)            {            gNotecardData += ldata;            llSetText(ldata,<1,1,1>,1); //for debuging            gLineNum++;            gQueryId = llGetNotecardLine(gNotecard, gLineNum);            }        }    }

     

     

     

  15. hey all VERY long time no post,

    here is the problem i am having. i have a notecard with groups of 3 lines

     

    NOTECARD
    125.125
    <0.000000, 0.000000, 0.000000, 0.000000>
    <-3.000000, -3.000000, 0.274902>
    128.126
    <0.000000, 0.382683, 0.000000, -0.076120>
    <0.000000, -2.000000, 0.274902>
    130.128
    <0.382683, 0.000000, 0.000000, -0.076120>
    <2.000000, 0.000000, 1.000000>
    125.131
    <0.000000, 0.000000, 0.000000, 0.000000>
    <-3.000000, 3.000000, 2.000000>

     

    NOTECARD READING SNIPPET

    else if (lchan == gdialogBroadcast && lmsg == "DEPLOY")
    {
    integer a = 0;
    integer b = 1;
    integer c = 2;
    integer line = 0;
    integer listlen = llGetListLength(gNotecardData);
    while (line <= listlen)
    {

    string Snam = llList2String(gNotecardData,a+=3);
    string Srot = llList2String(gNotecardData,b+=3);
    string Spos = llList2String(gNotecardData,c+=3);
    rotation Rot = (rotation)Srot;
    vector Pos = (vector)Spos;
    llOwnerSay(Snam + "\n" + (string)(Pos) + "\n" + (string)Rot);
    llRezObject(Snam,llGetPos()+Pos,ZERO_VECTOR,llGetRot()+Rot,99);
    line++;
    }

     

     

    now the problem is that it reads the first 3 groups. however it cuts off the last line of the last group.

    also is how i've doe it the "best" way to increment in groups

     

×
×
  • Create New...