Wednesday, April 8, 2009

How to make furniture and pose balls compatible with Seamless Sit

Most furniture, pose balls, stands, and so on are already compatible with Seamless Sit. A few items are not, but it is usually easy to fix them so they will work.


If you are making a sit script, all you need to do is make sure that after you obtain PERMISSION_TRIGGER_ANIMATION and before you start your own animation, you have:

llStopAnimation("sit"); // stop the system default sit

Yes, that's all there is to it.

(I should note here that if you stop "sit" and don't run an animation of your own, your avatar may appear to still be running your custom sit or even a stand. This is just an SL quirk, things will sort themselves out as soon as you run a new animation.)


One fairly popular line of products that doesn't stop the default sit are the Sexgen and Neolove furniture. (Items based on the MLP scripts, including ones that are sold as fake Sexgen furniture, are already compatible, so skip this unless you have the real thing.)

Looking in a recent SexGen Platinum bed (this one is version 5.01a), I found that the pose balls in its inventory were full permissions, so it was possible to patch them to be compatible. The "BB Ball v4.0" script inside each ball can be modified as follows:



--- BB Ball v4.0.lsl 2009-04-08 15:16:55.000000000 -0400
+++ BB Ball v4.0mod.lsl 2009-04-08 15:15:54.000000000 -0400
@@ -48,6 +48,7 @@
{
if (gbAutoHide) llSetAlpha(0, ALL_SIDES);
gkSitter = llAvatarOnSitTarget();
+ llRequestPermissions(gkSitter, PERMISSION_TRIGGER_ANIMATION|PERMISSION_TAKE_CONTROLS);
llSay(gnChnFromBall, gsMyName + "|Sit|" + (string)gkSitter);
gnMode = MODE_ANIM;
}
@@ -93,7 +94,7 @@
else if (sKeyword == "Move")
{
gnMode = MODE_MOVE;
- llRequestPermissions(gkOwner, PERMISSION_TAKE_CONTROLS );
+ llRequestPermissions(gkOwner, PERMISSION_TAKE_CONTROLS|PERMISSION_TRIGGER_ANIMATION );
}
else if (sKeyword == "EndMove")
{
@@ -118,12 +119,16 @@
if (gkSitter != NULL_KEY)
{
gnMode = MODE_MOVE;
- llRequestPermissions(gkSitter, PERMISSION_TAKE_CONTROLS );
+ llRequestPermissions(gkSitter, PERMISSION_TAKE_CONTROLS|PERMISSION_TRIGGER_ANIMATION );
}
}

run_time_permissions(integer perm)
{
+ if (perm & PERMISSION_TRIGGER_ANIMATION)
+ {
+ llStopAnimation("sit");
+ }
if (perm & PERMISSION_TAKE_CONTROLS)
{
llTakeControls(CONTROL_FWD | CONTROL_BACK | CONTROL_ROT_LEFT | CONTROL_ROT_RIGHT | CONTROL_UP | CONTROL_DOWN,


0 comments: