/** Minimal AO Drop in animations for every action you want to override. Rename them as "Standing1", "Standing2" etc ... E.g. to override the Walking animation, rename the animations to to "Walking1", "Walking2" etc... Then reset this script **/ string lastAnim; string newAnim; string lastAction; string newAction; list animCounts; integer isOn =1; list Actions = [ "Standing", "Walking", //"Sitting", "Sitting On Ground", "Crouching", "Crouch Walking", "Landing", "Standing Up", "Falling", "Flying Down", "Flying Up", "Flying", "Flying Slow", "Hovering", "Jumping", "Pre Jumping", "Running", "Turning Right", "Turning Left", "Floating", "Swimming Forward", "Swimming Up", "Swimming Down" ]; changeAnim() { newAction = llGetAnimation(llGetOwner()); if (lastAction != newAction) { if (lastAnim != "") { llStopAnimation(lastAnim); lastAnim = ""; } integer idx = llListFindList(animCounts, newAction); if (idx >= 0) { integer total = llList2Integer(animCounts, idx+1); if (total>0) { newAnim = newAction+ (string)(1 + (integer)llFrand(total)); //llOwnerSay(newAction+ ": "+newAnim); llStartAnimation(newAnim); lastAnim = newAnim; } } lastAction = newAction; } } default { state_entry() { llSetColor(<1,1,1>, ALL_SIDES); if (llGetAttached() != 0) { llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); } integer i; for (i =0; i < llGetListLength(Actions); i++) { string act = llList2String(Actions, i); integer tot=0; integer j; for (j=1; j <= 20; j++) { if (llGetInventoryType(act+(string)j) == INVENTORY_ANIMATION) tot++; else jump after; } @after; if (tot>0) animCounts += [act, tot]; } llOwnerSay("AO is on"); } attach(key id) { if (id != NULL_KEY) llResetScript(); } on_rez(integer i) { llResetScript(); } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION) { llSetColor(<.2,1,.2>, ALL_SIDES); } } touch_start(integer n) { isOn =!isOn; if (!isOn) llStopAnimation(lastAnim); llSetColor(, ALL_SIDES); } changed (integer change) { if (isOn) if (change & CHANGED_ANIMATION) { changeAnim(); } if (change & CHANGED_REGION) { llResetScript(); } } }