Jump to content

texture application problems - holodeck


Tabris Daxter
 Share

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

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

Recommended Posts

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

 

 

 

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

It was the fact that only the first got mangled that made me suspect that dataserver events were getting swapped between competing handlers in a kind of race condition that only arose at the start of everything.  But if there are no other scripts or they all check that the query IDs match, then that's not what's going on anyway.  (For that to be the case here, there'd need to be some other complication that "ate" the dataserver event from that first line, too, so it's not a very parsimonious explanation; just something I've been bitten by in the past.)

To the other question, if it's any help, in llGet*PrimitiveParams() functions it's possible to specify ALL_SIDES as value for PRIM_COLOR and PRIM_TEXTURE, which returns a list with each side's values.

ETA: You know, I'd still suggest printing out everything the dataserver event is getting.  Could it be failing to ignore that first "delete this line" line?  That doesn't quite make sense either, but I'm still suspicious that something funky is happening in that handler, wrapped around the code that's posted.

Link to comment
Share on other sites

Oh, sorry, missed this follow-up.  No, it returns a list of results in side-number order, so you have to parse through them incrementing the side yourself.  Prim sides are always numbered from 0 to llGetNumberOfSides() - 1.  If prim type or geometry changes, the side number for any particular bit of prim (such as, say, the inside of a hollow) may change, too, in the way described on the wiki.

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

@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 .

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

Try cleaning up your data before processing it, thus, and see if it helps:

 

if(data != EOF){  data = llStringTrim(data,STRING_TRIM);//chop off leading and trailing spaces  if(data!="" && llGetSubString(data,0,1)!="//"){//if there's still anything left and it's not a comment    //process it  }}

 It can't hurt, and at least it would rule out one cause.

 

Link to comment
Share on other sites

@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

Link to comment
Share on other sites

That sounds like a looping error to me.   Try

 

  integer TEXPointer = 0;            list TEXLISTTemp = llCSV2List(llStringTrim(gNotecardDataTEX,STRING_TRIM));            integer max = llGetListLength(TEXLISTTemp) -1;                  llOwnerSay(llDumpList2String(TEXLISTTemp,"\n"));            while(TEXPointer < max )            {                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);              //  llOwnerSay("Wall is "+(string)wall+":"+(string)[PRIM_TEXTURE,0,tex_name,repeats,offsets,rot]);            }

 in the link message (I've tested it, but simply by reading the card rather than in a build).

 

Link to comment
Share on other sites

if (vStrDta = llStringTrim( llList2String( llParseStringKeepNulls( vStrDta, ["//"], [] ), 0 ), STRING_TRIM ) ){

is what I'm using for validating and comment stripping right now.... let you add trailing comments, but still ignore lines with nothing but spaces or comments.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4801 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...