script rideau

Répondre
Partager Rechercher
bonjour voici un script d ouverture de rideau mais le problème tout le monde peut l ouvrir il ne faudrait que ce soit le l avatar propriétaire qui puisse l ouvrir

un truc qui detecte l UUID je pense


vector offset = <0,0,1>; //Prim moves/changes size along this local coordinate
float hi_end_fixed = FALSE; //Which end of the prim should remain in place when size changes?
//The one with the higher (local) coordinate?
float min = 0.2; //The minimum size of the prim relative to its maximum size
integer ns = 10; //Number of distinct steps for move/size change


default {
state_entry() {
offset *= ((1.0 - min) / ns) * (offset * llGetScale());
hi_end_fixed -= 0.9;
}

touch_start(integer detected) {
integer i;
do llSetPrimitiveParams([PRIM_SIZE, llGetScale() - offset,
PRIM_POSITION, llGetLocalPos() + ((hi_end_fixed * offset) * llGetLocalRot())]);
while ((++i) < ns);
offset = - offset;
}
}
Voilà

vector offset = <0,0,1>; //Prim moves/changes size along this local coordinate
float hi_end_fixed = FALSE; //Which end of the prim should remain in place when size changes?
//The one with the higher (local) coordinate?
float min = 0.2; //The minimum size of the prim relative to its maximum size
integer ns = 10; //Number of distinct steps for move/size change


default {
state_entry() {
offset *= ((1.0 - min) / ns) * (offset * llGetScale());
hi_end_fixed -= 0.9;
}

touch_start(integer detected) {
if (llDetectedKey(0) == llGetOwner()){
integer i;
do llSetPrimitiveParams([PRIM_SIZE, llGetScale() - offset,
PRIM_POSITION, llGetLocalPos() + ((hi_end_fixed * offset) * llGetLocalRot())]);
while ((++i) < ns);
offset = - offset;
}
}
}



ça devrait marcher.
petit ajout rigolo si ton rideau est en prim....il flotte au gré d' une légère brise d' un automne naissant....(il faut évidement le rendre flex.)



vector axe_mvt = <0.0,1.0,0.0>;
float cote_fixe = TRUE; //change coté d'ouverture
float min = 0.2; //taille en % de la pos fermée
integer nb_etapes = 20;

ChangeIntervalleTimer()
{
llSetTimerEvent(llFrand(2.0) + 1.0);
}

vector Vent()
{
return <1, 0, 0> * llGetRot() * (llFrand(0.1));
}


default
{
state_entry()
{
axe_mvt *= ((1.0 - min) / nb_etapes) * (axe_mvt * llGetScale());
cote_fixe -= 0.5;
ChangeIntervalleTimer();
}

touch_start(integer detected)
{
if (llDetectedKey(0) == llGetOwner())
{
integer i;
do
{
llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_SIZE, llGetScale() - axe_mvt, PRIM_POSITION, llGetLocalPos() + ((cote_fixe* axe_mvt) * llGetLocalRot())]);

llSleep(0.02);
}

while ((++i) < nb_etapes);
axe_mvt = - axe_mvt;
}
}
timer()
{
list PrimParams = llGetPrimitiveParams([PRIM_FLEXIBLE]);

llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_FLEXIBLE] + llListReplaceList(PrimParams, [Vent()], 6, 6));

ChangeIntervalleTimer();
}
}
Citation :
Publié par MenthalOH
petit ajout rigolo si ton rideau est en prim....il flotte au gré d' une légère brise d' un automne naissant....(il faut évidement le rendre flex.)



vector axe_mvt = <0.0,1.0,0.0>;
float cote_fixe = TRUE; //change coté d'ouverture
float min = 0.2; //taille en % de la pos fermée
integer nb_etapes = 20;

ChangeIntervalleTimer()
{
llSetTimerEvent(llFrand(2.0) + 1.0);
}

vector Vent()
{
return <1, 0, 0> * llGetRot() * (llFrand(0.1));
}


default
{
state_entry()
{
axe_mvt *= ((1.0 - min) / nb_etapes) * (axe_mvt * llGetScale());
cote_fixe -= 0.5;
ChangeIntervalleTimer();
}

touch_start(integer detected)
{
if (llDetectedKey(0) == llGetOwner())
{
integer i;
do
{
llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_SIZE, llGetScale() - axe_mvt, PRIM_POSITION, llGetLocalPos() + ((cote_fixe* axe_mvt) * llGetLocalRot())]);

llSleep(0.02);
}

while ((++i) < nb_etapes);
axe_mvt = - axe_mvt;
}
}
timer()
{
list PrimParams = llGetPrimitiveParams([PRIM_FLEXIBLE]);

llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_FLEXIBLE] + llListReplaceList(PrimParams, [Vent()], 6, 6));

ChangeIntervalleTimer();
}
}
héhé super merci bien c est génial

Citation :
Publié par stefsparta
héhé super merci bien c est génial
par contre il ne vas plus de bas en haut mais de gauche droite la
l effet est super mais juste monter descendre stp

Dernière modification par stefsparta ; 10/11/2019 à 14h53. Motif: Auto-fusion
Peut être en tournant le prim de 90°?? ....sinon, tu perds le flex....sinon, mettre ça en 1ere ligne vector axe_mvt = <0.0,0.0,1.0>;

Dernière modification par MenthalOH ; 10/11/2019 à 16h44.
Citation :
Publié par MenthalOH
Peut être en tournant le prim de 90°?? ....sinon, tu perds le flex....sinon, mettre ça en 1ere ligne vector axe_mvt = <0.0,0.0,1.0>;
oui merci c est nickel
bonjour, j'aime bien l'idée aussi, mais comment faire pour le rendre accessible à tous ?...
Citation :
Publié par MenthalOH
petit ajout rigolo si ton rideau est en prim....il flotte au gré d' une légère brise d' un automne naissant....(il faut évidement le rendre flex.)



vector axe_mvt = <0.0,1.0,0.0>;
float cote_fixe = TRUE; //change coté d'ouverture
float min = 0.2; //taille en % de la pos fermée
integer nb_etapes = 20;

ChangeIntervalleTimer()
{
llSetTimerEvent(llFrand(2.0) + 1.0);
}

vector Vent()
{
return <1, 0, 0> * llGetRot() * (llFrand(0.1));
}


default
{
state_entry()
{
axe_mvt *= ((1.0 - min) / nb_etapes) * (axe_mvt * llGetScale());
cote_fixe -= 0.5;
ChangeIntervalleTimer();
}

touch_start(integer detected)
{
if (llDetectedKey(0) == llGetOwner())
{
integer i;
do
{
llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_SIZE, llGetScale() - axe_mvt, PRIM_POSITION, llGetLocalPos() + ((cote_fixe* axe_mvt) * llGetLocalRot())]);

llSleep(0.02);
}

while ((++i) < nb_etapes);
axe_mvt = - axe_mvt;
}
}
timer()
{
list PrimParams = llGetPrimitiveParams([PRIM_FLEXIBLE]);

llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_FLEXIBLE] + llListReplaceList(PrimParams, [Vent()], 6, 6));

ChangeIntervalleTimer();
}
}
Il faut simplement enlever la verif sur l' owner dans la section touch_start...



Code PHP:

touch_start(integer detected)
{
integer i;
do
{
llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_SIZEllGetScale() - axe_mvtPRIM_POSITIONllGetLocalPos() + ((cote_fixeaxe_mvt) * llGetLocalRot())]);

llSleep(0.02);
}

while ((++
i) < nb_etapes);
axe_mvt = - axe_mvt;

hellow....

dans le bouton...

Code PHP:

default
{
    
touch_start(integer total_number)
    {
        
llMessageLinked(LINK_ALL_OTHERS0,"yoplaboum""");
    }

[/php]



et dans le rideau...



Code PHP:

vector axe_mvt = <0.0,1.0,0.0>;
float cote_fixe TRUE//change coté d'ouverture
float min 0.2//taille en % de la pos fermée
integer nb_etapes 20;

ChangeIntervalleTimer()
{
llSetTimerEvent(llFrand(2.0) + 1.0);
}

vector Vent()
{
return <
100> * llGetRot() * (llFrand(0.1));
}


default
{
state_entry()
{
axe_mvt *= ((1.0 min) / nb_etapes) * (axe_mvt llGetScale());
cote_fixe -= 0.5;
ChangeIntervalleTimer();
}

link_message(integer sender_numinteger numstring msgkey id)
{
    if(
msg == "yoplaboum")
{
integer i;
do
{
llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_SIZEllGetScale() - axe_mvtPRIM_POSITIONllGetLocalPos() + ((cote_fixeaxe_mvt) * llGetLocalRot())]);

llSleep(0.02);
}

while ((++
i) < nb_etapes);
axe_mvt = - axe_mvt;
}
}

timer()
{
list 
PrimParams llGetPrimitiveParams([PRIM_FLEXIBLE]);

llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_FLEXIBLE] + llListReplaceList(PrimParams, [Vent()], 66));

ChangeIntervalleTimer();
}

Répondre

Connectés sur ce fil

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