Guest User

Untitled

a guest
Apr 18th, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ~run
  2.  
  3. //MLP MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License)
  4. //To donate, go to my profile (Search - People - Miffy Fluffy) and use the "Pay..." button, thanks!
  5. //You can also find the link to the latest version here.
  6.  
  7. // DESCRIPTION OF THE SCRIPTS
  8. //
  9. // ~run:
  10. //  Default: sets other scripts to not running.
  11. //  When the object is touched it will start all scrips.
  12. //
  13. // ~memory:
  14. //  Here the positions are stored permanently. Information is still kept when the script is
  15. //  not running or when everything is placed in inventory. The information will be lost only
  16. //  when the ~memory script is reset.
  17. //  A backup can be made on the .POSITIONS notecard, when the memory is empty, it will start
  18. //  reading the .POSITIONS notecard automatically.
  19. //
  20. // ~menu:
  21. //  1.loading: reads the .MENUITEMS notecard and builds the menu.
  22. //    When it reads a "POSE": - the animations are stored in ~pose
  23. //                            - their matching positions are looked up in ~memory and stored
  24. //                              in ~pos.
  25. //  2.ready:
  26. //    When the object is touched: - shows the main menu
  27. //                                - listens for menu selections.
  28. //
  29. //    When a submenu is selected: - shows the submenu
  30. //                                - when balls are defined for this submenu it will rez
  31. //                                  balls (if not already there) and set their colors.
  32. //
  33. //    When a pose is selected:  - ~pose will send the animations to ~pose1 and ~pose2,
  34. //                                 they will set the animations to the avatars
  35. //                              - ~pos wil send the matching positions to each ball.
  36. //
  37. //    When a position is saved: - ~pose will ask the balls for their position
  38. //                              -  the positions are saved in ~memory ("permanent")
  39. //                              -  the positions are updated in ~pos
  40. //                                  
  41. //    When "STOP" is selected:  - will hide the balls
  42. //                              - will stop the pose
  43. //                              When "STOP" is selected again (or if no pose is started yet):
  44. //                              - will remove the balls (derez/die)
  45. //
  46. // ~pos:
  47. //  - loads the positions from ~memory and stores them (until shutdown/restart)
  48. //  - sends positions for the selected pose to the balls
  49. //
  50. // ~pose:
  51. //  - loads the animations from the .MENUITEMS notecard and stores them (until shutdown/restart)
  52. //  - sends animations for the selected pose to ~pose1 and ~pose2
  53. //  - when saving a position: will ask balls for their position and sends it to ~pos and ~memory
  54. //    (~pos would be a more logical place to handle this, but ~pose has more free memory).
  55. //
  56. // ~pose1 & pose2:
  57. //  - will ask permission to animate the avatar on ball 1&2
  58. //  - will set the animations to avatar 1&2
  59. //
  60. // ~ball
  61. //  - when balls are defined for a submenu (in .MENUITEMS), ~menu will rez two copies of ~ball
  62. //  - ball 1&2 will receive a unique communication channel from ~menu
  63. //  - the color for ball 1&2 is set by ~menu
  64. //  - the position of ball 1&2 is set by ~pos
  65. //  - when an avatar selects to sit on a ball, the avatar info is sent to ~pose1 or ~pose2, they
  66. //    will ask permission and set the animation directly to the avatar (not via the ball)
  67. //  - balls will commit suicide when they don't hear a "LIVE" message each minute (from ~menu).
  68. //
  69. // have fun!
  70.  
  71. //Note: if you make a revised version, please mention something like this:
  72. //"MLP - alternative version by ... .... - Revision 1 (based on MLP V1.2 by Miffy Fluffy)
  73.  
  74. setRunning(integer st) {
  75.     llSetScriptState("~menu", st);
  76.     llSetScriptState("~pos", st);
  77.     llSetScriptState("~pose", st);
  78.     llSetScriptState("~pose1", st);
  79.     llSetScriptState("~pose2", st);
  80.     llResetOtherScript("~menu");
  81.     llSetScriptState("~memory", TRUE);
  82. }
  83. default {
  84.     state_entry() {
  85.         llOwnerSay("OFF (touch to switch on)");
  86.         setRunning(FALSE);
  87.     }
  88.     touch_start(integer i) {
  89.        if (llDetectedKey(0) == llGetOwner()) state run;
  90.     }  
  91.    
  92.     // Waits for another script to send a link message.
  93.     link_message(integer sender_num, integer num, string str, key id)
  94.     {
  95.         if (str == "PRIMTOUCH"){
  96.           if (id == llGetOwner()){
  97.             state run;
  98.           }
  99.         }
  100.     }
  101.  
  102. }
  103. state run {
  104.     state_entry() {
  105.         llOwnerSay("MULTI-LOVE-POSE (version 1.2)");
  106.         setRunning(TRUE);
  107.     }
  108. }
Add Comment
Please, Sign In to add comment