Linden text version 2
{
LLEmbeddedItems version 1
{
count 0
}
Text length 6929
PARAMOUR LINE-DANCE CONTROLLER v1.0
by Aine Caoimhe / Mata Hari  - November 2014

Provided under Creative Commons Attribution-Non-Commercial-ShareAlike 4.0 International license.
Please be sure you read and adhere to the terms of this license: https://creativecommons.org/licenses/by-nc-sa/4.0/

The country line dance set included in this product is not of my own creation but was obtained under CC3.0.
NPC notecards included in the OSG/Metro edition are courtesy the very generous Dorothea Lundquist


* * * OVERVIEW * * *

The Paramour Line-Dance Controller is another in the series of extremely high efficiency scripts I've released that are suitable for dance clubs with very high traffic. The single OSSL-based script can easily handle as many dancers as you can comfortably handle in your region (I've tested it successfully with 100 total dancers).

Dancers are arranged in rows, with equal spacing between each dancer, all playing the identical dance animation. A "country line dance" set of 11 animations is included with the product but you can easily replace these with any other dance animations you want. The dance floor cycles through the available animations, and people can join or leave the dance at any time.

If you want to increase your numbers to make it look like a "real" line dance, the owner can add and remove NPC dancers at any time during use (the picture on the box is me dancing with 24 of my NPC friends :p)


* * * GETTING STARTED * * *

To be able to flexibly handle a huge number of dancers with a single script requires the used of the OSSL function set so OSSL must be enabled for the script owner in the region. To allow NPC dancers, you'll also need to enable NPCs and their associated OSSL functions. Details on how to do this are in this first post of this thread:  http://forums.osgrid.org/viewtopic.php?f=5&t=4989

Simply rez the dance floor to the ground, sit on it, and off you go!

The owner can touch the dance floor at any time (even if not using it) to bring up the owner-only menu which can be used to set the dance timer (how often to advance to the next dance). The timing on the set of country line dances included in the product varies very slightly but seems to transition quite well using the default 28-second timer setting. If you use different dances in the floor you can change to any of the other time settings.

The owner-only menu also allows you to "ADD" or "KILL" NPC dancers which are rezzed randomly based on the notecards found in inventory.


* * * POSITIONING THE DANCERS * * *

VERTICAL

The script uses a calculation based on avatar size to attempt to position everyone correctly (vertically) to dance on the floor based on a common sit target offset. Adjusting this offset value in the script will move all dancers up and down (there is no ability to adjust dancer vertical position individually). In my own testing, I actually found it easier to leave the script set to the default sit target position and do the following:

- get a few dancers onto the floor, using it (rez some NPCs or invite a few friends over).

- right-click on the floor to edit it. You'll see that the root prim is a tiny invisible box suspended a few meters above the center of the child-prim dance floor.

- In edit mode, using arrow handles and dragging moves the entire linkset (including the dancers!) up and down. Adjust this until everyone's feet are high enough to be above the terrain.

- Now check the "edit linked" box and select just the floor. You can now raise and lower it without moving any of the dancers, positioning it as you like under them. Remember to un-check the "edit linked" box if you need to move the root prim and dancers again.

All dancer positions are based on the location of the root prim so it will "remember" this new configuration.

HORIZONAL

The positioning of the lines is set by variables in the top of script. Set these values to control how many dancers should be in each line, the spacing (side to side) between each dancer, and the spacing (front to back) between lines.

When people begin to use the dance floor the first user is placed directly under the root prim. As more dancers join they are positioned alternately on either side of this "home" position until the line is filled. The next line will be placed immediately behind the first row, and if a third line is added it will go in front of the original line. Again, this procedure alternates back-then-front as more and more lines are added. If someone stops dancing, everyone else is rearranged to accommodate this, closing the gap in the line. There is no limit to the number of lines you can have other than your region's capacity to handle that many agents (which should be quite high since they're sitting and therefore not physical...I've tested it with 100 NPC dancers without any trouble at all).


* * * ADDITIONAL NOTES * * *

You'll notice that any time a new dancer is added to the line it is necessary to advance to the next dance in the list because this is the only quick way to get everyone synchronized (I could just resynch but the effect would be the same and it's fractionally more efficient to do it with a dance advance instead).

The NPCs included in the product are for OSGrid and Metro where I know that the asset server contains the data needed to display them correctly. In other grids they will likely be missing textures and/or sculpty shapes so you'll need to make your own (grab a copy of the easy NPC maker script from my shop or from the thread I linked above).

If you add or remove animations you'll need to reset the script to pick up the change.

Adding/removing NPC notecards can be done at any time without requiring a script reset.

The dance floor is an ultra-basic single prim hardwood floor with full perms. Feel free to change or add to it (size, shape, texture, additional prims). Just make sure that the small invisible cube that contains the script remains the root prim of the linkset. Try to avoid making it into a massive linkset since it can impair performance (if you want to add a lot of fancy surrounding stuff just make that a separate linkset). Make sure there's something large and easy for your users to "sit" on to start dancing.


* * * KNOWN BUGS * * *

None. I take great care to release as bug-free a product as I possibly can.

This script uses the llSetPrimitiveParamsFast function which was broken (for avatars) until Opensim 0.8.0 so this product will not work if you're still running 0.7.6 (even with the 0.7.6.3 update).

Simulators running on a computer where the system language is uses a comma as the decimal separator (so 1.0 is reported as 1,0) can result in buggy/incorrect positioning. LSL scripting language assumes the decimal point separator.

If you discover a bug, please let me know immediately with instructions on how to duplicate it and I'll gladly fix it. I'm open to feature requests too.}
 