Jump to content
Sign in to follow this  
Dora Gustafson

Basic Pose Ball script

Recommended Posts

New forum Edition

This script is almost as simple as can be, so it is easy to make changes to.
To use it:

  1. Type the desired animation name into the script by replacing the default built-in: "stand".
  2. If the animation is not built-in, then drop the animation in the pose ball prim
  3. Save(compile) the script in the pose ball prim

Now you are ready to sit on the pose ball

// Basic pose ball script. by Dora Gustafson, Studio Dora 2010
// Free for anybody to read, copy, modify, compile, use, rip apart, trample on and flush
// v1.3 with Set Click Action

string animation = "stand"; // name of built-in animation or animation in prim inventory

default
{
    state_entry()
    {
        llSitTarget( <0.0, 0.0, 0.01>, ZERO_ROTATION );
        llSetSitText(llToUpper(animation));
        llSetClickAction(CLICK_ACTION_SIT);
    }
    changed(integer change)
    {
        if (change & CHANGED_LINK)
        {
            key sitter = llAvatarOnSitTarget();
            if(sitter != NULL_KEY) llRequestPermissions(sitter , PERMISSION_TRIGGER_ANIMATION);
            else
            {
                if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) llStopAnimation(animation);
                llSetAlpha(1.0, ALL_SIDES); // show prim
            }
        }
    }
    run_time_permissions(integer perm)
    {
        if ( perm & PERMISSION_TRIGGER_ANIMATION )
        {
            llSetAlpha(0.0, ALL_SIDES); // hide prim
            llStartAnimation(animation);
            llStopAnimation("sit");
        }
    }
}

Besides handling the animation, the script has only few features:

  • It hides the ball prim on sit and shows it on unsit
  • Sets SitText to the name of the animation
  • Sets "ClickAction" to Sit on a mouse click
  • Has neither hide or show on chat commands. This makes it "Low Lag"
  • Has no floating/hover text

Link to old forum

  • Like 2

Share this post


Link to post
Share on other sites

The 5th line has the default animation name "stand".  Change it to the name of your animation.

 

string animation = "stand"; // name of built-in animation or animation in prim inventory

Share this post


Link to post
Share on other sites

It's not working for me..I have a simple prim, nothing in it but this script and my animation. The names match in the script and on the animation, but when I sit on it the animation doesn't play..I don't know what could be wrong

  • Like 1

Share this post


Link to post
Share on other sites

Hehe No, not in my case at least. I go noob when I test my builds to avoid simple oversights like that. Thank you very much for the suggestion though ^^

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...