add_animations.lsl 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. // :CATEGORY:XS Pet
  2. // :NAME:XS Pet Robot
  3. // :AUTHOR:Ferd Frederix
  4. // :KEYWORDS: Pet,XS,breed,breedable,companion,Ozimal,Meeroo,Amaretto,critter,Fennux,Pets
  5. // :CREATED:2013-09-06
  6. // :EDITED:2014-03-22
  7. // :ID:988
  8. // :NUM:1604
  9. // :REV:0.50
  10. // :WORLD:Second Life, OpenSim
  11. // :DESCRIPTION:
  12. // XS Pet re-animator
  13. // :CODE:
  14. // add this script ( and modify it) to add custom animatons based on pre-exisitng animal effects.
  15. integer LINK_ANIMATE = 1; // messages on num 1 are assumed to be directed at the prim animator.
  16. /// This is a list of pre-defined pet functions that can be used to re-animate a pet
  17. integer DECREASE_FOOD = 100; // used in the food bowl.
  18. integer LINK_AGE_START = 800; // when pet is rezzed and secret_number is sent by brain to breeder, eater and infomatic get booted up
  19. integer LINK_TEXTURE = 801; // ask for a new texture, or paint a color
  20. integer LINK_BREEDNAME = 802; // the name of the pet texture from the texture server notecard
  21. integer LINK_FOOD_CONSUME = 900; // from movement to brain when close to food, brain then consumes a random amount up to 10000
  22. integer LINK_FOODMINUS = 901; // xs_brain receives FOOD_CONSUME, decrement hunger (eat)
  23. integer LINK_HUNGRY = 903; // sent by eater (string)hunger_amount, checks each hour
  24. integer LINK_HAMOUNT = 904; // hunger_amount = (integer)str,m updates the hunger amount in scripts
  25. integer LINK_SET_HOME = 910; // loc ^ dist
  26. integer LINK_MOVER = 911; // tell mover to rest for str seconds
  27. integer LINK_FOODIE_CLR = 920; // clear all food_bowl_keys and contents
  28. integer LINK_FOODIE = 921; // send FOOD_LOCATION coordinates to movement
  29. integer LINK_COLOR1 = 930; // colour1
  30. integer LINK_COLOR2 = 931; // colour2
  31. integer LINK_SEX = 932; // sex
  32. integer LINK_SHINE = 933; // shine
  33. integer LINK_GLOW = 934; // glow
  34. integer LINK_GEN = 935; // generation
  35. integer LINK_RESET_SIZE = 936; // reset size to 1
  36. integer LINK_MAGE = 940; // xs_brain sends, xs_ager consumes, adds str to age, if older than 7 days, will grow the animal
  37. integer LINK_DAYTIME = 941; // xs_ager consumes, starts a timer of 86,400 seconds in xs_ager
  38. integer LINK_GET_AGE = 942; // get age from xs_ager and sent it on channel 943
  39. integer LINK_PUT_AGE = 943; // print age from xs_ager
  40. integer LINK_PACKAGE = 950; // look for a cryo_crate
  41. integer LINK_SEEK_FEMALE = 960; // MALE_BREED_CALL
  42. integer LINK_MALE_BREED_CALL = 961; // triggered by LINK_SEEK_FEMALE
  43. integer LINK_SIGNAL_ELIGIBLE = 962; // sent by female when hears LINK_MALE_BREED_CALL
  44. integer LINK_FEMALE_ELIGIBLE = 963; // sent when it hears in chat FEMALE_ELIGIBLE
  45. integer LINK_CALL_MALE = 964; // if LINK_FEMALE_ELIGIBLE && looking_for_female
  46. integer LINK_MALE_ON_THE_WAY = 965; // triggered by LINK_CALL_MALE
  47. integer LINK_FEMALE_LOCATION = 966; // female location, sends coordinates of a female
  48. integer LINK_RQST_BREED = 967; // sent when close enough to male/female
  49. integer LINK_CALL_MALE_INFO = 968; // sent by xs_breeding, this line of code was in error in v.24 of xs_breeding see line 557 and 636 of xs_brain which make calls and also xs_breeding which receives LINK_MALE_INFO.
  50. integer LINK_MALE_INFO = 969; // Breeding failed, sent info
  51. integer LINK_LAY_EGG = 970; // Rez Object(Egg...
  52. integer LINK_BREED_FAIL = 971; // key = father, failed, timed out
  53. integer LINK_PREGNANT = 972; // chick is preggers
  54. integer LINK_SOUND_OFF= 974; // sound is off
  55. integer LINK_SOUND_ON= 973; // sound is on
  56. integer LINK_SLEEPING = 990; // close eyes
  57. integer LINK_UNSLEEPING = 991; // open eyes
  58. integer LINK_SOUND = 1001; // plays a sound if enabled
  59. integer LINK_SPECIAL = 1010; // xs_special, if str = "Normal", removes script
  60. integer LINK_EFFECTS_ON = 2000; // particle effects in the packager
  61. integer LINK_PREGNANCY_TIME = 5000; // in seconds as str
  62. integer LINK_SLEEP = 7999; // disable sleep by parameter
  63. integer LINK_TIMER = 8000; // scan for food bowl about every 1800 seconds
  64. integer LINK_DIE = 9999; // death
  65. string Copyright = " (c)2014 by Ferd Frederix"; // You cannot change this line, but you can change the code that prints it!
  66. // See License agreements above.
  67. // Attribution is required, as these files are copyrighted.
  68. animate(string str)
  69. {
  70. llMessageLinked(LINK_SET,LINK_ANIMATE, str, "");
  71. }
  72. default
  73. {
  74. link_message(integer sender_number, integer number, string message, key id)
  75. {
  76. if (number == LINK_ANIMATE)
  77. return; // ignore animations that are already in the pet code
  78. if (number == LINK_LAY_EGG)
  79. animate("givebirth"); // this plays the animation named "givebirth" when a pet lays an egg
  80. else if (number == LINK_FOODMINUS)
  81. animate("eatfood"); // this plays the animation named "eatfood" when a pet eats the food
  82. else if (number == LINK_PREGNANT)
  83. animate("havesex"); // this plays the animation named "havesex" when a female gets laid
  84. // and so on and on
  85. }
  86. }