LlWanderWithin debugging

From Second Life Wiki
Revision as of 11:24, 31 March 2012 by Hyper Mole (talk | contribs) (Created page with "<lsl> float speed = 2.0; float wanderRadius = 15.0; debugMsg(string msg) { //llOwnerSay(msg); //comment this line out to turn off debug messages } setup() { llDeleteCha…")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<lsl> float speed = 2.0; float wanderRadius = 15.0;

debugMsg(string msg) {

   //llOwnerSay(msg); //comment this line out to turn off debug messages

}

setup() {

   llDeleteCharacter();
   llResetScript();

}

doStuff() {

   llWanderWithin(llGetPos(), wanderRadius, []);

}

default {

   state_entry()
   {
       llCreateCharacter([CHARACTER_DESIRED_SPEED, speed, CHARACTER_ORIENTATION, VERTICAL, CHARACTER_RADIUS, 0.2, CHARACTER_LENGTH, 0.5]);
       doStuff(); //either replace this with your functionality or replace the function doStuff()
   }
  
   //touch_start(integer total_number)
   //{
   //    setup(); //comment this handler line out when done testing unless touch events desired
   //}
  
   on_rez(integer start_param)
   {    
       setup(); 
   }
  
   path_update(integer update, list none)
   {
       if (update == 0) //near goal
       {
           debugMsg("");
       }
       else if (update == 1) //goal reached
       {
           debugMsg("");
       }
       else //errors
       {
           debugMsg("");
       }
       llOwnerSay("Got a pathing failure " + (string)update);

llDie();

   }

} </lsl>