Animation Speed

Avatar
Jimmy
32 Posts
Posted May 23, 2012
Hello,

I searched for this for a while now, but couldn't find anything. I try to slow down the animation of a telescopic arm. I read a few things about SetPlayBackRate but this doesn't seem to do anything for me. I basically want that the arm elevates a cube, but the defaul speed launches the cube to the ceiling...

Can you help me? :smile:

Advertisement
Registered users don’t see ads! Register now!
Avatar
spongylover123
944 Posts
Posted May 23, 2012
Replied 28 minutes later
ontrigger - prop_dynamic - setplaybackrate 0.025
Avatar
Jimmy
32 Posts
Posted May 23, 2012
Replied 37 minutes later
Would you elaborate on that? I tried this and it does not work.
Avatar
Groxkiller585
652 Posts
Posted May 24, 2012
Replied 8 hours later

Jimmy wrote:
Would you elaborate on that? I tried this and it does not work.

You need to first start playing the animation and THEN use SetPlaybackRate.

For example:

Quote:
OnSomeOutput -> arm_model_1 -> SetAnimation -> animation_name -> delay 0
OnSomeOutput -> arm_model_1 -> SetPlaybackRate -> 2 -> delay 0

As for the input itself, the parameter takes a number. One is normal speed, less than one is faster, more than one is slower.

Avatar
ChickenMobile
2,460 Posts
Posted May 24, 2012
Replied 57 minutes later
If you want the arm to constantly be slower, you could always use the 'OnStartAnimation' output from the model to set its' own playback rate.
Avatar
Jimmy
32 Posts
Posted May 24, 2012
Replied 44 minutes later
Thanks to those who helped :wink:

Groxkiller585 wrote:
You need to first start playing the animation and THEN use SetPlaybackRate.

For example:

Quote:

OnSomeOutput -> arm_model_1 -> SetAnimation -> animation_name -> delay 0
OnSomeOutput -> arm_model_1 -> SetPlaybackRate -> 2 -> delay 0

Wouldn't I need a delay for SetPlayBackRate for it to be used after the animation started?

Avatar
ChickenMobile
2,460 Posts
Posted May 24, 2012
Replied 20 minutes later
Try a delay of 0.01
Avatar
Jimmy
32 Posts
Posted May 24, 2012
Replied 20 minutes later

chickenmobile wrote:
Try a delay of 0.01

This works, thank you!

Although the cube I put on top of the panel is still being launched up and doesnt stay still. What can I do about that?

Avatar
FelixGriffin
2,680 Posts
Posted May 24, 2012
Replied 14 minutes later
You could temporarily parent it to the panel.
Avatar
Jimmy
32 Posts
Posted May 24, 2012
Replied 21 minutes later

FelixGriffin wrote:
You could temporarily parent it to the panel.

I tried this but failed. Can you explain please?

Avatar
Groxkiller585
652 Posts
Posted May 24, 2012
Replied 8 minutes later

Jimmy wrote:
Thanks to those who helped :wink:

Groxkiller585 wrote:

You need to first start playing the animation and THEN use SetPlaybackRate.

For example:

Quote:

OnSomeOutput -> arm_model_1 -> SetAnimation -> animation_name -> delay 0
OnSomeOutput -> arm_model_1 -> SetPlaybackRate -> 2 -> delay 0

Wouldn't I need a delay for SetPlayBackRate for it to be used after the animation started?

Yh sorry, was in a bit of a rush. The delay should be about 0.05 seconds after to prevent problems (panels don't like short delays - seems to screw them up. My panel prefabs usually have a delay of attaching the brushes and a bigger one for animating, so everything settles before it's put to work, and even then rotation can still screw it up.)

As for your cube issue, why not use an invisible-textured func_brush "cage" that is set to collide only with the box (via filters) that takes up the entire space around the panel, and you enable it when the panel goes up and when it stops disable it.

If the cube has no unique name for a filter, you can specify it by model instead. (This is how one can distinguish between normal cubes, reflecto-cubes, and spheres, because they all come from one entity, so filtering the class wouldn't work.)

Avatar
Jimmy
32 Posts
Posted May 24, 2012
Replied 11 minutes later

Quote:
Yh sorry, was in a bit of a rush. The delay should be about 0.05 seconds after to prevent problems (panels don't like short delays - seems to screw them up. My panel prefabs usually have a delay of attaching the brushes and a bigger one for animating, so everything settles before it's put to work, and even then rotation can still screw it up.)

As for your cube issue, why not use an invisible-textured func_brush "cage" that is set to collide only with the box (via filters) that takes up the entire space around the panel, and you enable it when the panel goes up and when it stops disable it.

If the cube has no unique name for a filter, you can specify it by model instead. (This is how one can distinguish between normal cubes, reflecto-cubes, and spheres, because they all come from one entity, so filtering the class wouldn't work.)

Thanks. Main problem about the "cage" is that the cube is basically launched straight up, and since I can't put a texture that collides with the cube right on top of it (because then the cube wouldn't move up at all?) this won't work. Unless... parent the invisible texture to the panel..?

Avatar
Groxkiller585
652 Posts
Posted May 24, 2012
Replied 27 minutes later

Jimmy wrote:
Quote:

Yh sorry, was in a bit of a rush. The delay should be about 0.05 seconds after to prevent problems (panels don't like short delays - seems to screw them up. My panel prefabs usually have a delay of attaching the brushes and a bigger one for animating, so everything settles before it's put to work, and even then rotation can still screw it up.)

As for your cube issue, why not use an invisible-textured func_brush "cage" that is set to collide only with the box (via filters) that takes up the entire space around the panel, and you enable it when the panel goes up and when it stops disable it.

If the cube has no unique name for a filter, you can specify it by model instead. (This is how one can distinguish between normal cubes, reflecto-cubes, and spheres, because they all come from one entity, so filtering the class wouldn't work.)

Thanks. Main problem about the "cage" is that the cube is basically launched straight up, and since I can't put a texture that collides with the cube right on top of it (because then the cube wouldn't move up at all?) this won't work. Unless... parent the invisible texture to the panel..?

No I mean build the cage so it's top is where the cube's top will rest.

Like so:
img

Another, probably better option is to merely parent the cage to the panel top (making it as small around the box as possible within a decent gridsize), that way the box isn't shot up then suddenly stops for no visible reason.

Avatar
Jimmy
32 Posts
Posted May 24, 2012
Replied 24 minutes later
That's what I basically did. Problem:
http://www.youtube.com/watch?v=ykTfvZ4Ak2M
Avatar
262LetsPlay
51 Posts
Posted May 24, 2012
Replied 8 minutes later
Use Nodraw Texture for the cage and make it into an "func_clip_vphysics" entity. Make sure you disable/enable it correctly, otherwise it would be impossible to put the cube on the panel.
Avatar
Groxkiller585
652 Posts
Posted May 24, 2012
Replied 8 minutes later

Jimmy wrote:
That's what I basically did. Problem: http://www.youtube.com/watch?v=ykTfvZ4Ak2M

lol it jiggled...

The falling was because you disabled it too quickly. The jiggling is because you gave it too much space (or too little). Try fixing both and see if that helps.

@letsplay: That would work ,but vphysicsclip can't be parented, so if he's using the parenting way he has to use a func_brush. (Also, I use the "CLIP" texture for vphysicsclip, not "NODRAW". I don't think it matters much but it did fix some bugs I had.)

Avatar
Jimmy
32 Posts
Posted May 24, 2012
Replied 14 minutes later

Groxkiller585 wrote:
The falling was because you disabled it too quickly.

Nothing's being disabled at that point...

This is harder than I thought... :/ What's going on now? Video:
http://www.youtube.com/watch?v=P3cehk-ppKM

Avatar
Groxkiller585
652 Posts
Posted May 24, 2012
Replied 48 minutes later

Jimmy wrote:
Groxkiller585 wrote:

The falling was because you disabled it too quickly.

Nothing's being disabled at that point...

This is harder than I thought... :/ What's going on now? Video: http://www.youtube.com/watch?v=P3cehk-ppKM

This isn't you, this is lasers. The box will do that because it "freezes" when it's firing a laser. If you tell it to EnableMotion when it falls it will stop doing that. (ie put a trigger up there, turn it on briefly (WITH A DELAY, preferably 0.10) when the panel goes down, make it tell !activator to EnableMotion, then turn it off again.)

Wait, so your telling me it fell off, but the cage wasn't disabled?

Can you isolate this bit of the map and send it to me so I can have a look?

Also if you think this a bit ridiculous for one small thing to work, welcome to Hammer, where everything is overcomplicated to the extreme! :razz:

Avatar
Jimmy
32 Posts
Posted May 24, 2012
Replied 16 minutes later
Isolated part of the map: https://www.dropbox.com/s/4wyak7y0lx8y9pr/cut.vmf

Keep in mind, I'm a noob.

Quote:
Wait, so your telling me it fell off, but the cage wasn't disabled?

Yes...

Quote:
Also if you think this a bit ridiculous for one small thing to work, welcome to Hammer, where everything is overcomplicated to the extreme! :razz:

Thats just great..^^

Advertisement
Registered users don’t see ads! Register now!
Avatar
Groxkiller585
652 Posts
Posted May 24, 2012
Replied 10 hours later

Jimmy wrote:
Isolated part of the map: https://www.dropbox.com/s/4wyak7y0lx8y9pr/cut.vmf

Keep in mind, I'm a noob.
Quote:

Wait, so your telling me it fell off, but the cage wasn't disabled?

Yes...

Quote:

Also if you think this a bit ridiculous for one small thing to work, welcome to Hammer, where everything is overcomplicated to the extreme! :razz:

Thats just great..^^

I have no idea why, but attempting to load this vmf causes hammer to crash at 5 percent every time. Can you load this snippet?