A script for realistic swing-set movement..
By Antonius Frentis. Copyright MiceOnABeam 2014.
- Works at ANY rotation. Can be linked or unlinked!
- CAN HANDLE MULTIPLE INDEPENDENT SWINGS ON THE SAME LINKSET!*
- No need for path cuts! Works with uncut prims, sculpts & mesh!
- Hinge position & swing are fully configurable;
- Can swing multi-prim swings even when linked!
- Start the swing by touch, seated avatar or both!
- Configurable pause at top of swing;
- Lock/Unlock the swing;
- Chat command interface to control swing;
- Optional sounds when swinging;
- Optional chat message on swing start;
- All easily configured via notecard also including speed, smoothness, command channel, & swing range;
* NOTE: Requires a sit target for each prim seat on the linkset.
SETUP *** PLEASE READ - VERY IMPORTANT ***
- Use the provided prim or create your own swing as follows:
1) Create a swing prim with length, width, height along the Y, X and Z axes respectively.
2) Copy/move the MOABUniversalSwing script along with the SwingOptions notecard to your prim's inventory.
3) Edit the notecard named SwingOptions 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 start, specify a negative value for the DEGREES option.
4) Position, resize & rotate your prim to it's desired starting position.
5) The prim may be unlinked, or linked as a child prim to a root prim which MUST be stationary.
6) A sit target MUST be specified for each prim seat on the swing linkset using llSitTarget(). Please edit/replace the
sample SetSitTarget script according to your needs.
7) Touch, sit on or send a command to the swing to start the swinging.
- For multi-prim builds the MOABUniversalSwing script MUST be placed in a prim adjacent
to the selected hinge side & it's linked component prims MUST each be set with the same
configured object name that is set for the MultiPrimName option. (See options).
- DO NOT change the names of any of the scripts or notecards!
- DO NOT change the position or rotation of the swing while it's swinging!
- In case of any difficulties, chat: /99 reset
(If you changed the CHANNEL option use that number instead.)
CONFIGURABLE OPTIONS (See the SwingOptions 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 starting 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.
- DEGREES: Enter the number of degrees the prim should swing open from the vertical. To reverse the
swing, specify a negative value here.
- TIME: Enter the time to take to move the prim for the full swing.
- RTIME: Select whether to automatically adjust TIME to compensate for lag.
- TIMEOUT: Enter the timeout for which to pause at each end of the swing.
- SMOOTH: Enter the smoothness factor for the swing movement.
- CHANNEL: Enter the chat channel for commands.
- START: Specify the trigger to start the swing
- MULTIPRIMNAME: Enter the common object name used for component prims on a multi-prim swing build.
- MESSAGE: Enter the message to chat on starting to swing.
- TITLE: Enter the message to display above the prim when swinging.
- OPENSOUND: Enter the sound to be played at one end of the swing.
- CLOSESOUND: Enter the sound to be played at the other end of the swing.
CHAT COMMAND LIST
Chat "/99 aCommand aParm".
(If you changed the command CHANNEL use that number instead.)
- reset: Resets the swing script;
- lock: Locks the swing in the idle position;
- unlock: Unlocks the swing;
- start: Starts the swing
- stop: Stops the swing
- version: Displays the version of the script;
- help: Displays the command list;