MOAB Universal

Modified: 12/8/2016 5:34 PM
Recently changed articles You can subscribe to this wiki article using an RSS feed reader.

MOAB Universal Rotator

A script to swing any uncut, rotated prim on any side.
By Antonius Frentis. Copyright MiceOnABeam 2014-2016.
PERMISSIONS: Copy/Transfer
LICENSE:
You may not resell the MOABUniversalRotator script by itself; it may only be resold as part of another product with the MOABUniversalRotator script's Next Owner Transfer permission disabled & with a product price greater than $L199.

FEATURES
- Works at ANY rotation. Can be linked or unlinked!
- NO NEED FOR PATH CUTS! WORKS WITH UNCUT PRIMS, SCULPTS & MESH!
- Hinge position & swing are fully configurable;
- Can rotate multi-prim builds!
- Automatic close after configurable timeout;
- Lock/Unlock the prim in the closed or opened position;
- Chat or link message command interface to control prim;
- Synchronize the movement of multiple prims;
- Optional sounds on open & close at start & end of movement;
- Optional chat message on swing open;
- Access can be optionally limited to owner only;
- Disable all error or status messages;
- All easily configured via notecard also including speed, smoothness, command channel, & swing range;
- Options now also be configured on-the-fly via link message!
- Sequential rotations using link messages!
- Save & restore prim's position!
- *NEW* Optional looping of opening & closing sounds for duration of the rotation!

SETUP ***VERY IMPORTANT***
- Use the provided cube prim or create your own swinging/rotating prim as follows:

1) Create a cube prim with length, width, height along the Y, X and Z axes respectively.
   
2) Copy/move the MOABUniversalRotator script along with the RotatorOptions notecard to your prim's inventory.

3) Edit the notecard named RotatorOptions in your prim's inventory setting the values of the various options.
     As specified by the XHINGE, YHINGE & ZHINGE options, the prim will swing/rotate from the center of one of the
     following sides: Left, Center, Right, Front, Back, Top or Bottom or from any of the cube edges.

     As specified by the AXIS option, the prim will swing clockwise around one of the following local axes:
     X Axis, Y Axis or Z Axis. To reverse the swing, specify a negative value for the DEGREES option.

4) Position, resize & rotate your prim to it's desired closed position.

5) The prim may be unlinked, or linked as a child prim to a root prim which MUST be stationary.

6) Touch the prim or send it a command to swing/rotate open or close.

  Multi-Prim Builds
  - For multi-prim builds the MOABUniversalRotator script must be placed in a prim adjacent
     to the selected hinge side & each of it's linked component prims must have its object name
     set to one of the names set in the MultiPrimName option.
     
  *NOTES*
  - DO NOT change the names of any of the scripts or notecards!
  - In case of any difficulties,  chat: /99 reset
    (If you changed the CHANNEL option use that number instead.)

CONFIGURABLE OPTIONS (See the RotatorOptions notecard for full details.)
- XHINGE,YHINGE,ZHINGE:   Select the side or edge on which the prim will swing/rotate:
                              One of: Left, Center, Right, Front, Back, Top or Bottom sides or their edges.
- AXIS:                  Select the local axis around which to swing/rotate. One of: X Axis, Y Axis or Z Axis.
                              To reverse the swing, specify a negative value for the DEGREES option.
- OFFSET:             Optionally enter a percentage OFFSET of the distance from the hinge point to the prim center to create a pivot swing.
                              By specifying an offset here you can have the prim swing/rotate at a
                              position offset from it's hinge position, thereby creating a pivot hinge or pivot door.
- DEGREES:          Enter the number of degrees the prim should swing open. To reverse the swing, specify a
                              negative value here.
- TIME:                  Enter the time to take to move the prim to the opened/closed position.
- RTIME:               Select whether to automatically adjust TIME to compensate for lag.
- TIMEOUT:          Enter the timeout after which to automatically close the prim.
- SMOOTH:         Enter the smoothness factor for the swing movement.
- CHANNEL:         Enter the chat channel for commands. Enter a negative channel to synchronize the movement
                              of all swinging prims with that channel (& disable commands by user).
- CMDLINKMSG:    Enter a non-zero integer id to validate commands received via link message. Commands will only be
                           recognized from a prim with the same owner. This value should be assigned to the integer parameter
                           of the llMessageLinked call. The command should be sent in the string parameter.
- MULTIPRIMNAME:   Enter a list of object names, separated by commas, for component prims on a multi-prim build.
- MESSAGE:        Enter the message to chat on opening the prim.
- TITLE:                  Enter the message to display above the prim on opening.
- OPENSOUND:   Enter the sound to be played before opening the prim.
- OPENSOUNDEND:   Enter the sound to be played after opening the prim.
- CLOSESOUND: Enter the sound to be played before closing the prim.
- CLOSESOUNDEND: Enter the sound to be played after closing the prim.
- NOMSG:          Enter 1 to disable all error or status messages. Otherwise leave blank. Note that this will not affect the TITLE or MESSAGE options.
- OWNERONLY:    Enter 1 to only permit the owner of the prim to open/close it. Otherwise leave blank.
- SILENTCMD:     Enter 1 to silence any sounds when prim open/closed via chat or link message command.
- LOOPSOUND:   Enter 1 for OPENSOUND and CLOSESOUND to be looped till completion of slide. Otherwise leave blank.

ON-THE-FLY CONFIGURATION VIA LINK MESSAGE
One or more options can be reconfigured on-the-fly by sending a link message to the script. Each option must be a string exactly as defined in the RotatorOptions notecard. One or more of these option strings, separated by ampersands, can be sent as follows:      llMessageLinked(Link_Designation,CMDLINKMSG,"option1=value1&option2=value2",NULL_KEY)
where CMDLINKMSG has been previously configured via the notecard.

*NOTE* On-The-Fly Configuration is not permanent. Any configuration changes made through this feature will be reset to the values specified in the RotatorOptions notecard on any event which results in a reset of the script, including changed links, changed inventory or a "reset" command.

SEQUENTIAL ROTATIONS USING LINK MESSAGES
You can send multiple "open" and "close" commands via link messages to the script in any order! In conjunction with On-The-Fly Configuration, this means you can rotate the prim incrementally in the same direction, and then switch direction. As well, at any time you can send the following two commands via link message:
- save:         Save the current position of the prim. The prim can be restored to this position at a later time through the "softreset" command.
- softreset:   Set the prim to its initial position. By default this is the position saved when the script was last reset, or, the position saved at the last "save" command.

COMMAND LIST
 Chat "/99 aCommand"  (If you changed the command CHANNEL use that number instead.)
 OR:  llMessageLinked(Link_Designation,CMDLINKMSG,"aCommand",NULL_KEY)
- reset:      Resets the rotator script, including re-setting the options to the values specified in the RotatorOptions notecard.
- lock:        Locks the prim in it's current position;
- unlock:   Unlocks the prim;
- open:      Swings the prim to the opened position;
- close:     Swings the prim to the closed position;
- version:  Displays the version of the script;
- help:       Displays the command list;

Tags:
Home: MOAB Universal Copyright © 2010-2018 MiceOnABeam Software