LucasForums

LucasForums (http://www.lucasforums.com/index.php)
-   JA Coding (http://www.lucasforums.com/forumdisplay.php?f=539)
-   -   Freezing an animation (http://www.lucasforums.com/showthread.php?t=178313)

XycaleTh 05-10-2007 11:39 AM

Freezing an animation
 
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 :)

ensiform 05-10-2007 04:27 PM

I'm sure there is, but I don't think you can achieve it with a server-side mod.

razorace 05-10-2007 05:47 PM

Yeah, it's possible, but not without modifications to the bg_pmove code.

XycaleTh 05-11-2007 12:05 PM

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.

ensiform 05-11-2007 02:10 PM

Well, I herd that setting the timers might freeze the animation. You will need to do some searching in the animation code for comments, etc.

XycaleTh 05-11-2007 02:20 PM

okay

razorace 05-11-2007 02:22 PM

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.

XycaleTh 05-11-2007 03:04 PM

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...?

ensiform 05-11-2007 03:07 PM

I don't think it ever *IS* used.

razorace 05-11-2007 03:28 PM

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.

Tinny 05-13-2007 11:53 PM

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.


All times are GMT -4. The time now is 06:22 AM.

Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
LFNetwork, LLC ©2002-2011 - All rights reserved.