Jump to content

Help with having an avatar move everytime an animation is looped


texigor
 Share

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

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

Recommended Posts

Scripts have no way to detect when an animation loops. You can create a "sequence" in avsitter that changes animations every x seconds, but there is no guarantee that it will coincide with the end of the animation. That also doesn't automate changing positions, just automates changing animations.

To change seating position, you would have to have a script that monitors the link messages from avsitter when someone sits, and then issue commands to avsitter to move that person from position to position. It could be a little tedious to keep track of who is seated, where they are seated, what is the next position, and to cancel everything if they stand up.

If you want to share what the animation spots are doing, there may be a better way to do it... like a single animation that does all the steps.

Edited by Phate Shepherd
Link to comment
Share on other sites

I tried the sequence, and was able to move the sitter at each pose to a different position, but it asked for every pose to reattach the shovel. I know if I use sittarget, the avatar will sit on a linked prim, I want to move that linked prim from left to right and than back left till the avatar unsits. Here is a link to the object I am making, the animation loops every 58 seconds, so I wanted to move the linked prim that the avatar was sitting on every 58 seconds either X + .5 or X - .5. This would make it look like the avatar was working their way back and forth across the pad of snow  

Firestorm-Releasex64 6.4.12.62831 - texigor (gyazo.com)

Link to comment
Share on other sites

Here is the prim move code that I am trying to see if it will work, but so far it is not working

integer gIntMove = 0;
integer gIntVr;
//key     gKeyToucherID;
float   gFltX;
float   gFltY;
float   gFltZ;
vector  gVecPos;
vector  gEul = <0,0,0>;

default
{
    state_entry()
    {
        gVecPos = llGetPos();
        gFltX = gVecPos.x;
        gFltY = gVecPos.y;
        gFltZ = gVecPos.z;
        gIntMove = 1;
        do
        {
            gVecPos = llGetPos();
            gFltX = gVecPos.x;
            gFltY = gVecPos.y;
            gFltZ = gVecPos.z;
        
            // First move accross pad
            // First Move
            gFltY = gFltY - .5;
            llSetPos (< gFltX,gFltY,gFltZ>);
            sleep(58)
        
            // Second Move
            gFltY = gFltY - .5;
            llSetPos (< gFltX,gFltY,gFltZ>);
            sleep(58)
        
            // Third Move
            gFltX = gFltY - .5;
            llSetPos (< gFltX,gFltY,gFltZ>);
            sleep(58)
        
            // Forth Move
            gFltY = gFltY - .5;
            llSetPos (< gFltX,gFltY,gFltZ>);
            sleep(58)

            // first turn
            gIntVr = gIntVr - 90;
            gEul = <0,0,gIntVr>;
            gEul *= DEG_TO_RAD;
            rotation quat = llEuler2Rot(gEul);
            llSetRot(quat);

            // Move Forward
            gFltX = gFltX - .5;
            llSetPos (< gFltX,gFltY,gFltZ>);

            // second turn
            gIntVr = gIntVr - 90;
            gEul = <0,0,gIntVr>;
            gEul *= DEG_TO_RAD;
            rotation quat = llEuler2Rot(gEul);
            llSetRot(quat);
    
            // Second more accross pad
            // Fifth Move
            gFltY = gFltY + .5;
            llSetPos (< gFltX,gFltY,gFltZ>);
            sleep(58)
        
            // Six Move
            gFltY = gFltY + .5;
            llSetPos (< gFltX,gFltY,gFltZ>);
            sleep(58)
        
            // Seven Move
            gFltX = gFltY + .5;
            llSetPos (< gFltX,gFltY,gFltZ>);
            sleep(58)
        
            // Eight Move
            gFltY = gFltY + .5;
            llSetPos (< gFltX,gFltY,gFltZ>);
            sleep(58)

            // thrid turn
            gIntVr = gIntVr - 90;
            gEul = <0,0,gIntVr>;
            gEul *= DEG_TO_RAD;
            rotation quat = llEuler2Rot(gEul);
            llSetRot(quat);
    
            // Move Forward
            gFltX = gFltX - .5;
            llSetPos (< gFltX,gFltY,gFltZ>);

            // forth turn
            gIntVr = gIntVr - 90;
            gEul = <0,0,gIntVr>;
            gEul *= DEG_TO_RAD;
            rotation quat = llEuler2Rot(gEul);
            llSetRot(quat);

            // Third more accross pad
            // Nineth Move
            gFltY = gFltY - .5;
            llSetPos (< gFltX,gFltY,gFltZ>);
            sleep(58)
        
            // tenth Move
            gFltY = gFltY - .5;
            llSetPos (< gFltX,gFltY,gFltZ>);
            sleep(58)
        
            // eleveth Move
            gFltX = gFltY - .5;
            llSetPos (< gFltX,gFltY,gFltZ>);
            sleep(58)
            
            // twelth Move
            gFltY = gFltY - .5;
            llSetPos (< gFltX,gFltY,gFltZ>);
            sleep(58)

            // seven turn
            gIntVr = gIntVr - 90;
            gEul = <0,0,gIntVr>;
            gEul *= DEG_TO_RAD;
            rotation quat = llEuler2Rot(gEul);
            llSetRot(quat);

            // Move Forward
            gFltX = gFltX - .5;
            llSetPos (< gFltX,gFltY,gFltZ>);

            // eight turn
            gIntVr = gIntVr - 90;
            gEul = <0,0,gIntVr>;
            gEul *= DEG_TO_RAD;
            rotation quat = llEuler2Rot(gEul);
            llSetRot(quat);


            //Forth move accross pad
            // thirteenth Move
            gFltY = gFltY + .5;
            llSetPos (< gFltX,gFltY,gFltZ>);
            sleep(58)
        
            // fourteenth Move
            gFltY = gFltY + .5;
            llSetPos (< gFltX,gFltY,gFltZ>);
            sleep(58)
        
            // fifeenth Move
            gFltX = gFltY + .5;
            llSetPos (< gFltX,gFltY,gFltZ>);
            sleep(58)
        
            // sixteenth Move
            gFltY = gFltY + .5;
            llSetPos (< gFltX,gFltY,gFltZ>);
            sleep(58)

            // fifth turn
            gIntVr = gIntVr - 90;
            gEul = <0,0,gIntVr>;
            gEul *= DEG_TO_RAD;
            rotation quat = llEuler2Rot(gEul);
            llSetRot(quat);

            // Move Forward
            gFltX = gFltX - .5;
            llSetPos (< gFltX,gFltY,gFltZ>);

            // sixth turn
            gIntVr = gIntVr - 90;
            gEul = <0,0,gIntVr>;
            gEul *= DEG_TO_RAD;
            rotation quat = llEuler2Rot(gEul);
            llSetRot(quat);
        
            // retrun to start
            gFltX = gFltX + .2;
            llSetPos (< gFltX,gFltY,gFltZ>);
            sleep(58)
        
        while (gIntMove == 1);
        }
    }
}

Link to comment
Share on other sites

2 hours ago, texigor said:

I tried the sequence, and was able to move the sitter at each pose to a different position, but it asked for every pose to reattach the shovel. I know if I use sittarget, the avatar will sit on a linked prim, I want to move that linked prim from left to right and than back left till the avatar unsits. Here is a link to the object I am making, the animation loops every 58 seconds, so I wanted to move the linked prim that the avatar was sitting on every 58 seconds either X + .5 or X - .5. This would make it look like the avatar was working their way back and forth across the pad of snow  

Firestorm-Releasex64 6.4.12.62831 - texigor (gyazo.com)

Are you still using Avsitter? There is a way to have a prop persist over various animations:

https://avsitter.com/qa/1261/can-i-use-a-single-prop-in-more-than-one-pose-or-animation.html

Link to comment
Share on other sites

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