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,


Friday, April 3, 2009

Torimato? wat.

Today we pushed out some new AO toys. Well really, it's one new toy, but we will be packing it up in a few forms to suit different needs. We have a new standalone HUD, a substantial update to MEAO for MystiTool, and will soon be distributing a faceless version for use inside your own creations.


For those who like their AOs embedded into MystiTool, we have MEAOv2 for you. Like the previous updates, upgrading is pretty straightforward, well, as straightforward as things get with MystiTool. Turn off the old version, delete the old readme, core and interface scripts from your HUD, drop in the new replacements, wait for them to try to load, pick Reset from the MEAO menu, detach MystiTool, wait a couple of minutes, and put it back on. You're done. The new features are the same as what we put in the standalone HUD, so keep reading!

For those who like to keep things separate to avoid the occasional MystiTool update shuffle, or who don't need no stinking multifunction HUDs, we also have the AO available in a spiffy new standalone version, which we have decided to call Torimato, because that's three terrible puns in one. The little pictures here show what it looks like in its expanded and collapsed views, and you can stretch it to as big or small as you like (If you forget to stretch the textures, just pick reset from the HUD's menu, and it will fix itself).

Those little fast-forward buttons let you switch to next sit, walk, ground sit or stand. If you hold down those buttons for a moment, menus pop up to let you choose specific animations or random mode for each. The little button with the red line across it shows that forced ground sit is off; when it's on, it will be green like the sit override button above it. The blue button brings up the full AO menu, and holding down the menu button does the collapse and expand thing for you.

Okay fine, there are shiny buttons to poke at, but what does this thing do? Well, it's kind of a wish fulfillment AO, using the raw ultimate power of Mono to remove many of the old limitations that its Franimation and ZHAO ancestors had to endure. So here is a bullet list, because anything put into a bullet list is automatically ten times more important.
  • The notecard format is backward compatible with ZHAO-II, so you don't need to start from scratch. Play with the new features and add them as the mood strikes. Default settings have also been set to match ZHAO-II, so out of the box, your old notecards will work pretty much the same as they always did.
  • We added some new animation states, for Typing, Busy and Away. Striding and Soft Landing will now work if you add them, without tweaking the script; if you leave them out of your notecard, they will be handled the old way (aliased to Walking and Landing, respectively).
  • You can add individual run times to animations. In this release we are only using the timers with stands, but we already have hooks in place to expand this functionality. This means that you can mix and match long animated stands and short static transitional poses, or even animated stands of different lengths, without them looking silly when put into the same notecard (older AOs used the same timing for all stands). Hopefully this will help make us all look a little less like robots!
  • You can have as many animations of any type as you want in one notecard. Stands, sits, ground sits and walks have menus, the rest will be selected randomly on each play. This is my favorite change, people are random and quirky, and avatar motion needed a little more of that.
  • We retained Seamless Sit, and made it a tiny bit more seamless. If you haven't seen this feature yet in other AOs, it checks to see of whatever you are sitting on has turned off the system default sit animation. If that has happened, we know that the object is trying to run an animation of its own, so we turn off the sit override automatically. If you decide you really want your own animation to run over what the furniture has, mash the sit button once or twice and your own animation will play.
  • There are more AO commands that cover pretty much everything, and you can put those commands right into your notecards. Did you ever load a different notecard and get annoyed that you also had to go in and change the stand time and random/sequential from the menu, or things like that? These commands make all that go away.
  • The standalone HUD can also accept those commands from chat (we have this feature turned off by default, but you can turn it on from the menu or enable it in your Default notecard). This is super convenient if you have the editor open often and can't click on the HUD, or of you want to control your AO with gestures. (We don't use this inside MystiTool, because that already has its own listener we can use.)
  • The object listener (mainly for LuLu support) has been extended to be more generally useful. It will accept any AO command chatted on channel 1 by objects owned by you. It's turned off by default, and you can leave it off if the idea scares you.
  • You know that quirk where you would swim out of the water into the air, and still be swimming? We fixed that.
  • Even though a lot of stuff was added, the new notecard reader moved to the interface script, so there is plenty of room for your animations in the core.
  • ...and more little bits and pieces here and there.
I know what you're thinking. Is this going to be a huge laggy beast? Well, no! In fact, we checked and re-checked because we didn't expect the load would be so low after all that tweaking.
  • Out on populated main grid sims, the sim stats were lost in the noise, so that was kind of inconclusive.
  • On the preview grid copy of Morris, which has a nice steady low script load, the total script time stayed nice and steady even when we reset or loaded new notecards.
  • On the preview grid's Kapor, empty when we tested, total script time usually showed as zero with the AO running, occasionally blipping up to 0.1 ms. When loading a new card, there was about a second of 0.2-0.3 while variables got cleared, then a few seconds of 0.1-0.2 while the notecard lines were read, then back to near zero when regular AO operation resumed.
  • On the test sims running the new Mono scheduler, timer displays were about the same as in Kapor. Also, our free space held up pretty well under the tighter memory management, so we are happy.
OK, so where to get this stuff? You can pick them up in world, or go to our Torimato and MEAO pages on Xstreet.