Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

set 3 sides but not 4th?

Kornscope Komachi
Transitional human
Join date: 30 Aug 2006
Posts: 1,041
12-18-2006 21:32
I have a hollowed box with .250 cut, one side off for a wrap around window.
I wish to change the 3 outsides=1,2,3 but not the inside=4.

I could do allsides and change #4 back but won't know what back was.

snippet/
CODE

}
else if (message=="Int-Curtains") {
llSetTexture("471fba27-0388-2f51-90c5-797ab9c9d112",4);
llSetAlpha(1.0,4);
llSetColor(<1,1,1>,4);
llScaleTexture(1.0,1.0,4);
}
else if (message=="Ext-Shutters") {
llSetTexture("0f8dec66-734f-377c-5815-ec36bae3b2d9",(1,2,3));//doing this wont work
llSetAlpha(1.0,1);
llSetColor(<1,1,1>,3);
llScaleTexture(1.0,20.0,3);
}
else if (message=="Ext-Windows") {
llSetTexture("d5b71125-77cf-5aab-b47d-d0405bc25b5a",1,2,3);//doing this wont work
llSetAlpha(1.0,3);
llSetColor(<1,1,1>,3);
llScaleTexture(1.0,1.0,3);
}

I tried bracketing various ways and can't find an example although I've seen the example in llSetPrimativeParams but can you show me the simple answer please.
_____________________
SCOPE Homes, Bangu
-----------------------------------------------------------------
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
12-19-2006 01:00
The llSetTexture side parameter is a number so will only do ALL_SIDES or one specific side at a time, so either make 3 calls (but remember the 0.2 sec penalty per call) or use llSetPrimitiveParams

There is no back, you would need to specify the old texture.

I've not tried this but I think what you would need is something like

CODE


else if (message=="Int-Curtains")
{
//llSetTexture("471fba27-0388-2f51-90c5-797ab9c9d112",4);
//llSetAlpha(1.0,4);
//llSetColor(<1,1,1>,4);
//llScaleTexture(1.0,1.0,4);

llSetPrimitiveParams([ PRIM_TEXTURE, 4, "471fba27-0388-2f51-90c5-797ab9c9d112", <1.0, 1.0, 1.0>, <0.0, 0.0, 0.0>, 0.0,
PRIM_COLOR, 4, <1,1,1>, 0.4]);
}
else if (message=="Ext-Shutters")
{
//llSetTexture("0f8dec66-734f-377c-5815-ec36bae3b2d9",(1,2,3));//doing this wont work
//llSetAlpha(1.0,1);
//llSetColor(<1,1,1>,3);
//llScaleTexture(1.0,20.0,3);
llSetPrimitiveParams([ PRIM_TEXTURE, 1, "471fba27-0388-2f51-90c5-797ab9c9d112", <1.0, 1.0, 1.0>, <0.0, 0.0, 0.0>, 1.0,
PRIM_TEXTURE, 2, "471fba27-0388-2f51-90c5-797ab9c9d112", <1.0, 1.0, 1.0>, <0.0, 0.0, 0.0>, 0.0,
PRIM_TEXTURE, 3, "471fba27-0388-2f51-90c5-797ab9c9d112", <1.0,20.0, 1.0>, <0.0, 0.0, 0.0>, 0.0,
PRIM_COLOR, 3, <1,1,1>, 0.0]);
}
else if (message=="Ext-Windows")
{
//llSetTexture("d5b71125-77cf-5aab-b47d-d0405bc25b5a",1,2,3);//doing this wont work
//llSetAlpha(1.0,3);
//llSetColor(<1,1,1>,3);
//llScaleTexture(1.0,1.0,3);
llSetPrimitiveParams([ PRIM_TEXTURE, 1, "d5b71125-77cf-5aab-b47d-d0405bc25b5a", <1.0, 1.0, 1.0>, <0.0, 0.0, 0.0>, 1.0,
PRIM_TEXTURE, 2, "d5b71125-77cf-5aab-b47d-d0405bc25b5a", <1.0, 1.0, 1.0>, <0.0, 0.0, 0.0>, 0.0,
PRIM_TEXTURE, 3, "d5b71125-77cf-5aab-b47d-d0405bc25b5a", <1.0,10.0, 1.0>, <0.0, 0.0, 0.0>, 0.0,
PRIM_COLOR, 3, <1,1,1>, 1.0]);
}

Kornscope Komachi
Transitional human
Join date: 30 Aug 2006
Posts: 1,041
Thanks Newgate.
12-19-2006 16:17
No wonder I couldn't get it to work. I assumed as much.
I think I am getting a handle on scripting now but there is a long way and a lot of time ahead one, function at a time. I have to learn because
Building and textures sure look pretty but scripting gets stuff done.
After all...scripters rule.
_____________________
SCOPE Homes, Bangu
-----------------------------------------------------------------
Dragon Eccleston
Registered User
Join date: 25 Dec 2005
Posts: 42
12-19-2006 19:01
If the prim is modifyable you can do llGetTexture() to get the old texture to change the 4th side back to in 2 function calls/llSetPrimitiveParameter's instead of 3
Kornscope Komachi
Transitional human
Join date: 30 Aug 2006
Posts: 1,041
Texture is rotated.
12-19-2006 20:29
OK, this has got me now.
I inserted a sample of the above code and the texture is rotated 57.30 degrees. I blank and zero all settings and it sets textures ok but rotated again. I cannot work this out.
edit: i got it. The 1.0 at the end should be 0.0
CODE

default
{
state_entry()
{
llSay(0, "Hello, Avatar!");
}

touch_start(integer total_number)
{
llSetPrimitiveParams([ PRIM_TEXTURE, ALL_SIDES, "0f8dec66-734f-377c-5815-ec36bae3b2d9", <1.0, 1.0, 1.0>, <0.0, 0.0, 0.0>, 1.0]);

}
}

Please could you fill me in?
_____________________
SCOPE Homes, Bangu
-----------------------------------------------------------------
Kornscope Komachi
Transitional human
Join date: 30 Aug 2006
Posts: 1,041
12-19-2006 21:16
From: Dragon Eccleston
If the prim is modifyable you can do llGetTexture() to get the old texture to change the 4th side back to in 2 function calls/llSetPrimitiveParameter's instead of 3

Thaks Dragon, I don't know how to pass the Get calls on yet so i'm making a spa/pool with all the bells as a project to get all this stuff together. I'm still trying to work out how to make the water appear to rise slowly from the bottom of the pool to fill let alone the switches to do it.
_____________________
SCOPE Homes, Bangu
-----------------------------------------------------------------
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
12-19-2006 21:49
From: Dragon Eccleston
If the prim is modifyable you can do llGetTexture() to get the old texture to change the 4th side back to in 2 function calls/llSetPrimitiveParameter's instead of 3


It's my understanding that this would require full perms, not just mod. This has to be true for the next owner, if this is to be a commercial product, so in that case I doubt full permissions will be given, resulting in an object that works only for the creator. I think it would work best with the llSetPrimitiveParams setting only the desired faces, done in a list it's done all at once, with only one 0.2 second penalty.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
12-20-2006 00:46
From: Kornscope Komachi
OK, this has got me now.
I inserted a sample of the above code and the texture is rotated 57.30 degrees. I blank and zero all settings and it sets textures ok but rotated again. I cannot work this out.
edit: i got it. The 1.0 at the end should be 0.0
CODE

default
{
state_entry()
{
llSay(0, "Hello, Avatar!");
}

touch_start(integer total_number)
{
llSetPrimitiveParams([ PRIM_TEXTURE, ALL_SIDES, "0f8dec66-734f-377c-5815-ec36bae3b2d9", <1.0, 1.0, 1.0>, <0.0, 0.0, 0.0>, 1.0]);

}
}

Please could you fill me in?


sorry my fault, The parameters with PRIM_TEXTURE are
integer face, string name, vector repeats, vector offsets, float rotation
I got confused and thought the last parameter with alpha rather than rotation.
Your getting 1.0 Radians worth of rotation (approx 57.3 degrees)