Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Solop Dance Machine Help

Eric Domela
Registered User
Join date: 21 Jul 2005
Posts: 4
10-02-2009 16:00
I have put together the solop dance machine but I can not for the life of me figure out how to make the dances start by sitting on the poses and not having to touch the dance machine. I know it has to be linked and root prim. I been working at this for days and would appreciate some help very much.
Thank you. :)
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
10-02-2009 16:27
The solop dance machine is supposed to service multiple dancers at the same time, so why sit on it? Do you want all the dancers to sit on it?
The solop dance machine has a master script and a number of scripts: slots, one for each dancer. All scripts go in one prim and a new slot is activated each time a new dancer touches the prim.
_____________________
From Studio Dora
Eric Domela
Registered User
Join date: 21 Jul 2005
Posts: 4
Ummmm
10-02-2009 16:30
Sorry guess I didn't clarify myself. They sit on a pose ball and touch the solop dance machine to start dancing. I don't want to sit on the dance machine lol. I am trying to make it where they all sit on a separate pose ball and start dancing automatically without having to touch the solop dance machine.

Like line dancing.
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
10-03-2009 03:54
What you must do is:

1.Make a script for the ball, that tells the agent key to the 'Solop Server' script, when an agent sit or unsit.
If in a linkset use llMessageLinked.
Otherwise use llSay, llWhisper or llRegionSay

2.In the 'Solop Server' script replace the touch event handler:
If in a linkset replace by a link_message eventhandler'
Otherwise by a listen event handler

The agent key shall be handled exactly the way it is in the touch event.

Note: The animation will not start automatically, you will get the blue sign asking for animation permission. When permission is given the animation will start
This can only be avoided if the the script that activates the animation and the animation itself is in the prim the agent is sitting on.

Happy scripting:)
_____________________
From Studio Dora
jeaniesing Trilling
Loves to animate & script
Join date: 21 Oct 2006
Posts: 61
10-04-2009 14:14
the link message will not work easily in this case without lots of reworking because you cannot get a blue permissions dropdown while sitting on that object

do not connect the poseballs to the dance ball, have each ball shout the key of the sitter when they, sit and the ball launch a llRequestPermissions from a listen to animate to that user*

*change the touch event to a listen event... and be sure to open a listen in the state_entry of the solop script

put a 0 priority animation in the pose balls so it will be overridden by anything....

have the anim scripts check to be sure the avatar is still sitting before starting a new anim if(llGetAnimation(user)=="Sitting";)llStartAnimation(

handle the user standing up by another shout so that the key is removed from the list?
_____________________
Pinastri/113/171/30
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
10-05-2009 05:00
This is how I do it in my DanceMaster system for the Line dance Modules, It should also work for Solo and Couples dances.

in the pose ball:

CODE

//Very Keynes - 2006 - 2009
//________________________________________________________________________________________________
//
// DanceMaster Solo - Line control Ball
//
float version = 1.00;
string date = "2009/02/09";
//________________________________________________________________________________________________
//
integer NetCh = -xxxxxxxxx;
integer ChHdl;
key ActiveDM;
key avatar = NULL_KEY;
string cmd;
string arg;

hide(){llSetAlpha(0.0, ALL_SIDES);}
show(){llSetAlpha(1.0, ALL_SIDES);}

default
{
on_rez(integer start_param)
{
llResetScript();
}
//________________________________________________________________________
//
// Begin Network Insert
//
// only used in root prim of line set to find a DanceMaster Solo
//
//_________________________________________________________________________
//
state_entry()
{
llSetText("", <1,1,1>, 1.0);
llRegionSay(NetCh, "DM_SEEK");
ChHdl = llListen(NetCh, "", "", "");
llSetTimerEvent(10.0);
llMessageLinked(LINK_ALL_OTHERS, 0, "hide", NULL_KEY);
hide();
llSitTarget(<0.0, 0.0, 0.50>, ZERO_ROTATION);
}
touch_start(integer total_number)
{
llResetScript();
}
listen(integer CurCh, string name, key tid, string cmd)
{
list args = llCSV2List(cmd);
cmd = llList2String(args, 0);
if("DM_SEEK_ACK" == cmd)
{
llListenRemove(ChHdl);
llSetTimerEvent(0.0);
ActiveDM = tid;
llMessageLinked(LINK_ALL_OTHERS, 0, "ActiveDM", ActiveDM);
llMessageLinked(LINK_ALL_OTHERS, 0, "show", ActiveDM);
llMessageLinked(LINK_ALL_OTHERS, 0, "SET_GROUP", llGetObjectDesc());
show();
llRegionSay(NetCh, (string)ActiveDM + "," + (string)NULL_KEY + ", GROUP_NEW," + llGetObjectDesc());
}
}
timer()
{
llListenRemove(ChHdl);
llOwnerSay("No DancMaster Compatable Devices Found");
ActiveDM = NULL_KEY;
llSetTimerEvent(0.0);
}
//________________________________________________________________________
//
// End Network Insert
//
// above only used in root prim of line set to find a DanceMaster Solo
//_________________________________________________________________________
//
// Common Code
//
// used in each prim of LineDance Module
//__________________________________________________________________________
//
changed(integer change)
{
if(change & CHANGED_LINK)
{
if(llKey2Name(llAvatarOnSitTarget()) != "" && llAvatarOnSitTarget() != avatar)
{
hide();
avatar = llAvatarOnSitTarget();
llRegionSay(NetCh, (string)ActiveDM + "," + (string)avatar + ", GROUP_SET," + llGetObjectDesc());
}
else if (llAvatarOnSitTarget() != avatar && llKey2Name(avatar) != "")
{
llRegionSay(NetCh, (string)ActiveDM + "," + (string)avatar + ", GROUP_END," + llGetObjectDesc());
avatar = NULL_KEY;
show();
}
}
}
link_message(integer sender_number, integer number, string message, key id)
{
if("ActiveDM" == message)
{
ActiveDM = id;
llSitTarget(<0.0, 0.0, 0.50>, ZERO_ROTATION);
}
if("show" == message) show();
if("hide" == message) hide();
}
//_________________________________________________________________________
//
// End Common Code
//
// above used in each prim of LineDance Module
//__________________________________________________________________________
//
}


The key lines are in the changed event.
The ball sends a string such as:
"RYC,Very Keynes, GROUP_SET,HouseLine" where HouseLine is stored in the description and RYC and Very Keynes are actually string representations of the Respective Keys.
The dance master then looks in its user table to see if it already has permission to animate, is not it requests permission to animate and if granted the user is added to the the user lists and group, in this case houseLine, and the appropriate animation sent to that user.
When they stand up, it sends the same string with a GROUP_END command, so the danceMaster stops the animation and removes them from the Group List.
The nice thing about this method is that the ball has no open listens, it opens one on rez or on touch, just long enough to let the dancemaster know it exists and to create the group.
The only open listen in the entire system is the dance master, no matter how many dance balls you set out.
Another advantage is that the Dance Master retains the user list and permissions, between resets, so If the user is a regular at your venue, they will not be asked permission every time they want to dance, stop, or change dances even if they have left and returned several times. I only reset the dance Master if the Database is full.