Advertisement
worstbull

Untitled

Dec 9th, 2013
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. float spin_rate = 0.20;
  2. float roll_rate = 0.00;
  3. float yaw_rate  = 0.00;
  4.  
  5. integer LOCAL_AXIS = TRUE;
  6.  
  7. string  CONTROLLER_ID = "A";
  8. integer AUTO_START = TRUE;
  9.  
  10. rotation adjustment = ZERO_ROTATION;
  11.  
  12. integer iStarted = FALSE;
  13.  
  14. randomllTargetOmega()
  15. {
  16.         spin_rate = llFrand(2.0) - 1.0;
  17.         roll_rate = llFrand(2.0) - 1.0;
  18.         yaw_rate  = llFrand(2.0) - 1.0;
  19.         if ( LOCAL_AXIS ) adjustment = llGetRot();
  20.  
  21.         llTargetOmega( <roll_rate, yaw_rate, spin_rate>*adjustment, 2.0, 2.0 );
  22. }
  23. default
  24. {
  25.     state_entry()
  26.     {
  27.         llSetTimerEvent(0.1);
  28.  
  29.         if ( LOCAL_AXIS ) adjustment = llGetRot();
  30.  
  31.         if ( AUTO_START )
  32.         {
  33.          iStarted = TRUE;
  34.         }
  35.  
  36.     }
  37.  
  38.     link_message( integer sibling, integer num, string mesg, key target_key )
  39.     {
  40.         if ( mesg != CONTROLLER_ID )
  41.         {
  42.             return;
  43.         }
  44.         else if ( num == 0 )
  45.         {
  46.             llTargetOmega( <0, 0, 0>, 1.0, 1.0 );
  47.             iStarted = FALSE;
  48.             llSetLocalRot( llGetLocalRot() );
  49.         }
  50.         else if ( num == 1 )
  51.         {
  52.             iStarted = TRUE;
  53.         }
  54.         else
  55.         {
  56.         }
  57.     }
  58.     timer()
  59.     {
  60.      if (iStarted)
  61.      {
  62.       randomllTargetOmega();
  63.      }
  64.     }
  65.        
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement