Jump to content

Animation restart?


Surssin
 Share

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

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

Recommended Posts

Hello there.

I have a nice OLD script that I adapted for a muzzle. I had to have it trigger a looped animation to keep my mouth closed when muzzled. That works well enough, except sometimes when I stand from things, the animation seems to have been stopped. Not overridden, stopped completely. I don't see it listed among the playing animations when I bring up the list.

Is there some little thing I can add to make the script, I don't know, restart the animation periodically? What's weird is as far as I can tell, the animation to keep my mouth open (for things like a ball gag) DOESN'T get canceled in this manner. So I'm not sure why one does, but not the other. Both are the same priority.

I'm gonna add a comment with the full script pasted. It's a bit long, so fair warning. Otherwise, I'm open to ideas.

Link to comment
Share on other sites

Quote

integer Flags=4;

integer Cchan;
integer Chandle;

integer LMhandle;

integer Gchan;
integer GListen;
integer Gsev=0;
integer Lstate=0;
integer Gagstate;

list primlist;

integer lastchanneltime;
integer replytime;

key target;

key posstarget;
list cofflelist;

key poster;

key grabtarget;

string texture = "1ea3a87f-75ae-996e-d7f7-98400ba6c58b";

string deftexture = "1ea3a87f-75ae-996e-d7f7-98400ba6c58b";

integer openMouth;
integer MuzzleMouth;

string oName;
string tname;
string gagname;

string mumble(string mes)
{
    
    integer i;
    
    list garbrep = [];
    
    if(Gsev == 0 || Flags & 64 || llGetSubString(mes,0,3) == "/me " || llGetSubString(mes,0,5) == "/me's ")
        return mes;
    else
    {
        if(Gsev == 1)
            garbrep = ["l", "w", "r", "w", "s", "f"];
    
        else if(Gsev == 2)
            garbrep = ["r", "w", "l", "w", "y", "w", "q", "w", "j", "w", "d", "s", "f", "b", "g", "t", "g"];
    
        else if(Gsev == 3)
            garbrep = ["a", "r", "b", "r", "j", "r", "s", "r", "v", "r", "z", "r", "d", "f", "k", "f", "l", "f", "w", "f", "g", "n", "x", "n","h", "d", "i", "d", "m", "d", "u", "d", "q", "m"];
    
        else if(Gsev == 4)
            garbrep = ["a", "m", "b", "m", "c", "m", "d", "f", "e", "r", "f", "r", "g", "r", "h", "m", "i", "m", "j", "m", "k", "m", "l", "m","m", "m", "n", "m", "o", "m", "p", "m", "q", "m", "r", "m", "s", "f", "t", "r", "u", "m", "v", "m", "w", "m", "x", "m", "x", "m", "y", "m", "z", "m"];

        else if(Gsev == 5)
            return "";

        for(i = 0; i < llGetListLength(garbrep) - 1; i += 2)
        {
            if(~llSubStringIndex(mes, llList2String(garbrep, i)))
                mes = llDumpList2String(llParseStringKeepNulls((mes = "") + mes, [llList2String(garbrep, i)], []), llList2String(garbrep, i+1));

            if(~llSubStringIndex(mes, llToUpper(llList2String(garbrep, i))))
                mes = llDumpList2String(llParseStringKeepNulls((mes = "") + mes, [llToUpper(llList2String(garbrep, i))], []), llToUpper(llList2String(garbrep, i+1)));
        }
        
        mes = (mes = "") + "" + mes;
    }
    return mes;
}

animateMouth()
{
    if(llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)
    {
        if(openMouth)
        {
            llStartAnimation("bento_open_mouth");
        }
        else
        {
            llStopAnimation("bento_open_mouth");
            llStartAnimation("bento_close_mouth");
        }
    }
    else
    {
        
        llSleep(1.0);

        llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION);
    }

    
    if(llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)
    {
        if(MuzzleMouth)
        {
            llStartAnimation("MuzzMouth");
        }
        else
        {
            llStopAnimation("MuzzMouth");
        }
    }
    else
    {
        
        llSleep(1.0);

        llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION);
    }


}
RLVRefresh()
{
    if(Flags & 1 && !(Flags & 64))
    {
        if(Flags & 2)
            llOwnerSay("@detach=n");
        else
            llOwnerSay("@detach=y");
        
        if(Flags & 4 && Gsev > 0)
            llOwnerSay("@emote=add,sendchat=n,redirchat:"+(string)Gchan+"=add,rediremote:"+(string)Gchan+"=add");
        else
            llOwnerSay("@sendchat=y,emote=add,clear=redirchat,clear=rediremote");
    }

    animateMouth();
}

Particles(string tag, integer on, key targ)
{
    list tlist;
    integer tnum = llListFindList(primlist, [tag]);
    
    target = targ;
    
    if(tnum != -1)
    {
        tnum++;
        tlist = llCSV2List(llList2String(primlist, tnum));
        tnum = llGetListLength(tlist);
        
        integer i;
        
        for(i = 0; i < tnum; i++)
        {
            if(on)
            {
                Flags = Flags | 8;
                llLinkParticleSystem(llList2Integer(tlist,i),[
                PSYS_PART_FLAGS,            PSYS_PART_FOLLOW_SRC_MASK|PSYS_PART_FOLLOW_VELOCITY_MASK|PSYS_PART_TARGET_POS_MASK,
                PSYS_SRC_PATTERN,           PSYS_SRC_PATTERN_DROP,
                PSYS_PART_START_SCALE,      <0.09, 0.09, 0.09>,
                PSYS_PART_END_SCALE,        <0.09, 0.09, 0.09>,    
                PSYS_PART_MAX_AGE,          5.0,
                PSYS_SRC_ACCEL,             <0.0, 0.0, -0.5>,
                PSYS_SRC_TEXTURE,           texture,
                PSYS_SRC_BURST_RATE,        0.02,
                PSYS_SRC_TARGET_KEY,        target,
                PSYS_SRC_OMEGA,             <0.0, 0.0, 0.2> ]);
            }
            else
            {
                Flags = (Flags | 😎 ^ 8;
                llLinkParticleSystem(llList2Integer(tlist,i), []);
            }
        }
    }      
}

Init()
{
        if(llGetAttached() <= 0)
        {
            Flags = Flags | 64;
            return;   
        }
        
        Flags = (Flags | 64) ^ 64;
    
        
        if(oName == "" || (oName != llGetDisplayName(llGetOwner()) && llGetDisplayName(llGetOwner()) != "???"))
            oName = llGetDisplayName(llGetOwner());
        if(oName == "" || oName == "???")
        {
            oName = llKey2Name(llGetOwner());
            if(~llSubStringIndex(oName, "Resident"))
                oName = llGetSubString(oName, 0, -10);
        }
        
        Flags = (Flags | 16) ^ 16;
        llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
        
        
        Flags = (Flags | 1) ^ 1;
        
        llListenRemove(Chandle);
        Cchan = ((integer)("0x"+ llGetSubString(llGetOwner(), 9, 12)) + (integer)("0x"+ llGetSubString(llGetOwner(), 13, 16)));
        Chandle = llListen(Cchan, "", NULL_KEY, "");
        
        llListenRemove(LMhandle);
        LMhandle = llListen(-8888, "", NULL_KEY, "");

        
        if(Flags & 1)
        {
            lastchanneltime = llGetUnixTime();
            if(Flags & 4 && Gsev > 0)
                llOwnerSay("@emote=add,sendchat=n,redirchat:"+(string)Gchan+"=add,rediremote:"+(string)Gchan+"=add");
        }
        else
        {
            llOwnerSay("");
        }

        llListenRemove(GListen);        
        GListen = llListen(Gchan, "", llGetOwner(), "");
        
        llSetTimerEvent(1.0);
        
        
        texture = deftexture;
        
        
        integer tnum = llGetNumberOfPrims();
        integer i;
        integer j;
        integer tnum2;
        string tstring;
        list tlist;
        primlist = [];
        
        tlist = llGetLinkPrimitiveParams(1,[PRIM_DESC]);
        primlist += tlist + ["1"];
        
        for(i = 2; i <= tnum; i++)
        {
            tlist = llGetLinkPrimitiveParams(i, [PRIM_NAME, PRIM_DESC]);
            
            for(j=0; j<llGetListLength(tlist); j++)
            {
                if(llList2String(tlist,j) != "")
                {
                    tnum2 = llListFindList(primlist,llList2List(tlist,j,j));
                    if(tnum2 != -1)
                    {
                        tnum2++;
                        tstring = llList2String(primlist,tnum2) + ","+(string)i;
                        primlist = llListReplaceList(primlist, [tstring], tnum2, tnum2);
                    }
                    else
                        primlist = primlist + llList2List(tlist,j,j) + [(string)i];   
                }
            }
        }
        
        
        Flags = Flags | 32;
}


HideShow(string tag, float show)
{
    list tlist;
    integer tnum = llListFindList(primlist, [tag]);
    
    if(tnum != -1)
    {
        tnum++;
        tlist = llCSV2List(llList2String(primlist, tnum));
        tnum = llGetListLength(tlist);
        
        integer i;
        
        for(i = 0; i < tnum; i++)
        {
            llSetLinkAlpha(llList2Integer(tlist,i), show, ALL_SIDES);
        }
    }
}

default
{
    state_entry()
    {
        gagname = llGetDisplayName(llGetOwner());
        Gchan = 3;
        Init();
    }
    

    attach(key id)
    {
        if(id == NULL_KEY)
        {
            if(Flags & 1)
                llOwnerSay("@clear");
            return;
        }

        Init();
    }

    listen(integer channel, string name, key id, string message)
    {
        if(Flags & 64)
            jump lbreak;
        
        if(id != llGetOwnerKey(id))
        {
            if(channel == Cchan && llGetOwnerKey(id) == llGetOwner())
            {
                list tlist = llParseString2List(message,[" "],[]);
                
                if(message == "HUD Attach")
                    Flags = Flags | 32;
                    
                else if(message == "Showlocks")
                {
                    Lstate = 1;
                    Flags = Flags | 2;
                    HideShow("Base2",1.0);
                    HideShow("reins3",1.0);
                    
                    RLVRefresh();
                }
                else if(message == "Hidelocks")
                {
                    Lstate = 0;
                    Flags = (Flags | 2) ^ 2;
                    HideShow("Base2",0.0);
                    HideShow("reins3",0.0);
                    
                    RLVRefresh();
                }
                else if(message == "RLV On")
                {
                    Flags = Flags | 1;
                    RLVRefresh();   
                }
                else if(message == "RLV Off")
                    Flags = (Flags | 1) ^ 1;
                    
                else if(llList2String(tlist,0) == "Reins")
                {
                    key tkey = llList2Key(tlist,2);
                    
                    if(llList2String(tlist,1) == "Coffle")
                    {
                        if(tkey != NULL_KEY)
                        {
                            posstarget = tkey;
                            poster = NULL_KEY;
                            cofflelist = [];
                            
                            llShout(-8888,(string)tkey+"bcollar");
                            llShout(-8888,(string)tkey+"bbelt");
                            llShout(-8888,(string)tkey+"back");
                            llShout(-8888,(string)tkey+"fbelt");
                            llShout(-8888,(string)tkey+"collar");
                            llShout(-8888,(string)tkey+"pelvis");
                            replytime = 3;
                        }
                    }
                    else if(llList2String(tlist,1) == "Post")
                    {
                        if(tkey != NULL_KEY)
                        {
                            poster = tkey;
                            posstarget = NULL_KEY;
                            replytime = 60;
                        }   
                    }
                    else if(llList2String(tlist,1) == "Grab")
                    {
                        if(tkey != NULL_KEY)
                        {
                            grabtarget = tkey;
                            Particles("reins",1,grabtarget);
                            llShout(-8888,(string)tkey+"handle");
                        }
                    }
                    else if(llList2String(tlist,1) == "Target")
                    {
                        if(tkey != NULL_KEY)
                            Particles("reins",1,tkey);
                    }
                    else if(llList2String(tlist,1) == "Unleash")
                    {
                        grabtarget = NULL_KEY;
                        posstarget = grabtarget;
                        poster = grabtarget;
                        
                        Particles("reins",0,grabtarget);
                        texture = deftexture;
                    }
                    else if(llList2String(tlist,1) == "Find" && llList2String(tlist,2) == "Handle" && grabtarget != NULL_KEY)
                        llShout(-8888,(string)grabtarget+"handle");
                }
                else if(llList2String(tlist,0) == "Eye")
                {
                    if(llList2String(tlist,1) == "YBlindfold")
                    {
                        Flags = Flags | 4;
                        HideShow("Blindfold",1.0);
                        llSleep(0.1);
                    }
                    else if(llList2String(tlist,1) == "NBlindfold")
                    {
                        Flags = Flags | 4;
                        HideShow("Blindfold",0.0);
                        llSleep(0.1);
                    }
                }
                else if(llList2String(tlist,0) == "Bit")
                {

                    if(llList2String(tlist,1) == "Bit")
                    {
                        Flags = Flags | 4;
                        Gagstate = 0;
                        HideShow("Gags",1.0);
                        llSleep(0.1);
                        HideShow("reins2",1.0);
                        llSleep(0.1);
                        HideShow("reins",1.0);
                        llSleep(0.1);
                        HideShow("CMuzzle",0.0);
                        llSleep(0.1);
                        HideShow("Ball",0.0);
                        llSleep(0.1);
                        HideShow("Straight Bar",1.0);
                        llSleep(0.1);
                        HideShow("Muzzle",0.0);
                        llSleep(0.1);
                        HideShow("Dildo",0.0);
                        llSleep(0.1);
                        HideShow("Dildoin",0.0);
                        llSleep(0.1);
                       HideShow("Ring",0.0);
                        openMouth = TRUE;
                    }
                    else if(llList2String(tlist,1) == "Ball")
                    {
                        Flags = Flags | 4;
                        Gagstate = 0;
                        HideShow("Gags",1.0);
                        llSleep(0.1);
                        HideShow("reins2",1.0);
                        llSleep(0.1);
                        HideShow("reins",1.0);
                        llSleep(0.1);
                        HideShow("CMuzzle",0.0);
                        llSleep(0.1);
                        HideShow("Ball",1.0);
                        llSleep(0.1);
                        HideShow("Straight Bar",1.0);
                        llSleep(0.1);
                        HideShow("Muzzle",0.0);
                        llSleep(0.1);
                        HideShow("Dildo",0.0);
                        llSleep(0.1);
                        HideShow("Dildoin",0.0);
                        llSleep(0.1);
                        HideShow("Ring",0.0);
                        openMouth = TRUE;
                    }
                    else if(llList2String(tlist,1) == "CMuzzle")
                    {
                        Flags = Flags | 4;
                        Gagstate = 2;
                        HideShow("Gags",0.0);
                        llSleep(0.1);
                        HideShow("reins2",0.0);
                        llSleep(0.1);
                        HideShow("reins",1.0);
                        llSleep(0.1);
                        HideShow("CMuzzle",1);
                        llSleep(0.1);
                        HideShow("Ball",0.0);
                        llSleep(0.1);
                        HideShow("Straight Bar",0.0);
                        llSleep(0.1);
                        HideShow("Muzzle",0.0);
                        llSleep(0.1);
                        HideShow("Dildo",0.0);
                        llSleep(0.1);
                        HideShow("Dildoin",0.0);
                        llSleep(0.1);                     
                        HideShow("Ring",0.0);
                        openMouth = FALSE;
                    }
                    else if(llList2String(tlist,1) == "Muzzle")
                    {
                        Flags = Flags | 4;
                        Gagstate = 1;
                        HideShow("Gags",0.0);
                        llSleep(0.1);
                        HideShow("reins2",0.0);
                        llSleep(0.1);
                        HideShow("reins",1.0);
                        llSleep(0.1);
                        HideShow("Muzzle",1);
                        llSleep(0.1);
                        HideShow("CMuzzle",0.0);
                        llSleep(0.1);
                        HideShow("Ball",0.0);
                        llSleep(0.1);
                        HideShow("Straight Bar",0.0);
                        llSleep(0.1);
                        HideShow("Dildo",0.0);
                        llSleep(0.1);
                        HideShow("Dildoin",0.0);
                        llSleep(0.1);                     
                        HideShow("Ring",0.0);
                        llSleep(0.1);
                        openMouth = FALSE;
                    }
                    else if(llList2String(tlist,1) == "Dildo")
                    {
                        Flags = Flags | 4;
                        Gagstate = 0;
                        HideShow("Gags",1.0);
                        llSleep(0.1);
                        HideShow("reins2",1.0);
                        llSleep(0.1);
                        HideShow("reins",1.0);
                        llSleep(0.1);
                        HideShow("Dildoin",0.0);
                        llSleep(0.1);                     
                        HideShow("Dildo",1);
                        llSleep(0.1);
                        HideShow("CMuzzle",0.0);
                        llSleep(0.1);
                        HideShow("Ball",0.0);
                        llSleep(0.1);
                        HideShow("Straight Bar",0.0);
                        llSleep(0.1);
                        HideShow("Muzzle",0.0);
                        llSleep(0.1);
                        HideShow("Ring",0.0);
                        openMouth = TRUE;
                    }
                    else if(llList2String(tlist,1) == "Ring")
                    {
                        Flags = Flags | 4;
                        Gagstate = 0;
                        HideShow("Gags",1.0);
                        llSleep(0.1);
                        HideShow("reins2",1.0);
                        llSleep(0.1);
                        HideShow("reins",1.0);
                        llSleep(0.1);
                        HideShow("Ring",1);
                        llSleep(0.1);
                        HideShow("CMuzzle",0.0);
                        llSleep(0.1);
                        HideShow("Ball",0.0);
                        llSleep(0.1);
                        HideShow("Straight Bar",0.0);
                        llSleep(0.1);
                        HideShow("Muzzle",0.0);
                        llSleep(0.1);
                        HideShow("Dildoin",0.0);
                        llSleep(0.1);                     
                        HideShow("Dildo",0.0);
                        openMouth = TRUE;
                    }
                    else if(llList2String(tlist,1) == "Dildoin")
                    {
                        Flags = Flags | 4;
                        Gagstate = 0;
                        HideShow("Gags",1.0);
                        llSleep(0.1);
                        HideShow("reins2",1.0);
                        llSleep(0.1);
                        HideShow("reins",1.0);
                        llSleep(0.1);
                        HideShow("Dildo",0.0);
                        llSleep(0.1);
                        HideShow("Dildoin",1);
                        llSleep(0.1);
                        HideShow("Ring",0.0);
                        llSleep(0.1);                     
                        HideShow("CMuzzle",0.0);
                        llSleep(0.1);
                        HideShow("Ball",0.0);
                        llSleep(0.1);
                        HideShow("Straight Bar",0.0);
                        llSleep(0.1);
                        HideShow("Muzzle",0.0);
                        openMouth = TRUE;
                    }

                    else if(llList2String(tlist,1) == "None")
                    {
                        Flags = (Flags | 4) ^ 4;
                        Gagstate = 0;
                        HideShow("Gags",0.0);
                        HideShow("reins2",0.0);
                        HideShow("reins",0.0);
                        HideShow("Dildo",0.0);
                        HideShow("Dildoin",0.0);
                        HideShow("Ring",0.0);            
                        HideShow("CMuzzle",0.0);
                        HideShow("Ball",0.0);
                        HideShow("Straight Bar",0.0);
                        HideShow("Muzzle",0.0);             
                        openMouth = FALSE;
                        MuzzleMouth = FALSE;
                    
                    }
                    
                    RLVRefresh();
                }
                else if(llList2String(tlist,0) == "Garble")
                {
                    if(llList2String(tlist,1) == "Evade")
                    {
                    llOwnerSay("@emote=add,sendchat=n,redirchat:"+(string)Gchan+"=rem,rediremote:"+(string)Gchan+"=rem");
                    Gchan = 22;
                    llOwnerSay("@emote=add,sendchat=n,redirchat:"+(string)Gchan+"=rem,rediremote:"+(string)Gchan+"=add");
llListenRemove(GListen);
 GListen = llListen(Gchan, "", llGetOwner(), "");
                    }
                    if(llList2String(tlist,1) == "Norm")
                    {
                    llOwnerSay("@emote=add,sendchat=n,redirchat:"+(string)Gchan+"=rem,rediremote:"+(string)Gchan+"=rem");
                    Gchan = 3;
                    llOwnerSay("@emote=add,sendchat=n,redirchat:"+(string)Gchan+"=rem,rediremote:"+(string)Gchan+"=add");
llListenRemove(GListen);
 GListen = llListen(Gchan, "", llGetOwner(), "");
                    }
                    if(llList2String(tlist,1) == "Light")
                    {
                    if (openMouth)
                    {
                    Gsev = 1;
                    HideShow("Base",1.0);
                    HideShow("reins2",1.0);
                    MuzzleMouth = FALSE;
                    }
                    else
                    {
                    Gsev = 1;
                    HideShow("Base",1.0);
                    HideShow("reins2",1.0);
                    MuzzleMouth = TRUE;
                    }
                    }
                    else if(llList2String(tlist,1) == "Moderate")
                    {
                    if (openMouth)
                    {
                    Gsev = 2;
                    HideShow("Base",1.0);
                    HideShow("reins2",1.0);
                    MuzzleMouth = FALSE;
                    }
                    else
                    {
                    Gsev = 2;
                    HideShow("Base",1.0);
                    HideShow("reins2",1.0);
                    MuzzleMouth = TRUE;
                    }
                    }
                    else if(llList2String(tlist,1) == "Heavy")
                    {
                    if (openMouth)
                    {
                    Gsev = 3;
                    HideShow("Base",1.0);
                    HideShow("reins2",1.0);
                    MuzzleMouth = FALSE;
                    }
                    else
                    {
                    Gsev = 3;
                    HideShow("Base",1.0);
                    HideShow("reins2",1.0);
                    MuzzleMouth = TRUE;
                    }
                    }
                    else if(llList2String(tlist,1) == "Impossible")
                    {
                    if (openMouth)
                    {
                    Gsev = 4;
                    HideShow("Base",1.0);
                    HideShow("reins2",1.0);
                    MuzzleMouth = FALSE;
                    }
                    else
                    {
                    Gsev = 4;
                    HideShow("Base",1.0);
                    HideShow("reins2",1.0);
                    MuzzleMouth = TRUE;
                    }
                    }
                    else if(llList2String(tlist,1) == "Silence")
                    {
                    if (openMouth)
                    {
                    Gsev = 5;
                    HideShow("Base",1.0);
                    HideShow("reins2",1.0);
                    MuzzleMouth = FALSE;
                    }
                    else
                    {
                    Gsev = 5;
                    HideShow("Base",1.0);
                    HideShow("reins2",1.0);
                    
                    MuzzleMouth = TRUE;
                    }
                    }
                    else if(llList2String(tlist,1) == "None")
                    {
                    if (Gagstate == 0 || Gagstate == 2)
                    {
                    Gsev = 0;
                    HideShow("Base",0.0);
                    HideShow("reins2",0.0);
                    MuzzleMouth = FALSE;
                    }
                    else if (Gagstate == 1)
                    {
                    Gsev = 0;
                    HideShow("Base",0.0);
                    HideShow("reins2",0.0);
                    MuzzleMouth = TRUE;
                    }
                    }
                    if(Gsev == 0)
                    {
                        if(Gchan > 0)
                        {
                            if(Flags & 1)
                                llOwnerSay("@sendchat=y,emote=add,redirchat:"+(string)Gchan+"=rem,rediremote:"+(string)Gchan+"=rem");

                            llListenRemove(GListen);
                            Gchan = 0;
                        }    
                    }
                    else if(Gchan == 0)
                    {
                        if(Flags & 1)
                        {
                            lastchanneltime = llGetUnixTime();
                            Gchan = 3;
                            llOwnerSay("@emote=add,sendchat=n,redirchat:"+(string)Gchan+"=add,rediremote:"+(string)Gchan+"=add");
                        }
                        else
                        {
                            Gchan = 3;
                            llOwnerSay("");
                        }
                        
                        llListenRemove(GListen);
                        GListen = llListen(Gchan, "", llGetOwner(), "");   
                    }
                    
                    RLVRefresh();
                }
            }
            else if(channel == -8888)
            {
                if((message == (string)grabtarget +"handle ok" || message == (string)grabtarget+"dari|lhattach"|| message == (string)grabtarget+"dari|rhattach") && llGetOwnerKey(id) == grabtarget && grabtarget != NULL_KEY)
                {
                    Particles("reins",1,id);
                }
                else if(message == (string)poster +"post ok" && poster != NULL_KEY)
                {
                    vector tpos = llList2Vector(llGetObjectDetails(id,[OBJECT_POS]), 0);
                    if(llVecDist(tpos,llGetPos()) <= 20)
                    {
                        Particles("reins",1,id);
                        llSay(Cchan,"Reins Post Target "+ (string)id);
                        grabtarget = NULL_KEY;
                        poster = NULL_KEY;
                        posstarget = NULL_KEY;
                        replytime = 0;
                    }
                }
                
                else if((key)llGetSubString(message,0,35) == posstarget && llGetSubString(message,-2,-1) == "ok" && posstarget != NULL_KEY && llGetOwnerKey(id) == posstarget)
                {
                    integer tnum = llListFindList(cofflelist,[llGetSubString(message,37,-4)]);
                    if(tnum == -1)
                        cofflelist += [llGetSubString(message,37,-4),id];
                        
                }
                if((key)llGetSubString(message,0,35) == llGetOwner() && llGetSubString(message,36,43) == "texture|" && (key)llGetSubString(message,44,-1) != NULL_KEY && llGetOwnerKey(id) == grabtarget && grabtarget != NULL_KEY)
                {
                    texture = llGetSubString(message,44,79);
                    if(Flags & 😎
                        Particles("reins",1,target);
                        
                    llSay(-8888,(string)llGetOwner()+"texture ok");
                }
            }
        }
        else if(channel == Gchan)
        {
            if(Gsev < 6)
            {
                tname = llGetObjectName();
                llSetObjectName(gagname);
                llSleep(0.1);
                llSay(0,mumble(message));
                llSetObjectName(tname);  
            }
        }
        @lbreak;   
    }
    
    touch_start(integer num)
    {
        do
        {
            num--;
            llSay(Cchan,"Touch "+(string)llDetectedKey(num));
        }
        while(num > 0);
    }

    run_time_permissions(integer perms)
    {
        if(perms & (PERMISSION_TRIGGER_ANIMATION))
        {
            Flags = Flags | 16;
            animateMouth();
        }
    }
    
    link_message(integer link, integer num, string mes, key id)
    {
        if (llGetSubString (mes,0,10) == "NewGagName ") gagname = llGetSubString (mes,11,-1);
        llWhisper(0, "New Gagname set for " + llGetDisplayName(llGetOwner()));
    }

    timer()
    {
        if(openMouth) // attempt to keep mouth open.
            animateMouth();
        
        if(Flags & 64)
            jump tbreak;
        
        
        
        if(replytime > 0)
        {
            replytime--;
            
            if(replytime == 0)
            {
                
                if(posstarget != NULL_KEY && cofflelist != [])
                {
                    if(~llListFindList(cofflelist,["bcollar"]))
                        Particles("reins",1,llList2Key(cofflelist,(llListFindList(cofflelist,["bcollar"]) + 1)));
                    else if(~llListFindList(cofflelist,["bbelt"]))
                        Particles("reins",1,llList2Key(cofflelist,(llListFindList(cofflelist,["bbelt"]) + 1)));
                    else if(~llListFindList(cofflelist,["back"]))
                        Particles("reins",1,llList2Key(cofflelist,(llListFindList(cofflelist,["back"]) + 1)));
                    else if(~llListFindList(cofflelist,["fbelt"]))
                        Particles("reins",1,llList2Key(cofflelist,(llListFindList(cofflelist,["fbelt"]) + 1)));
                    else if(~llListFindList(cofflelist,["collar"]))
                        Particles("reins",1,llList2Key(cofflelist,(llListFindList(cofflelist,["collar"]) + 1)));
                    else if(~llListFindList(cofflelist,["pelvis"]))
                        Particles("reins",1,llList2Key(cofflelist,(llListFindList(cofflelist,["pelvis"]) + 1)));
                    else
                    {
                        llSay(Cchan,"Reins Coffle FAIL "+ (string)posstarget);
                        posstarget = NULL_KEY;
                    }
                    
                    if(posstarget != NULL_KEY)
                        llSay(Cchan,"Reins Coffle OK "+ (string)posstarget);
                }
                
                poster = NULL_KEY;
                posstarget = NULL_KEY;   
            }
        }
        
        
        if(Flags & 4 && Flags & 1 && Gsev > 0)
        {
            if(llGetUnixTime() - lastchanneltime > 600 && lastchanneltime > 0)
            {
                lastchanneltime = llGetUnixTime();
                llOwnerSay("@redirchat:"+(string)Gchan+"=rem,rediremote:"+(string)Gchan+"=rem");
                Gchan = 3;
                llOwnerSay("@redirchat:"+(string)Gchan+"=add,rediremote:"+(string)Gchan+"=add");
                llListenRemove(GListen);
                GListen = llListen(Gchan, "", llGetOwner(), "");
            }
        }
        
        
        if(Flags & 32)
        {
            Flags = Flags ^ 32;
            llSay(Cchan,"BitQuery");
        }
        
        @tbreak;
    }
}

 

 

Link to comment
Share on other sites

don't hold me to this because I haven't tested this extensively but I think what happens when we stand, the system stops all animations from playing on our avatar, and then our worn animation scripts kick in and restart the animation(s)

when our script doesn't kick in then the animation doesn't restart

i think that your issue is in the timer event. After you stand the timer will fire within 1 second and restart the OpenMouth animation and doesn't restart the ClosedMouth animation. This condition here:

if(openMouth) // attempt to keep mouth open.
            animateMouth();

in the first instance suggest to try animateMouth() without the IF condition so it works for both Open and Closed and then work it up from there

 

 

  • Like 1
Link to comment
Share on other sites

2 hours ago, Mollymews said:

don't hold me to this because I haven't tested this extensively but I think what happens when we stand, the system stops all animations from playing on our avatar, and then our worn animation scripts kick in and restart the animation(s)

when our script doesn't kick in then the animation doesn't restart

i think that your issue is in the timer event. After you stand the timer will fire within 1 second and restart the OpenMouth animation and doesn't restart the ClosedMouth animation. This condition here:

if(openMouth) // attempt to keep mouth open.
            animateMouth();

in the first instance suggest to try animateMouth() without the IF condition so it works for both Open and Closed and then work it up from there

 

 

Actually... I think you got it backwards, but still found the right hole in the code. The problem is there's no entry for "MuzzleMouth" (the closed mouth state) in that section and there needs to be.

I've added a copy of that bit of code but with "MuzzleMouth" instead of "openMouth". So far my testing seems to show it fixed, but please, if anyone else thinks my problem lies elsewhere do chime in. I'll let you know moving forward if I continue to see it fixed. Thank you greatly for taking the time to look it over.

  • Like 1
Link to comment
Share on other sites

10 hours ago, Surssin said:

I have a nice OLD script that I adapted for a muzzle. I had to have it trigger a looped animation to keep my mouth closed when muzzled. That works well enough, except sometimes when I stand from things, the animation seems to have been stopped. Not overridden, stopped completely. I don't see it listed among the playing animations when I bring up the list.

What you're experiencing is this bug: https://jira.secondlife.com/browse/BUG-225288

It is one of the strangest bugs out there. LL still hasn't bothered fixing it, either. Nothing new there, though.

  • Like 3
Link to comment
Share on other sites

Well, my fix works, but now I got a different bug going with it. It's like both are competing so when I use my JOMO hud to open my mouth (with gag attached, but no gag set), it cycles so my mouth is constantly opening and closing. So that's not gonna do it.

Any additional ideas?

Edited by Surssin
Link to comment
Share on other sites

 

On 1/14/2022 at 2:31 PM, Surssin said:

Well, my fix works, but now I got a different bug going with it. It's like both are competing so when I use my JOMO hud to open my mouth (with gag attached, but no gag set), it cycles so my mouth is constantly opening and closing. So that's not gonna do it.

Any additional ideas?

without seeing the code changes made then we just be guessing at what the newest issue is

but if was to guess then should the timer be firing for all states of muzzled | not muzzled | open | close then not all the states are conditioned as they should be

Link to comment
Share on other sites

On 1/19/2022 at 12:18 PM, Mollymews said:

 

without seeing the code changes made then we just be guessing at what the newest issue is

but if was to guess then should the timer be firing for all states of muzzled | not muzzled | open | close then not all the states are conditioned as they should be

huh, thought I added an updated reply. Sorry.

Before I had added a section that looked like this;

if(openMouth) // attempt to keep mouth open.
            animateMouth();

if(MuzzleMouth) // attempt to keep mouth open.
            animateMouth();

Now it looks like this, and seems to be working properly now;

if(openMouth || MuzzleMouth) // attempt to keep mouth open.
            animateMouth();

Not sure why the second version works but the other had the bug I mentioned. I only know that as far as I can tell it's working now. But I never would have thought of it without the help I got here, so thank you.

Next rabbit hole: smoother walking while leashed. :P

Link to comment
Share on other sites

On 1/23/2022 at 6:55 AM, Surssin said:

huh, thought I added an updated reply. Sorry.

Before I had added a section that looked like this;

if(openMouth) // attempt to keep mouth open.
            animateMouth();

if(MuzzleMouth) // attempt to keep mouth open.
            animateMouth();

Now it looks like this, and seems to be working properly now;

if(openMouth || MuzzleMouth) // attempt to keep mouth open.
            animateMouth();

Not sure why the second version works but the other had the bug I mentioned. I only know that as far as I can tell it's working now.

in the first instance the animateMouth function is being called twice when both openMouth and MuzzleMouth are TRUE. In the second instance the animateMouth is only being run once - when either openMouth or MuzzleMouth are TRUE

  • Thanks 1
Link to comment
Share on other sites

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