Alors voila le script de base :
// basic piston
// +/- 1 metre in cm steps
// assumes z axis only
//
// change for steps for shorter transition
// change llSetPos increment to make bigger steps
// can add touch on/off as required
// open source - have fun ! sirhcdesantis
// vars
vector where_we_are;
integer t;
integer running; // otherwise we run once
default
{
state_entry()
{
running = 1; // this forces it to run all the time
// loop starts here
while( running == 1 )
{
// lets go up
for( t = 0 ; t < .1 ; t ++ ) // 100 step counter
{
where_we_are = llGetPos(); // where we are (we might have moved)
llSetPos( <where_we_are.x, where_we_are.y, where_we_are.z + .5> ); // adds 1 cm to our z axis location
}
// and lets go down
for( t = 0 ; t < .1 ; t ++ )
{
where_we_are = llGetPos();
llSetPos( <where_we_are.x, where_we_are.y, where_we_are.z - .5> );
}
}
}
}
Et voila ce que m'a fait un ami. Le probleme c'est que le prim suis bien le mouvement du bras en va et viens, mais il ne marche que quand on a ouvert le script pour le modifier. quand on le referme le prim ne bouge plus. tres étrange. Et je ne sais si on peut lier ce prim a un autre fixe. Voila le script que m'a fait mon ami PaPajah Decuir.
//script qui fait bouger un attachement sur l'axe Y
vector local_position;
integer i=1;
float amplitude=0.2;
default
{
state_entry()
{
//boucle infinie
do
{ //monte de amplitude
local_position = llGetLocalPos();//prend la position en cours
llSetPos( <local_position.x,local_position.y+ amplitude,local_position.z>); //bouge de amplitude sur axe Y
llSleep(1); //attends 1 sec
//descends de amplitude
local_position = llGetLocalPos();//prend la position en cours
llSetPos( <local_position.x,local_position.y- amplitude,local_position.z>);//bouge de amplitude sur axe Y
llSleep(1); //attends 1 sec
}
while(i==1);
}
}
Voila ! Merci encore pour ta réponse aussi rapide. c'est vraiment gentil.
|