Jump to content

ainst Composer
 Share

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

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

Recommended Posts

Hello! I'm trying to create a script that allows you to simulate tossing the ball in your avatar's hand. the ball must be attached on the avatar, the hand holding the ball is animated, and a tossing animation is triggered through the timer, the ball moves up and down. Are there any suggestions how to do this?

Link to comment
Share on other sites

Just now, Lucia Nightfire said:

Create an animation that moves the L or R hand attach point to and from its origin in an animation editor such as Avastar.

Yes, you can move attach points by animation, like you can move bones with bone translation.

Unfortunately I can't be any more specific than that.

You can not move attatched points by animation.

Link to comment
Share on other sites

1 minute ago, Lucia Nightfire said:

Here is a pic of Avastar where you can edit attach points.

I have used this to make animations that move attach point

I can send you one that makes eye attach points move in and out of the skull to create an extreme eye popping look.

An animation is client side, not server side. You can not detach and re- attatch a running animation, it is already running on the clients interface.

Link to comment
Share on other sites

I've stated all I can. You choose to believe what you want.

I'll send you the animation that moves eye attach points and you can "see" for yourself.

You will see that if you wear rigged eyes that they will not be affected, only unrigged prims attached to the eye attach points because that's whats being animated.

Anyway, done arguing.

 

Link to comment
Share on other sites

1 minute ago, Lucia Nightfire said:

I've stated all I can. You choose to believe what you want.

I'll send you the animation that moves eye attach points and you can "see" for yourself.

You will see that if you wear rigged eyes that they will not be affected, only unrigged prims attached to the eye attach points because that's whats being animated.

Anyway, done arguing.

 

No argument, you are just not correctly informed. You detatch an object with an animation running and no detach script test it will simply run from its original attatched point.

Link to comment
Share on other sites

The confusion seems to be between, on the one hand, animating the attachment point independently of the hunk of avatar where it normally resides, and on the other hand, actually migrating the point to which an object is attached. As I understand the proposal, a "right hand" attachment for example would remain attached to the right hand, but it would appear to now be offset from where that attachment point had been moved relative to the avatar skeleton.

When I first read the OP's question, I had a completely different understanding of what was wanted (tossing the ball to some other target), but now focusing on "the ball moves up and down" I think this is probably right. But I think one could also do pretty well with an object animation that's triggered on the same timer as the (pre-existing?) toss animation... something like a child "ball" prim moving in some arc relative to the attached root prim as the hand is running one "toss" cycle. Coming up with a compelling arc might be easier or harder depending on the complexity of the attachment point's motion in that toss animation.

 

Link to comment
Share on other sites

1 hour ago, steph Arnott said:

No argument, you are just not correctly informed. You detatch an object with an animation running and no detach script test it will simply run from its original attatched point.

Why do you always try to lecture people, when you are the only newbie in the discussion?

  • Like 1
Link to comment
Share on other sites

Hello! Thank you all for answers! but its more a script question. Lets pretend I already have an animation, I just need to script the the ball.

So far i managed to find this piece of script. i think its close to what i needed, but what is missing?..

 while (vecpos <= 10) 
        {
            if (vecpos < 10)
            {
                llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_POS_LOCAL, llGetLocalPos() + <0,0,0.05>]);
                vecpos++;
                llSleep (0.1);
            }
            else 
            {
                while (vecpos != 0)
                {
                    llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_POS_LOCAL, llGetLocalPos() + <0,0,-0.05>]);
                    vecpos--;
                    llSleep (0.1);
                }
            }

 

Link to comment
Share on other sites

22 minutes ago, ainst Composer said:

Hello! Thank you all for answers! but its more a script question. Lets pretend I already have an animation, I just need to script the the ball.

So far i managed to find this piece of script. i think its close to what i needed, but what is missing?..


 while (vecpos <= 10) 
        {
            if (vecpos < 10)
            {
                llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_POS_LOCAL, llGetLocalPos() + <0,0,0.05>]);
                vecpos++;
                llSleep (0.1);
            }
            else 
            {
                while (vecpos != 0)
                {
                    llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_POS_LOCAL, llGetLocalPos() + <0,0,-0.05>]);
                    vecpos--;
                    llSleep (0.1);
                }
            }

 

It looks about right, what is the issue?

Link to comment
Share on other sites

1 minute ago, Kyrah Abattoir said:

It looks about right, what is the issue?

Its only a piece of script and i dont know what and where to add this. I tried but it says: Error name not defined... help please!

default
{
    state_entry()
    {



 while (vecpos <= 10) 
        {
            if (vecpos < 10)
            {
                llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_POS_LOCAL, llGetLocalPos() + <0,0,0.05>]);
                vecpos++;
                llSleep (0.1);
            }
            else 
            {
                while (vecpos != 0)
                {
                    llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_POS_LOCAL, llGetLocalPos() + <0,0,-0.05>]);
                    vecpos--;
                    llSleep (0.1);
                }
            }
            }
            





    }


}

 

Link to comment
Share on other sites

2 hours ago, Lucia Nightfire said:

Another FYI, you used to be able to move HUD attach points by animation too, but those input parameters I think were removed when we got bento.

There is one animation in a particularly old "Combat HUD" that still can do it though.

Which combat hud, I would be curious to see that.

Link to comment
Share on other sites

20 minutes ago, ainst Composer said:

Error name not defined...

That means you're referencing a variable which hasn't been defined. In your specific case with the script you posted, it looks like "vecpos" would give you that error. Adding the line "integer vecpos = 0;" to your script either as a global variable (before the "default" state) or as a local variable for the state_entry event (just after the "state_entry() { " line) should at least get the script to compile. But the script might need more work beyond that.

As another aside, I looked up the documentation for Avistar and found this page (scroll down to "Attachment Points" section) which confirms what Lucia said: it does in fact appear to be possible to animate attachment points, because they are basically bones. However! It's not something officially supported by SL so there are a lot of limitations and caveats to it. Still, that's very cool! I'd love to see some examples of it in action.

Edited by Fenix Eldritch
  • Thanks 3
Link to comment
Share on other sites

7 minutes ago, Fenix Eldritch said:

That means you're referencing a variable which hasn't been defined. In your specific case with the script you posted, it looks like "vecpos" would give you that error. Adding the line "integer vecpos = 0;" to your script either as a global variable (before the "default" state) or as a local variable for the state_entry event (just after the "state_entry() { " line) should at least get the script to compile. But the script might need more work beyond that.

As another aside, I looked up the documentation for Avistar and found this page (scroll down to "Attachment Points" section) which confirms what Lucia said: it does in fact appear to be possible to animate attachment points, because that are basically bones. However! It's not something officially supported by SL so there are a lot of limitations and caveats to it. Still, that's very cool! I'd love to see some examples of it in action.

Hello! Thanks very much please help to add animation triggered on timer about each 10 seconds! Heres what i got so far:

integer vecpos = 0;

default
{
    state_entry()
    {



 while (vecpos <= 10) 
        {
            if (vecpos < 10)
            {
                llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_POS_LOCAL, llGetLocalPos() + <0,0,0.05>]);
                vecpos++;
                llSleep (0.1);
            }
            else 
            {
                while (vecpos != 0)
                {
                    llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_POS_LOCAL, llGetLocalPos() + <0,0,-0.05>]);
                    vecpos--;
                    llSleep (0.1);
                }
            }
            }
            





    }


}

 

Link to comment
Share on other sites

Adding animation support to the script would be similar to your previous outhouse project: You need to request permission to animate  and then start the animation once you have said permission in a run_time_permissions event. In your case, you would want to make the request when the object is attached, instead of sat on. I quickly googled an example script and found this from Ordinal Malaprop. See if you can take what you learned from the outhouse and adapt it and the above example script into your current project. If you have trouble, just ask and we'll try to assist.

Once you get the initial animation going, the next step is to incorporate the timer for repeated calls. Basically speaking, you'd start a 10 second timer right after you start the first animation. And then start the animation again in the timer event.

What is the nature of the animation? Is it just a simple flick of the hand? Is the animation itself looped? How long does the animation last on its own?

Edited by Fenix Eldritch
  • Thanks 1
Link to comment
Share on other sites

21 minutes ago, Fenix Eldritch said:

Adding animation support to the script would be similar to your previous outhouse project: You need to request permission to animate  and then start the animation once you have said permission in a run_time_permissions event. In your case, you would want to make the request when the object is attached, instead of sat on. I quickly googled an example script and found this from Ordinal Malaprop. See if you can take what you learned from the outhouse and adapt it and the above example script into your current project. If you have trouble, just ask and we'll try to assist.

Once you get the initial animation going, the next step is to incorporate the timer for repeated calls. Basically speaking, you'd start a 10 second timer right after you start the first animation. And then start the animation again in the timer event.

What is the nature of the animation? Is it just a simple flick of the hand? Is the animation itself looped? How long does the animation last on its own?

Yes this animation of throwing the ball lasts about a second. during this time the ball must have time to take off and fall back into the hand.

And I also incorrectly wrote sorry. there will be only one animation. tossing the ball.

All the actions (animation and ball movement) will be inside the timer event?

Edited by ainst Composer
Link to comment
Share on other sites

And does it repeat on its own, or does the animation terminate after a single play? This is important because if the animation is looped, you'll need additional logic to manually stop it from repeating on its own instead of once every 10 seconds with the timer. (Assuming I've understood your intent)

Edited by Fenix Eldritch
  • Thanks 1
Link to comment
Share on other sites

2 minutes ago, Fenix Eldritch said:

And does it repeat on its own, or does the animation terminate after a single play? This is important because if the animation is looped, you'll need additional logic to manually stop it from repeating on its own instead of once every 10 seconds with the timer. (Assuming I've understood your intent)

Yes its a single play animation. Not looped

Edited by ainst Composer
Link to comment
Share on other sites

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