script hide/show-par telecommande

Répondre
Partager Rechercher
bonjour
possible que ce script réponde a une commande style bouton poser dans une régie


//This is the command used to make the object show itself. You can change it to what ever you like.
string sCommand = "show";

//This is the command used to make the obnject hide itself. You can change it to what ever you like.
string hCommand = "hide";

//This is the channel which the object will listen to. It is set to channel 9 so to make it work you will say '/9' then the command.
integer chan = 9;

//this is the time that the object will display itself for before it automatically hides itself, it is set to 0 so you will se the box when you rez it.
integer time = 0;

//This script automatically turns the object to phantom, If you wish it to be solid then change this value to FALSE.
integer switch = TRUE;

//---------------------------------------------------------------------

default
{
state_entry()
{
llListen(chan,"",NULL_KEY,"");
llSetStatus(STATUS_PHANTOM,switch);
llSetTimerEvent(time);
}

listen(integer channel, string name, key id, string msg)
{
if (msg == sCommand)
{
llSetAlpha(1,ALL_SIDES);
llSetTimerEvent(time);

}

if (msg == hCommand)
{
llSetAlpha(0,ALL_SIDES);
}
}
timer()
{
llSetAlpha(0,ALL_SIDES);
}
on_rez(integer start_param)
{
llResetScript();
}


}
hellow.....
dans le bouton...


default
{
touch_start(integer total_number)
{
llSay(-99999, "onoff");
}
}



et dans l' objet....


integer chan = -99999;
integer shown = TRUE;

float time = 0.0;//rend l' objet transparent ....0.0 laisse objet visible

//---------------------------------------------------------------------

default
{
on_rez(integer start_param)
{
llResetScript();
}

state_entry()
{
shown = TRUE;
llListen(chan,"",NULL_KEY,"onoff");
llSetStatus(STATUS_PHANTOM,TRUE);//mettre FALSE si objet non phantom
llSetAlpha((float)shown,ALL_SIDES);
llSetTimerEvent(time);
}

listen(integer channel, string name, key id, string msg)
{
if (shown)
{
shown = FALSE;
llSetAlpha((float)shown,ALL_SIDES);
}

else
{
shown = TRUE;
llSetAlpha((float)shown,ALL_SIDES);
llSetTimerEvent(time);
}

}
timer()
{
shown = FALSE;
llSetTimerEvent(0.0);
llSetAlpha((float)shown,ALL_SIDES);
}
}
Citation :
Publié par MenthalOH
hellow.....
dans le bouton...


default
{
touch_start(integer total_number)
{
llSay(-99999, "onoff");
}
}



et dans l' objet....


integer chan = -99999;
integer shown = TRUE;

float time = 0.0;//rend l' objet transparent ....0.0 laisse objet visible

//---------------------------------------------------------------------

default
{
on_rez(integer start_param)
{
llResetScript();
}

state_entry()
{
shown = TRUE;
llListen(chan,"",NULL_KEY,"onoff");
llSetStatus(STATUS_PHANTOM,TRUE);//mettre FALSE si objet non phantom
llSetAlpha((float)shown,ALL_SIDES);
llSetTimerEvent(time);
}

listen(integer channel, string name, key id, string msg)
{
if (shown)
{
shown = FALSE;
llSetAlpha((float)shown,ALL_SIDES);
}

else
{
shown = TRUE;
llSetAlpha((float)shown,ALL_SIDES);
llSetTimerEvent(time);
}

}
timer()
{
shown = FALSE;
llSetTimerEvent(0.0);
llSetAlpha((float)shown,ALL_SIDES);
}
}
merci bien je suppose que si je change le chan je peux poser plusieur bouton
Citation :
Publié par stefsparta
merci bien je suppose que si je change le chan je peux poser plusieur bouton
hello

c est impec meme principe de pouton
pour ceci c est pour retracter une scene merci

//When touched the prim is retracted towards one end and when touched again stretched back out.
//
//Prim moves/changes size along the local coordinate specified in the offset vector below.
//
//To change the overall size, edit the prim when stretched out and reset the script when done.
//
//The script works both in unlinked and linked prims.
//
// Copyright (C) 2008 Zilla Larsson
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 3, as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>


vector offset = <1,0,0>; //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;
}
}
dans le bouton....

default
{
touch_start(integer total_number)
{
llSay(-888888, "bouge");
}
}





dans l' objet.....


integer chan = -888888;

vector offset = <1,0,0>; //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
{
on_rez(integer start_param)
{
llResetScript();
}

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

llListen(chan,"",NULL_KEY,"bouge");
}

listen(integer channel, string name, key id, string msg)
{
integer i;
do
llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_SIZE, llGetScale() - offset,
PRIM_POSITION, llGetLocalPos() + ((hi_end_fixed * offset) * llGetLocalRot())]);
while ((++i) < ns);
offset = - offset;
}
}
Citation :
Publié par MenthalOH
dans le bouton....

default
{
touch_start(integer total_number)
{
llSay(-888888, "bouge");
}
}





dans l' objet.....


integer chan = -888888;

vector offset = <1,0,0>; //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
{
on_rez(integer start_param)
{
llResetScript();
}

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

llListen(chan,"",NULL_KEY,"bouge");
}

listen(integer channel, string name, key id, string msg)
{
integer i;
do
llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_SIZE, llGetScale() - offset,
PRIM_POSITION, llGetLocalPos() + ((hi_end_fixed * offset) * llGetLocalRot())]);
while ((++i) < ns);
offset = - offset;
}
}
merci bien ^^
Citation :
Publié par MenthalOH
dans le bouton....

default
{
touch_start(integer total_number)
{
llSay(-888888, "bouge");
}
}





dans l' objet.....


integer chan = -888888;

vector offset = <1,0,0>; //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
{
on_rez(integer start_param)
{
llResetScript();
}

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

llListen(chan,"",NULL_KEY,"bouge");
}

listen(integer channel, string name, key id, string msg)
{
integer i;
do
llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_SIZE, llGetScale() - offset,
PRIM_POSITION, llGetLocalPos() + ((hi_end_fixed * offset) * llGetLocalRot())]);
while ((++i) < ns);
offset = - offset;
}
}
ok marche bien par contre c super rapide
je ne sais pas ou on peut temporiser pour que ca arrive doucement pour un effet plus visuel et jolie
Citation :
Publié par stefsparta
ok marche bien par contre c super rapide
je ne sais pas ou on peut temporiser pour que ca arrive doucement pour un effet plus visuel et jolie
là....


do
{
llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_SIZE, llGetScale() - offset,
PRIM_POSITION, llGetLocalPos() + ((hi_end_fixed * offset) * llGetLocalRot())]);
llSleep(0.1);////tester qlq valeurs ici, ça met un petit repos entre chaque etape....
}
while ((++i) < ns);
Citation :
Publié par MenthalOH
là....


do
{
llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_SIZE, llGetScale() - offset,
PRIM_POSITION, llGetLocalPos() + ((hi_end_fixed * offset) * llGetLocalRot())]);
llSleep(0.1);////tester qlq valeurs ici, ça met un petit repos entre chaque etape....
}
while ((++i) < ns);
merci j essaye ca demain

^^
Répondre

Connectés sur ce fil

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