waving flag.lsl 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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-01-30 12:24:20
  7. // :ID:988
  8. // :NUM:1519
  9. // :REV:0.50
  10. // :WORLD:Second Life, OpenSim
  11. // :DESCRIPTION:
  12. // XS Pet xs_home waving flag script
  13. // :CODE:
  14. ////////////////////////////////////////////////////////////////////
  15. // This code is licensed as Creative Commons Attribution/NonCommercial/Share Alike
  16. // See http://creativecommons.org/licenses/by-nc-sa/3.0/
  17. // Noncommercial -- You may not use this work for commercial purposes
  18. // If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.
  19. // This means that you cannot sell this code but you may share this code.
  20. // You must attribute authorship to me and leave this notice intact.
  21. //
  22. // Exception: I am allowing this script to be sold inside an original build.
  23. // You are not selling the script, you are selling the build.
  24. // Ferd Frederix
  25. // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  26. //* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  27. //* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
  28. // in the documentationand/or other materials provided with the distribution.
  29. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  30. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
  31. // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  32. // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  33. // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  34. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  35. ////////////////////////////////////////////////////////////////////
  36. // Put any texture converted by gif_2_SL_animation_v0.6.exe into a prim with this script to get it to play back automatically as a movie
  37. integer animOn = TRUE; //Set to FALSE and call initAnim() again to stop the animation.
  38. list effects = [LOOP]; // LOOP for GIF89 movies
  39. integer movement = 0;
  40. integer face = ALL_SIDES; //Number representing the side to activate the animation on.
  41. integer sideX = 1; //Represents how many horizontal images (frames) are contained in your texture.
  42. integer sideY = 1; //Same as sideX, except represents vertical images (frames).
  43. float start = 0.0; //Frame to start animation on. (0 to start at the first frame of the texture)
  44. float length = 0.0; //Number of frames to animate, set to 0 to animate all frames.
  45. float speed = 10.0; //Frames per second to play.
  46. fetch()
  47. {
  48. string texture = llGetInventoryName(INVENTORY_TEXTURE,0);
  49. list data = llParseString2List(texture,[";"],[]);
  50. string X = llList2String(data,1);
  51. string Y = llList2String(data,2);
  52. string Z = llList2String(data,3);
  53. sideX = (integer) X;
  54. sideY = (integer) Y;
  55. speed = (float) Z;
  56. float tot = (float) (sideX * sideY);
  57. llSetTextureAnim(ANIM_ON|LOOP,ALL_SIDES,sideX,sideY,start,length,speed);
  58. llSetTexture(texture,ALL_SIDES);
  59. }
  60. default
  61. {
  62. state_entry()
  63. {
  64. fetch();
  65. }
  66. }