script pour fenetres

Répondre
Partager Rechercher
pour une ouverture sur le coté, en glissant
tu as ça:

//--------------------------début-script-ouverture-glissante-------------------------------
//Sliding Door v4
//Works when linked
//by Kayla Stonecutter

//How far in meters to travel in each direction. Two or all three can be used for angled movement
//NOTE: when linked, this is relative to the root prim
//Positive = move north, negative = move south
float NorthSouth = 0.0;
//Positive = move east, negative = move west
float EastWest = -2.0;
//Positive = move up, negative = move down
float UpDown = 0.0;

//The amount in seconds to stay open, set to 0 to not autoclose
float Timer = 15.0;

//Sound to play on open, either a UUID or a name in the door contents
//if a name, it must be exact. Leave at "" for no sound
string OpenSound = "cb340647-9680-dd5e-49c0-86edfa01b3ac";

//Volume to play open sound, 0.0 is same as no sound, 1.0 is max
float OpenVol = 1.0;

//Sound to play on close, either a UUID or a name in the door contents
//if a name, it must be exact. Leave at "" for no sound
string CloseSound = "e7ff1054-003d-d134-66be-207573f2b535";

//Volume to play close sound, 0.0 is same as no sound, 1.0 is max
float CloseVol = 1.0;


//misc variables
vector Pos;
vector Offset;
integer Open;
integer x;

default
{
state_entry()
{
Offset = <EastWest, NorthSouth, UpDown>;
}

touch_start(integer num)
{
for(x = 0; x < num; x++)
{
Open = !Open;
if(Open)
{
Pos = llGetLocalPos();
if(OpenSound != "") llTriggerSound(OpenSound, OpenVol);
llSetPos(Pos + Offset);
llSetTimerEvent(Timer);
}else{
if(CloseSound != "") llTriggerSound(CloseSound, CloseVol);
llSetPos(Pos);
llSetTimerEvent(0);
}
}
}

on_rez(integer param)
{
llResetScript();
}

moving_end()
{
if(Open)
{
Open = 0;
llSetTimerEvent(0.0);
}
}

timer()
{
if(CloseSound != "") llTriggerSound(CloseSound, CloseVol);
llSetPos(Pos);
llSetTimerEvent(0);
Open = 0;
}
}
//--------------------------fin-script---------------------------------

sinon pour ouvrir sur le devant tu as ça

//--------------------------début-script---------------------------------
//Simple door by Kayla Stonecutter
//works while linked

//Set the amount in degrees to rotate
//Positive numbers rotate counterclockwise from top
float RotAmount = 90;

//The amount in seconds to stay open, set to 0 to not autoclose
float Timer = 15.0;

//Sound to play on open, either a UUID or a name in the door contents
//if a name, it must be exact. Leave at "" for no sound
string OpenSound = "cb340647-9680-dd5e-49c0-86edfa01b3ac";

//Volume to play open sound, 0.0 is same as no sound, 1.0 is max
float OpenVol = 1.0;

//Sound to play on close, either a UUID or a name in the door contents
//if a name, it must be exact. Leave at "" for no sound
string CloseSound = "e7ff1054-003d-d134-66be-207573f2b535";

//Volume to play close sound, 0.0 is same as no sound, 1.0 is max
float CloseVol = 1.0;


//misc variables
integer Open;
vector Pos;
rotation Rot;
rotation OffsetRot;

default
{
state_entry()
{
OffsetRot = llEuler2Rot(<0, 0, RotAmount * DEG_TO_RAD>);
}

on_rez(integer param)
{
llResetScript();
}

touch_start(integer total_number)
{
Open = !Open;
if(Open)
{
llSetTimerEvent(Timer);
Pos = llGetLocalPos();
Rot = llGetLocalRot();
if(OpenSound != "") llTriggerSound(OpenSound, OpenVol);
llSetLocalRot(OffsetRot * Rot);
}else{
llSetTimerEvent(0.0);
if(CloseSound != "") llTriggerSound(CloseSound, CloseVol);
llSetLocalRot(Rot);
llSetPos(Pos);
}
}

moving_end()
{
if(Open)
{
Open = 0;
llSetTimerEvent(0.0);
}
}

timer()
{
llSetTimerEvent(0.0);
Open = 0;
if(CloseSound != "") llTriggerSound(CloseSound, CloseVol);
llSetLocalRot(Rot);
llSetPos(Pos);
}
}
//--------------------------fin-script---------------------------------

ça marche aussi pour une porte, voilà
il s'agit de deux scripts, tu ne copies pas tout dans le même script sinon ça marche pas.

sinon pour une ouverture du bas vers le haut

//--------------------------début-script-ouverture-glissante-------------------------------
//Sliding Door v4
//Works when linked
//by Kayla Stonecutter

//How far in meters to travel in each direction. Two or all three can be used for angled movement
//NOTE: when linked, this is relative to the root prim
//Positive = move north, negative = move south
float NorthSouth = 0.0;
//Positive = move east, negative = move west
float EastWest = 0.0;
//Positive = move up, negative = move down
float UpDown = 1.0;

//The amount in seconds to stay open, set to 0 to not autoclose
float Timer = 15.0;

//Sound to play on open, either a UUID or a name in the door contents
//if a name, it must be exact. Leave at "" for no sound
string OpenSound = "cb340647-9680-dd5e-49c0-86edfa01b3ac";

//Volume to play open sound, 0.0 is same as no sound, 1.0 is max
float OpenVol = 1.0;

//Sound to play on close, either a UUID or a name in the door contents
//if a name, it must be exact. Leave at "" for no sound
string CloseSound = "e7ff1054-003d-d134-66be-207573f2b535";

//Volume to play close sound, 0.0 is same as no sound, 1.0 is max
float CloseVol = 1.0;


//misc variables
vector Pos;
vector Offset;
integer Open;
integer x;

default
{
state_entry()
{
Offset = <EastWest, NorthSouth, UpDown>;
}

touch_start(integer num)
{
for(x = 0; x < num; x++)
{
Open = !Open;
if(Open)
{
Pos = llGetLocalPos();
if(OpenSound != "") llTriggerSound(OpenSound, OpenVol);
llSetPos(Pos + Offset);
llSetTimerEvent(Timer);
}else{
if(CloseSound != "") llTriggerSound(CloseSound, CloseVol);
llSetPos(Pos);
llSetTimerEvent(0);
}
}
}

on_rez(integer param)
{
llResetScript();
}

moving_end()
{
if(Open)
{
Open = 0;
llSetTimerEvent(0.0);
}
}

timer()
{
if(CloseSound != "") llTriggerSound(CloseSound, CloseVol);
llSetPos(Pos);
llSetTimerEvent(0);
Open = 0;
}
}
//--------------------------fin-script---------------------------------
Répondre

Connectés sur ce fil

 
1 connecté (0 membre et 1 invité) Afficher la liste détaillée des connectés