06-21-2007 09:41
I am stuck with scripting a facial gesture, to be more specific in getting an expression to be "static". I have searched past posts and tried the various scripting approaches including the following, but i get a mouth that opens and closes, regardless of varying the timings. I know there has to be a way to do this since i have seen it work in SL.

<php>
string GESTURE_ANIMATION = "express_open_mouth";

// Set this for the repeat time/loop in seconds
float GESTURE_LOOP_TIME = 0.5;

// Don't edit below this line!
default {

changed(integer change) {
if(change & CHANGED_LINK) {
llSleep(0.0);
key agent = llAvatarOnSitTarget();
if (agent != NULL_KEY) {
llRequestPermissions(agent, PERMISSION_TRIGGER_ANIMATION);
} else {
llSetTimerEvent(0.0);
if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION
&& llKey2Name(llGetPermissionsKey()) != "";) {
llStopAnimation(GESTURE_ANIMATION);
}
}
}
}

run_time_permissions(integer perm) {
if (perm & PERMISSION_TRIGGER_ANIMATION) {
llStartAnimation(GESTURE_ANIMATION);
llSetTimerEvent(GESTURE_LOOP_TIME);
}
}

timer() {
llStartAnimation(GESTURE_ANIMATION);
}
}
<php>

Any suggestions?