Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Scifi Door Script

JJValero Writer
Registered User
Join date: 28 Feb 2007
Posts: 10
02-03-2009 17:06
This script is based in one animated texture. This door can not be linked due use phantom mode when open.

CODE



string SCIFI_TEXTURE = "a12d0538-f195-93d2-4f3f-ba2767d50697";
string SOUND_DOOR = "34c9a0b4-5820-0eb3-a639-61dcd5bb7f2b";

float VOLUME = 1.0;
float TIMER = 5.0;

default {

state_entry() {

llSetPrimitiveParams([
PRIM_TEXTURE, ALL_SIDES, SCIFI_TEXTURE,
<0.250, 0.500, 0>,
<-0.375, 0.250, 0>,
0.0]);

llSetTextureAnim(0, ALL_SIDES, 0, 0, 0, 0, 0.0);
state closed;

} // state_entry

} // default

state closed {

state_entry() {

llSetTextureAnim(0, ALL_SIDES, 0, 0, 0, 0, 0.0);
llOffsetTexture(-0.375, 0.250, ALL_SIDES);
llSetStatus(STATUS_PHANTOM, FALSE);

} // state_entry

touch_start(integer num_detected) {

llSetTextureAnim(ANIM_ON, ALL_SIDES, 4, 2, 0, 0, 10.0);
llTriggerSound(SOUND_DOOR, VOLUME);
state open;

} // touch_start

collision_start(integer num_detected) {

llSetTextureAnim(ANIM_ON, ALL_SIDES, 4, 2, 0, 0, 10.0);
llTriggerSound(SOUND_DOOR, VOLUME);
state open;

} // collision_start

} // closed

state open {

state_entry() {

llOffsetTexture(-0.625, -0.250, ALL_SIDES);
llSetTextureAnim(0, ALL_SIDES, 0, 0, 0, 0, 0.0);
llSetStatus(STATUS_PHANTOM, TRUE);
llSetTimerEvent(TIMER);

} // state_entry

state_exit() {

llSetTimerEvent(0.0);

} // state_exit

touch_start(integer total_number) {

llSetTextureAnim(ANIM_ON | REVERSE, ALL_SIDES, 4, 2, 7, 0, 10.0);
llTriggerSound(SOUND_DOOR, VOLUME);
state closed;

} // touch_start

timer() {

llSetTimerEvent(0.0);
llSetTextureAnim(ANIM_ON | REVERSE, ALL_SIDES, 4, 2, 7, 0, 10.0);
llTriggerSound(SOUND_DOOR, VOLUME);
state closed;

} // timer

} // open

Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
02-03-2009 18:45
From: JJValero Writer
This script is based in one animated texture. This door can not be linked due use phantom mode when open.


Use Flexi instead.
Or hollow the door, and path-cut away all but one side so that just a small sliver of the prim remains.
Or turn the prim on it's side, and hollow the door, letting people walk through the hollow.
Or. Cut the prim in half with path-cut, and then resize the door to 0.01 wide to open, and back to normal when closed.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura