Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Timed Texture Change / Door Script Help

Dioxide DeSantis
Registered User
Join date: 2 Feb 2007
Posts: 63
08-18-2008 19:05
Ok hopefully this one is an easy one for you guys.
Basically I want to create a door that when clicked goes alpha and then after maybe 5 seconds it goes back to the non alpha texture. I have the script working properly except for the timed part and I am not sure where to place that event of even if it can be done.

Its basically a door that goes alpha when clicked, I tried to comment the code as much as I could.

Any help would be greatly appreciated

Dioxide


CODE

default
{
touch_start(integer total_number)
{
llSetTexture("266acf86-27c0-2d6e-580a-3d6ae482ab68",ALL_SIDES);//The Solid Texture
llSetAlpha(1.0,ALL_SIDES);//1.0 shows all of a certain texture, 0.0 shows none of it
llScaleTexture(1,1, ALL_SIDES);//adjusts texture scale
llSetStatus (STATUS_PHANTOM, FALSE); //FALSE object collides with others (is not phantom), you cannot walk thru it.
state closed;

}
}
state closed
{
touch_start(integer total_number)
{
llSetTexture("f54a0c32-3cd1-d49a-5b4f-7b792bebc204",ALL_SIDES); // The Totally Clear Texture
llSetAlpha(1.0,ALL_SIDES);
llScaleTexture(1,1, ALL_SIDES);
llSetStatus (STATUS_PHANTOM, TRUE); //TRUE , You Can Walk Thru it.
state default;
}
}
CODE
Cheree Bury
ChereeMotion Owner
Join date: 6 Jun 2007
Posts: 666
08-18-2008 20:15
From: Dioxide DeSantis
Ok hopefully this one is an easy one for you guys.
Basically I want to create a door that when clicked goes alpha and then after maybe 5 seconds it goes back to the non alpha texture. I have the script working properly except for the timed part and I am not sure where to place that event of even if it can be done.

Its basically a door that goes alpha when clicked, I tried to comment the code as much as I could.

Any help would be greatly appreciated

Dioxide


CODE

default
{
touch_start(integer total_number)
{
llSetTexture("266acf86-27c0-2d6e-580a-3d6ae482ab68",ALL_SIDES);//The Solid Texture
llSetAlpha(1.0,ALL_SIDES);//1.0 shows all of a certain texture, 0.0 shows none of it
llScaleTexture(1,1, ALL_SIDES);//adjusts texture scale
llSetStatus (STATUS_PHANTOM, FALSE); //FALSE object collides with others (is not phantom), you cannot walk thru it.
state closed;

}
}
state closed
{
touch_start(integer total_number)
{
llSetTexture("f54a0c32-3cd1-d49a-5b4f-7b792bebc204",ALL_SIDES); // The Totally Clear Texture
llSetAlpha(1.0,ALL_SIDES);
llScaleTexture(1,1, ALL_SIDES);
llSetStatus (STATUS_PHANTOM, TRUE); //TRUE , You Can Walk Thru it.
state default;
}
}
CODE


I couldn't quite get it to work with your code so I reorganized it and came up with:

CODE

OpenDoor()
{
llSetTexture("f54a0c32-3cd1-d49a-5b4f-7b792bebc204",ALL_SIDES); // The Totally Clear Texture
llSetAlpha(1.0,ALL_SIDES);
llScaleTexture(1,1, ALL_SIDES);
llSetStatus (STATUS_PHANTOM, TRUE); //TRUE , You Can Walk Thru it.
llSetTimerEvent(5.0);
}

CloseDoor()
{
llSetTexture("266acf86-27c0-2d6e-580a-3d6ae482ab68",ALL_SIDES);//The Solid Texture
llSetAlpha(1.0,ALL_SIDES);//1.0 shows all of a certain texture, 0.0 shows none of it
llScaleTexture(1,1, ALL_SIDES);//adjusts texture scale
llSetStatus (STATUS_PHANTOM, FALSE); //FALSE object collides with others (is not phantom), you cannot walk thru it.
llSetTimerEvent(0.0);
}

default
{
state_entry()
{
CloseDoor();
}

touch_start(integer total_number)
{
OpenDoor();
}

timer()
{
CloseDoor();
}
}
_____________________
Visit ChereeMotion - Life's Best Pinup Poses
http://slurl.com/secondlife/Wild%20Rice/38/230/51
Dioxide DeSantis
Registered User
Join date: 2 Feb 2007
Posts: 63
08-19-2008 13:04
Perfect thank you so much for your help Cheree

I even learned a bit from your reply :)

Dioxide
Cheree Bury
ChereeMotion Owner
Join date: 6 Jun 2007
Posts: 666
08-19-2008 13:09
From: Dioxide DeSantis
Perfect thank you so much for your help Cheree

I even learned a bit from your reply :)

Dioxide


Wonderful. I consider the day to be a waste if I don't learn something or teach something.

:-)
_____________________
Visit ChereeMotion - Life's Best Pinup Poses
http://slurl.com/secondlife/Wild%20Rice/38/230/51
Dioxide DeSantis
Registered User
Join date: 2 Feb 2007
Posts: 63
08-19-2008 13:30
I was thinking hey this needs sounds as well. So I thought why not add some this does not use the ultimate one I will use but it does work. Hopefully this script can be usefull to others as well.

CODE

OpenDoor()
{
llSetTexture("f54a0c32-3cd1-d49a-5b4f-7b792bebc204",ALL_SIDES); // The Totally Clear Texture
llSetAlpha(1.0,ALL_SIDES);
llScaleTexture(1,1, ALL_SIDES);
llSetStatus (STATUS_PHANTOM, TRUE); //TRUE , You Can Walk Thru it.
llTriggerSound("cb340647-9680-dd5e-49c0-86edfa01b3ac", 0.5);
llSetTimerEvent(5.0);
}

CloseDoor()
{
llSetTexture("266acf86-27c0-2d6e-580a-3d6ae482ab68",ALL_SIDES);//The Solid Texture
llSetAlpha(1.0,ALL_SIDES);//1.0 shows all of a certain texture, 0.0 shows none of it
llScaleTexture(1,1, ALL_SIDES);//adjusts texture scale
llSetStatus (STATUS_PHANTOM, FALSE); //FALSE object collides with others (is not phantom), you cannot walk thru it.
llTriggerSound("e7ff1054-003d-d134-66be-207573f2b535", 0.5);
llSetTimerEvent(0.0);
}

default
{
state_entry()
{
CloseDoor();
}

touch_start(integer total_number)
{
OpenDoor();
}

timer()
{
CloseDoor();
}
}
CODE
Ron Khondji
Entirely unlike.
Join date: 6 Jan 2007
Posts: 224
Just another way of doing it.
08-20-2008 00:04
Using llSetPrimitveParams.

From: someone

key gOpenTexture = "f54a0c32-3cd1-d49a-5b4f-7b792bebc204"; // The Totally Clear Texture
key gOpenSound = "e7ff1054-003d-d134-66be-207573f2b535"; // Sound on open.

key gCloseTexture = "266acf86-27c0-2d6e-580a-3d6ae482ab68"; //The Solid Texture
key gCloseSound = "cb340647-9680-dd5e-49c0-86edfa01b3ac"; // Sound on close

Door(string texture, integer oc)
{
llSetPrimitiveParams([
PRIM_TEXTURE,ALL_SIDES,texture,<1,1,1>,ZERO_VECTOR,0.0,
PRIM_PHANTOM,oc
]);
if (oc){
llTriggerSound(gOpenSound, 0.5);
llSetTimerEvent(5.0);
} else llTriggerSound(gCloseSound, 0.5);
}

default
{
state_entry()
{
Door(gCloseTexture,FALSE); // close
}

touch_start(integer total_number)
{
Door(gOpenTexture,TRUE); //open
}

timer()
{
llSetTimerEvent(0);
Door(gCloseTexture,FALSE); // close
}
}