Jump to content

Home

Freezing an animation


XycaleTh

Recommended Posts

Posted

I'm in the middle of making a competition mod and at the moment through rcon you can 'pause' the match, which extends the timelimit with the correct amount of time, and pauses all players and prevents them from turning etc. It's not a great deal of a problem, but while the match is paused some animations (such as running animations) continue to run but the player remains stationary. I was wondering if it was possible to freeze the animation to stop it from doing this. I'm currently freezing the players by setting the player's ps->pm_type to PM_FREEZE.

 

This isn't a major problem, but it would be a neat little extra and thanks for any help in advance :)

Posted

Oh, I forgot to mention it's a full-game mod, so client, ui and server are being modified. I've tried stopping the ps->legsTimer/ps->torsoTimer (at least I think it stopped), but it made no difference.

Posted

ACtually, altering the animation timer won't work for any animation that loops (walking, running, etc).

 

What you're really going to want to do is slam the animation's speed to near zero (you probably can't have exactly zero) based on a gamestate check (look to see how Force Rage alters the animation speeds) and then jack up the animation timers so that the animation still freeze that way.

Posted

I've spent about 30 mins trying to figure out a few things to do with the animation code but I'm kind of confused. I've always thought as the animation timers (legsTimer, torsoTimer) to be something like a countdown timer where it gets set to however long the chosen animation takes to finish. Then I've seen in some places where it gets set to 1, even though the animation stays for quite a long time.

 

Another thing is I'm wondering why the ANIM_TOGGLEBIT is used? Is it to restrict the number of animations that can be held in the game, or...?

Posted

The animation timers are only used to determine when an animation is "finished", it doesn't determine how quickly the animation plays. In fact, actual animation system in the engine doesn't care what the animation timers since it's exclusively used to determine when the next animation should play.

 

Some animation timers are set to 1 because they are "constant" animations like running or walking. These just constantly loop the same animation while the timer is maintained at 1 to keep it going.

 

As for the toggle bit, I'm not sure if we're talking about the same thing, but the animation system uses a toggle bit to allow the system to be able to restart an animation already playing.

Posted

The way I did it was the way the client did it when it froze an animation when someone was disrupted. This is a last resort idea, if you can't get them to work I can provide more info.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...