Jump to content

Is There a way To Keep a Avatars Mouth Open Using a Script?


Luxz Blessed
 Share

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

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

Recommended Posts

hi , is there anyway  to make  a avatar keep its mouth open  by using a script , im trying to make it look like there is a candy cane stuck in its  throat.. i'm thinking it might   be a half   script  job and half animation type  job.. but i'm having trouble  finding a  open mouth animation on SL market  thats  full perms :/

Link to comment
Share on other sites

the only mouth open animations possible are the ones that are built into SL.... IIRC you can't actually get the mouth to stay open, only repeatedly open and close.... unless one of the newer voice animations will let you do it...

at that point it's just a matter of continually replaying the animation

Link to comment
Share on other sites

 full perm script   here that might  work  can someone help me tweak it,  or will it not work?

 

// ==================// OPEN MOUTH// ==================// CONFIG// The animation to use to keep the mouth open.string gAnim = "express_open_mouth";float gOpenRate = 0.2;// Counts amount of time between timer bursts so the typewatcher isn't annoyingly frequent.integer gTypeCounter = 0;// Use this to reference NULL_KEY as a pointer. Surprisingly, this approach saves 2k per script.key null_key = NULL_KEY;// ==================// STATESinteger gInserted = FALSE;// ==================// ANIMATIONinteger toggleAnim(){    llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);        return TRUE;}// ==================default{    state_entry()    {        gInserted = FALSE;      if(llGetAttached()) toggleAnim();    }        // Request animation play when gag attached.    attach(key attached)    {        if (attached != null_key)        {            toggleAnim();        }        else        {            gInserted = FALSE;            toggleAnim();              }    }    // Request permission to    run_time_permissions(integer perms)    {        if(perms & (PERMISSION_TRIGGER_ANIMATION))        {            if (gInserted == TRUE)            {                // Start timer which keeps the openmouth anim running.                llSetTimerEvent(gOpenRate);            }            else            {                // Stop the openmouth.                llSetTimerEvent(0.0);                // Make the wearer smile when their gag is removed.                llStartAnimation("express_toothsmile");            }        }    }    timer()    {        // Run openmouth animation.                llStartAnimation(gAnim);                // If the wearer is typing,        if (llGetAgentInfo(llGetOwner()) & AGENT_TYPING && gTypeCounter == 10)        {            // Send link message notifying other scripts.            llMessageLinked(LINK_THIS, 0, "Wearer Typing", null_key);        }                    gTypeCounter++;        if (gTypeCounter > 10) gTypeCounter = 0;        }        // Waits for another script to send a link message.    link_message(integer sender_num, integer num, string variable, key wearer)    {        // If gag inserted, keep the jaw pried open.        if (variable == "Inserted")        {            gInserted = TRUE;           if(llGetAttached()) toggleAnim();        }           // If gag removed, close the jaw.        else if (variable == "Removed")        {            gInserted = FALSE;           if(llGetAttached()) toggleAnim();                           }        // Output current free memory.        else if (variable == "Memory")        {            llOwnerSay(llGetScriptName() + ": " + (string)llGetFreeMemory() + "kb free.");        }            }    }

 

Link to comment
Share on other sites

It's definitely possible. I've seen plenty of scrpted gadgets like ball gags that force the mouth open while you're wearing them, and that work with any browser. So something that makes your mouth be in the open position with a candy cane in it should work the same way. Haven't tried scripting one though.

  • Like 1
Link to comment
Share on other sites

That script looks like it should work; it's doing what Void says: it's repeatedly restarting the open-mouth animation.  That script does other things too; looks like it handles a gag; you may want to remove the unnecessary bits.

Specifically, remove the LinkedMessage handler, and set gInserted to TRUE in the state entry handler.  (Better yet just remove all the tests on this variable assuming it's always true.)

Remove the llMessageLinked call, and starting the toothedsmile expression.

Link to comment
Share on other sites

Here's a simplified version of the same thing, that I use:

float t =0.5; //how often to restart the facial expressions -- need to tweak depending on the effect you wantlist gAnimations = ["express_toothsmile","express_tongue_out" ];//build up your perferred expression using the built-in ones -- use as many or as few as you likestring anim;//animation you're playing (eg holding the candy cane)restartAnimations(){	integer i ;	integer max = llGetListLength(gAnimations) ;	string ani ;	for (i=0;i<max;i++)	{		ani = llList2String(gAnimations, i) ;		llStopAnimation(ani) ;		llStartAnimation(ani) ;	}}default{	state_entry(){		anim = llGetInventoryName(INVENTORY_ANIMATION,0);		if(llGetInventoryName(anim)!=INVENTORY_ANIMATION){//sanity check			llOwnerSay("Please put an animation in me or this isn't going to work properly");		}	}	changed(integer change){		if(change & CHANGED_INVENTORY){			anim = llGetInventoryName(INVENTORY_ANIMATION,0);			if(llGetInventoryName(anim)!=INVENTORY_ANIMATION){//sanity check				llOwnerSay("Please put an animation in me or this isn't going to work properly");			}		}	}	attach(key id){		if(id){			llRequestPermissions(id,PERMISSION_TRIGGER_ANIMATION);		}		else{			if(llGetPermissions()&PERMISSION_TRIGGER_ANIMATION){				llStopAnimation(anim);			}//no need to stop the facial expressions, because they'll stop anyway in a second or two			llSetTimerEvent(0.0);		}	}	run_time_permissions(integer permissions){		if(permission & PERMISSION_TRIGGER_ANIMATION){			llStartAnimation(anim);//start holding the candy			restartAnimations();//run through the list of facial expressions, starting each one			llSetTimerEvent(t);		}	}	timer(){		restartAnimations();	}}

 

Link to comment
Share on other sites

  • 3 years later...

The following code will keep mouth open all the time. Just make sure you are not using a smiling script at the same time.

 

float t =0.5; //how often to restart the facial expressions -- need to tweak depending on the effect you wantlist gAnimations = ["express_open_mouth"];//build up your perferred expression using the built-in ones -- use as many or as few as you likestring anim = "express_open_mouth";//animation you're playing (eg holding the candy cane)restartAnimations(){    integer i ;    integer max = llGetListLength(gAnimations) ;    string ani ;    for (i=0;i<max;i++)    {        ani = llList2String(gAnimations, i) ;        llStopAnimation(ani) ;        llStartAnimation(ani) ;    }}default{    state_entry(){    }    attach(key id){        if(id){            llRequestPermissions(id,PERMISSION_TRIGGER_ANIMATION);        }        else{            if(llGetPermissions()&PERMISSION_TRIGGER_ANIMATION){                llStopAnimation(anim);            }//no need to stop the facial expressions, because they'll stop anyway in a second or two            llSetTimerEvent(0.0);        }    }    run_time_permissions(integer permissions){        if(permissions){            llStartAnimation(anim);//start holding the candy            restartAnimations();//run through the list of facial expressions, starting each one            llSetTimerEvent(t);        }    }    timer(){        restartAnimations();    }}

 

 

Link to comment
Share on other sites

  • 1 month later...
You are about to reply to a thread that has been inactive for 3275 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...