Advance to Edge.lsl 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // :SHOW:1
  2. // :CATEGORY:NPC
  3. // :NAME:Hypergrid Story Three
  4. // :AUTHOR:Ferd Frederix
  5. // :KEYWORDS:Game, NPC
  6. // :CREATED:2015-11-24 20:36:34
  7. // :EDITED:2015-11-24 19:36:34
  8. // :ID:1090
  9. // :NUM:1859
  10. // :REV:2
  11. // :WORLD:Opensim
  12. // :DESCRIPTION:
  13. // Sample collision script for NPC animator. Moves the raccoon to the edge of the cliff
  14. // :CODE:
  15. // Rev: 2 fixes the Linux bug for collisions.
  16. integer debug = FALSE;
  17. Reset()
  18. {
  19. llSetStatus(STATUS_PHANTOM, FALSE);
  20. llVolumeDetect(FALSE);
  21. llSleep(0.1);
  22. llVolumeDetect(TRUE);
  23. }
  24. DoIt()
  25. {
  26. if (debug) llOwnerSay("Racoon halfway");
  27. llMessageLinked(1,0, "@say=Follow me. The bear will not hurt me.","");
  28. llMessageLinked(1,0, "@walk=<88.10030, 74.18887, 38.53304>","");
  29. }
  30. default
  31. {
  32. state_entry()
  33. {
  34. llSetText("",<1,1,1>,1.0);
  35. Reset();
  36. llSetTimerEvent(3600);
  37. }
  38. collision_start(integer n) {
  39. if (! osIsNpc(llDetectedKey(0)))
  40. {
  41. if (debug) llOwnerSay("Collided with " + llKey2Name(llDetectedKey(0)));
  42. DoIt();
  43. }
  44. }
  45. on_rez(integer p)
  46. {
  47. llResetScript();
  48. }
  49. touch_start(integer p)
  50. {
  51. DoIt();
  52. }
  53. timer()
  54. {
  55. Reset();
  56. llSetTimerEvent(3600);
  57. }
  58. changed(integer what)
  59. {
  60. if (what & CHANGED_REGION_START)
  61. {
  62. llResetScript();
  63. }
  64. }
  65. }