Fall of edge of cliff.lsl 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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:1860
  10. // :REV:2
  11. // :WORLD:Opensim
  12. // :DESCRIPTION:
  13. // Sample collision script for NPC animator./ Makes the racoon run off the cliff edge
  14. // :CODE:
  15. // Rev: 2 fixes the Linux bug for collisions.
  16. integer debug = FALSE;
  17. DoIt()
  18. {
  19. // llOwnerSay("Racoon edge of cliff");
  20. llMessageLinked(1,0, "@say=Follow me down. I will wait for you there. ","");
  21. llMessageLinked(1,0, "@walk=<82.71397, 39.95649, 21.40128>","");
  22. llMessageLinked(1,0, "@walk=<81.58669, 46.91171, 21.47848>","");
  23. llMessageLinked(1,0, "@delete","");
  24. }
  25. Reset()
  26. {
  27. llSetStatus(STATUS_PHANTOM, FALSE);
  28. llVolumeDetect(FALSE);
  29. llSleep(0.1);
  30. llVolumeDetect(TRUE);
  31. }
  32. default
  33. {
  34. state_entry()
  35. {
  36. llSetText("",<1,1,1>,1.0);
  37. Reset();
  38. llSetTimerEvent(3600);
  39. }
  40. on_rez(integer p)
  41. {
  42. llResetScript();
  43. }
  44. collision_start(integer n) {
  45. if (! osIsNpc(llDetectedKey(0)))
  46. {
  47. if (debug) llOwnerSay("Collided with " + llKey2Name(llDetectedKey(0)));
  48. DoIt();
  49. }
  50. }
  51. timer()
  52. {
  53. Reset();
  54. llSetTimerEvent(3600);
  55. }
  56. changed(integer what)
  57. {
  58. if (what & CHANGED_REGION_START)
  59. {
  60. llResetScript();
  61. }
  62. }
  63. }