I have always thought it kind of silly that we have to type "/ao off" when we sit on a pose ball and "/ao on" when we stand back up. Well, maybe it isn't as silly as having to make an overrider for an overrider
But now I have come far enough along in my scripting to cobble together my own pose ball script. Per the wiki it is not possible to start an animation by it's key BUT you can stop one with it's key. You can use llGetAnimationList to get that key.Just make a pose ball and texture as desired, drop an animation in it and this script.
pose ball script:
CODE
//AO Overrider Pose Ball Script V 1.2
//Updated 11/09/2006
//Created by Jesse Barnett
//Edited to check if there is an animation to stop
//and Sit Position is stored in Object Description
//Drop this in a prim along with an animation. Store the sit position in the Object description
//Example; <0.0, 0.0, 1.0>
//If you change this then reset the script by using right click/reset for changes to apply immediately. If you forget then it will display
//"reset script" when you sit. Just stand and sit again for changes to take efect
integer perm;//permissions
string anim2run;//animation in inventory
vector sit_pos;//adjust as needed in object description Example: <0.0, 0.0, 1.0>
list anim2stop;//default or AO sit animation
float sleep = 0.5;//duration of llSleep in seconds
sit_desc_change(){
if((sit_pos + (vector)llGetObjectDesc()) != (sit_pos* 2))
llResetScript();
//This checks to see if the description field matchs the stored position
else
llSitTarget(sit_pos, ZERO_ROTATION);
}
stop_anim(){
if(llGetListLength(anim2stop) > 0)
llStopAnimation((string)anim2stop);
//If there is a name in the list then it stops that animation
}
default{
state_entry(){
llSetTouchText("Reset");
llOwnerSay("Script Reset.");
anim2run=llGetInventoryName(INVENTORY_ANIMATION,0) ;
sit_pos = (vector)llGetObjectDesc();
sit_desc_change();
perm=llGetPermissions();
}
touch_start(integer num_detected) {
llResetScript();
}
changed(integer change){
if (change & CHANGED_LINK)
if (llAvatarOnSitTarget() != NULL_KEY){
llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION);
}
else{
perm=llGetPermissions();
if ((perm & PERMISSION_TRIGGER_ANIMATION) && llStringLength(anim2run)>0)
llStopAnimation(anim2run);
llSetAlpha(1.0, ALL_SIDES);
}
}
run_time_permissions(integer perm){
if (perm & PERMISSION_TRIGGER_ANIMATION)
anim2stop = [];//Clears the list
llStopAnimation("sit");
llSleep(sleep);//need sleep to give avatar time to cycle from stand to default sit to AO sit
anim2stop = llGetAnimationList(llAvatarOnSitTarget());
stop_anim();//This runs the subroutine up top .
llSetAlpha(0.0, ALL_SIDES);
llStartAnimation(anim2run);
}
}
