[Recherche] recherche script de positionement

Répondre
Partager Rechercher
Code PHP:

​

list boutons_pos = ["x+""y+""z+","x-","y-","z-","ROTATION""STOP","RESET"];

list 
boutons_rot = ["Rx+""Ry+""Rz+","Rx-","Ry-","Rz-","POSITION""STOP","RESET"];

list 
menu_princip = ["POSITION","ROTATION","STOP"];

string Info "Choisissez une option";

list 
order_buttons(list buttons)
{
    return 
llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4)
        + 
llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);
}

vector pos;

vector pos_init;

rotation rot;

rotation rot_init;

key ID;

integer canal;
integer handler;


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


    
state_entry()
    {
        
ID llGetOwner();
        
canal = (integer)("0xA" llGetSubString((string)ID0,));
        
pos_init llGetLocalPos();
        
rot_init llGetLocalRot();
    }

    
touch_start(integer num_detected)
    {
        
llListenRemove(handler);
        
handler llListen(canal"",ID"");
        
llDialog(IDInfoorder_buttons(menu_princip), canal);
        
llSetTimerEvent(30.0);
    }

    
listen(integer channelstring namekey idstring message)
    {
        
pos llGetLocalPos();
        
rot llGetLocalRot();
        
        if (
message == "STOP")
        {
            
llListenRemove(handler);
            
llSetTimerEvent(0.0);
        }
        else if(
message == "POSITION")
        {
          
llDialog(IDInfoorder_buttons(boutons_pos), canal); 
        }
        else if(
message == "ROTATION")
        {
          
llDialog(IDInfoorder_buttons(boutons_rot), canal); 
        }
        else if(
message == "RESET")
        {
          
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POS_LOCAL,pos_init]);
          
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_ROT_LOCAL,rot_init]);
          
llListenRemove(handler);
          
llSetTimerEvent(0.0);
        }
        
        else if(
message =="x+")
        {
          
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POSITION,pos+<0.01,0.0,0.0>]);
            
llDialog(IDInfoorder_buttons(boutons_pos), canal); 
        }
        else if(
message =="y+")
        {
          
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POS_LOCAL,pos+<0.0,0.01,0.0>]);
            
llDialog(IDInfoorder_buttons(boutons_pos), canal); 
        }
        else if(
message =="z+")
        {
          
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POS_LOCAL,pos+<0.0,0.0,0.01>]);
            
llDialog(IDInfoorder_buttons(boutons_pos), canal); 
        }
        else if(
message =="x-")
        {
          
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POS_LOCAL,pos-<0.01,0.0,0.0>]);
            
llDialog(IDInfoorder_buttons(boutons_pos), canal); 
        }
        else if(
message =="y-")
        {
          
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POS_LOCAL,pos-<0.0,0.01,0.0>]);
            
llDialog(IDInfoorder_buttons(boutons_pos), canal); 
        }
        else if(
message =="z-")
        {
          
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POS_LOCAL,pos-<0.0,0.0,0.01>]);
            
llDialog(IDInfoorder_buttons(boutons_pos), canal); 
        }
        
        else if(
message =="Rx+")
        {
          
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_ROT_LOCAL,rot*llEuler2Rot(<1.0,0.0,0.0>*DEG_TO_RAD)]);
            
llDialog(IDInfoorder_buttons(boutons_rot), canal); 
        }
        else if(
message =="Ry+")
        {
          
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_ROT_LOCAL,rot*llEuler2Rot(<0.0,1.0,0.0>*DEG_TO_RAD)]);
            
llDialog(IDInfoorder_buttons(boutons_rot), canal); 
        }
        else if(
message =="Rz+")
        {
          
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_ROT_LOCAL,rot*llEuler2Rot(<0.0,0.0,1.0>*DEG_TO_RAD)]);
            
llDialog(IDInfoorder_buttons(boutons_rot), canal); 
        }
        else if(
message =="Rx-")
        {
          
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_ROT_LOCAL,rot*llEuler2Rot(<-1.0,0.0,0.0>*DEG_TO_RAD)]);
            
llDialog(IDInfoorder_buttons(boutons_rot), canal); 
        }
        else if(
message =="Ry-")
        {
          
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_ROT_LOCAL,rot*llEuler2Rot(<0.0,-1.0,0.0>*DEG_TO_RAD)]);
            
llDialog(IDInfoorder_buttons(boutons_rot), canal); 
        }
        else if(
message =="Rz-")
        {
          
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_ROT_LOCAL,rot*llEuler2Rot(<0.0,0.0,-1.0>*DEG_TO_RAD)]);
            
llDialog(IDInfoorder_buttons(boutons_rot), canal); 
        }        
    }

    
timer()
    {
        
llSay(0,"Temps écoulé, veuillez recliquer...");
        
llListenRemove(handler);
        
llSetTimerEvent(0.0);
    }


//////////////////////////////////////////////////


Il faut verifier que le mesh est cliquable, sinon, rajouter un prim à cliquer....
merci je vérifie

dans SL j'ai une erreur lors de l'enregistrement du script (0,0):error :syntax error

il fallait suprimer la premiere ligne

Dernière modification par Loraine Curtau ; 20/04/2020 à 18h21. Motif: Auto-fusion
Répondre

Connectés sur ce fil

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