Jump to content
  • 0
LadyIvyGeorgina

Play Gesture When Collision with other avie

Question

Greetings, I would love to create an object that once attached to my avatar reproduces a complete gesture from my inventory when my avatar and another collide, so she complaints like the old lady she is. No pushing, just reproduce my old lady gestures that are already made and inside my inventory.

I guess it is easy but i no nothing about scripting.

 

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0
1 hour ago, LadyIvyGeorgina said:

Greetings, I would love to create an object that once attached to my avatar reproduces a complete gesture from my inventory when my avatar and another collide, so she complaints like the old lady she is. No pushing, just reproduce my old lady gestures that are already made and inside my inventory.

I guess it is easy but i no nothing about scripting.

 

Search Market Place. Here is a list of script under the search term "bump": https://bit.ly/2SV9qhf

Share this post


Link to post
Share on other sites
  • 0

It is not possible for scripts to trigger gestures. The other way around can be done, but that's not what you are looking for.

The best that you can hope for is to create a scripted attachment which, when you get bumped into will play an animation, sound, text, or a combination of these. But triggering a gesture using a script is just not possible.

 

Share this post


Link to post
Share on other sites
  • 0

As mentioned, you can't trigger a gesture from a script, but it's easy enough to reproduce a gesture in a script.

Perhaps something like this:

default
{
    state_entry ()
    {
        //The script must request permission to play animations
        //which is automatically granted for worn objects
        llRequestPermissions (llGetOwner (), PERMISSION_TRIGGER_ANIMATION);
        //set the object's name to the wearer's display name if you want it to say stuff as if
        //it was coming from your avatar
        llSetObjectName (llGetDisplayName (llGetOwner ()));
        //this doesn't change the object's name in your inventory, to which it reverts when detached
    }

    attach (key id)
    {
        if (id) llResetScript ();
    }

    collision_start (integer count)
    {
        //check if you've collided with an avatar:
        //llGetAgentSize returns ZERO_VECTOR if the collision object isn't an agent (avatar),
        //and this is evaluated as FALSE, so the following code doesn't get executed.
        if (llGetAgentSize (llDetectedKey (0)))
        {
            //the animation must be in the object's inventory
            llStartAnimation ("angry old lady"); //or whatever it's called
            //The sound clip must be in the object's inventory, or you can use its UUID (key)
            llPlaySound ("curse and swear", 1.0); //or whatever it's called
            //trigger rather than play so it's heard outside if it's in a HUD
            //llTriggerSound ("curse and swear", 1.0);
            llSay (PUBLIC_CHANNEL, "Watch where you're going, you stupid kid!"); //or whatever you want
            //or llWhisper or llShout or
            //llRegionSayTo (llDetectedKey (0), PUBLIC_CHANNEL, "Watch where you're going, you stupid kid!");
            //for a more private admonition
            //and maybe for fun:
            llSay (PUBLIC_CHANNEL, "/me waves her stick at " + llGetDisplayName (llDetectedKey (0)) + ", nearly poking their eye out.");
        }
    }
}

WARNING: this hasn't been tested in-world, so there's probably problems lurking.

  • Like 2

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
Answer this question...

×   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.


×
×
  • Create New...