Advertisement
salahzar

script per righelli (cursore) per cannone

Feb 17th, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. float value;
  2. float MIN=5;
  3. float MAX=15;
  4.  
  5. display()
  6. {
  7.     llSetLinkPrimitiveParamsFast(2,[ PRIM_TEXT, llGetObjectName()+"\n"+(string)value+"\n("+(string)MIN+".."+(string)MAX, <1,1,1>,1 ]);
  8. transmit();
  9. }
  10. transmit()
  11. {
  12.     llSetColor(<0,1,0>,ALL_SIDES);
  13.     llWhisper(100,llGetObjectName()+" "+(string)value);
  14.     llSleep(0.1);
  15.     llSetColor(<1,1,1>,ALL_SIDES);
  16.  
  17. }
  18.  
  19. move(vector v)
  20. {
  21.         value=(MAX-MIN)*v.y+MIN;
  22.         float y=v.y - 0.5; // normalize on -0.5 + 0.5
  23.         vector scale=llGetScale();
  24.         float sz=scale.y*y; // normalize on y axi
  25.         vector new=<0,sz,0>;
  26.         // move accordingly the cursor
  27.         llSetLinkPrimitiveParamsFast(2,[ PRIM_POSITION, new ]);
  28.         display();
  29. }
  30.  
  31. default
  32. {
  33.     state_entry()
  34.     {
  35.         list l=llParseStringKeepNulls(llGetObjectDesc(),[".."],[]);
  36.         MIN=(float)llList2Float(l,0);
  37.         MAX=(float)llList2Float(l,1);
  38.         llSay(0, "Script running");
  39.         move(<0,0,0>);
  40.     }
  41.     touch_start(integer count)
  42.     {
  43.         integer link=llDetectedLinkNumber(0);
  44.         if(link==2)
  45.         {  
  46.             transmit();
  47.             return;
  48.         }
  49.         move(llDetectedTouchST(0));
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement