Jump to content
  • 0

How do I play a gesture from script? /sneeze, /cough, /bow?


Mejamz
 Share

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

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

Question

Hello, I am a noob to SL. I am a student at a university trying to develop a new project and I am unable to figure this out...

I have created the gesture /sneeze and I would like to automate a script to play the /sneeze every couple of hours automatically without a voice trigger. How do I script a gesture to play from a script? Typing in the chat window to play a gesture is not sufficient, I need to use a script to call any gesture.

 

Do I need to create a special animation then place it in an object?

BTW: I need to use this gesture from an object to effect the avatar...

Please help, I have researched for three days and stugots... I Need HELP!!!

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

I'm not a scripter, but if you ask this question in the Scripting forum, you're more likely to find someone who is!

EDIT:  Woohoo, good one, Rolig!  I will add that you can also drop a script into an object to play a sound, as well as the animation that Rolig shows.  That would add the all-important "AH-CHOO!" to the result.

Link to comment
Share on other sites

  • 0

Gestures and scripts are different beasts.  If you have an animation that you want to activate at random intervals, you'll probably do best to write a small AO script, pop it into a HUD, and wear it.  It doesn't need to be anything fancy.   Just enough to run a timer and trigger the animation automatically.

This is just off the top of my head and not tested in world, but something like this ought to work ...

integer gStart;default{    on_rez(integer startup)    {        llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION);    }        run_time_permissions(integer perm)    {        if (perm & PERMISSION_TRIGGER_ANIMATION)        {            llSetTimerEvent(30.0);  // Start off with a timer that triggers every 30 seconds....        }    }    timer()        {        if (!gStart) //This starts the animation and lets it run for a couple of seconds....        {            llSetTimerEvent(2.0);            gStart = TRUE;            llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION,0));        }        else    // ... and this stops it and resets the timer for a random time later.        {            llStopAnimation(llGetInventoryName(INVENTORY_ANIMATION,0));            float time = 3600.0 + llFrand(3600.0);  // Change to a random trigger... between 1 and two hours            llSetTimerEvent(time);                        gStart = FALSE;        }    }}

 

  • Like 2
Link to comment
Share on other sites

  • 0

Yeah, you're right, and this one is right on the line. It's hard to answer one like this in the Scripting Forum without presuming a moderate level of scripting ability from the OP, so just saying "write an AO script" wouldn't be much help to a novice. I tend to avoid sending people over there when the best answer is likely to be "Here, have a free script."

Link to comment
Share on other sites

  • 0

Just to add to Rolig's answer, there's no direct way to play gestures by script in LSL, and the only indirect method I can think of that might work -- present the user with a dialog menu that says the trigger on a channel the gesture is listening on -- wouldn't be appropriate here (I'm not even sure it would work).

Link to comment
Share on other sites

  • 0

Yes there is no direct way to play gestures with script. However, you can trigger script with gestures by triggering the script from text in the [Replace with:] box in the gesture. An example is the commonly used hug script. This script is triggered when a user wearing the scripted object types '/hug username'. There is a gesture called huggie which is triggered when the user types '/huggie?' . Take this gesture and put '/hug' in the [Replace with:] box. Now if you type '/huggie? username' the /huggie? will trigger the gesture and the gesture will change this to /hug which will then trigger the script. username will then be read and the script will run as if you typed /hug username.

Note: changing the gesture trigger to /hug same as the script trigger will not work because the gesture will take the /hug out of chat before the script can see it. So you must use the gesture [Replace with:] box

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1763 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...