Jump to content

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
3 minutes ago, steph Arnott said:

You can not move attatched points by animation.

It sounds insane to those who've never seen it done or do not know how to use Avastar to do it, but trust me, it can be done.

Share this post


Link to post
Share on other sites
2 minutes ago, Lucia Nightfire said:

It sounds insane to those who've never seen it done or do not know how to use Avastar to do it, but trust me, it can be done.

It is impossible. It can not be done, EVER.

Edited by steph Arnott

Share this post


Link to post
Share on other sites

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

I have used this to make animations that move attach points.

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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.

Share this post


Link to post
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.

 

Share this post


Link to post
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.

Share this post


Link to post
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.

 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Just now, Kyrah Abattoir said:

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

'newbie'? Was here years ago pal. Just because others take a break does not mean they was not here before you.

Share this post


Link to post
Share on other sites
Just now, steph Arnott said:

'newbie'? Was here years ago pal. Just because others take a break does not mean they was not here before you.

I wasn't refering to the age of your avatar. And i'm also not your pal.

Share this post


Link to post
Share on other sites
Just now, Kyrah Abattoir said:

I wasn't refering to the age of your avatar. And i'm also not your pal.

05/2010. Not exactly new is it? And no you are not.

Share this post


Link to post
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);
                }
            }

 

Share this post


Link to post
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?

Share this post


Link to post
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);
                }
            }
            }
            





    }


}

 

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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);
                }
            }
            }
            





    }


}

 

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...