Jump to content
  • 0

Play Gesture When Collision with other avie


LadyIvyGeorgina
 Share

You are about to reply to a thread that has been inactive for 1733 days.

Please take a moment to consider if this thread is worth bumping.

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.

 

Link to comment
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

Link to comment
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.

 

Link to comment
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
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1733 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...