View Full Version : Something's wrong with BOTH_STAND2TO1...
03-24-2003, 09:26 PM
I've had this problem for quite some time, but i'm determined to get it fixed now. As it is in single player, i wanted to do the fancy lightsaber arming/disarming animations. It half works the way i have it setup... the arming animation works perfectly, but then the disarming animation, BOTH_STAND2TO1, does nothing.. it just twitches the torso a bit.
Here's how it's set up, in g_cmds.c for Cmd_ToggleSaber_f:
if (ent->client && ent->client->ps.weaponTime < 1)
ent->client->ps.saberHolstered = qfalse;
//UPDATED: We want to do the fancy lightsaber arming animation -Scarlett
if (ent->client->ps.forceHandExtend == HANDEXTEND_NONE)
PM_SetAnim(SETANIM_TORSO, BOTH_STAND1TO2, SETANIM_FLAG_NORMAL|SETANIM_FLAG_HOLD|SETANIM_FLAG _HOLDLESS, 0);
G_Sound(ent, CHAN_AUTO, saberOnSound);
ent->client->ps.saberHolstered = qtrue;
//UPDATED: We want to do the fancy lightsaber disarming animation -Scarlett
//NOTE: Sadly, this animation isn't working right now...
if (ent->client->ps.forceHandExtend == HANDEXTEND_NONE)
PM_SetAnim(SETANIM_TORSO, BOTH_STAND2TO1, SETANIM_FLAG_NORMAL|SETANIM_FLAG_HOLD|SETANIM_FLAG _HOLDLESS, 0);
G_Sound(ent, CHAN_AUTO, saberOffSound);
//prevent anything from being done for 400ms after holster
ent->client->ps.weaponTime = 400;
There must be something wrong with the animation itself, because if you replace BOTH_STAND2TO1 with another animation it plays it fine...
03-24-2003, 10:33 PM
Hmm... i just noticed something, in ModView the animation is displayed as "-BOTH_STAND2TO1".... i've also noticed that all the animations i've had problems like this with have the "-" before them in ModView as well. What significance does that have? Why is it there? Are they meant to be used in a certain way or what?
From what it appears, all the animations that are like that are basicly reversed versions of another and used for the "ending" animation....
03-24-2003, 11:07 PM
Interesting. Those animations are playing in reverse. I'm looking into this. The MP animation calls might not be set up to handle backward playing animations. If this is the case, I can probably rewrite it to make it do it anyway. :) Watch the JK2 animation thread (http://188.8.131.52/showthread.php?s=&threadid=76081) for the details of my research.
03-25-2003, 12:07 AM
Alright, i will. :)
03-25-2003, 10:44 AM
Ok Ok ... so I don't know wtf I'm talking about :)
03-25-2003, 01:37 PM
Unfortunatly, that change didn't fix anything, wudan. It also plays fine in ModView.
// Format: enum, targetFrame, frameCount, loopFrame, frameSpeed
BOTH_STAND2TO1 12409 16 -1 -15
The frameSpeed is -15.... where as BOTH_STAND1TO2 is 20, which is the only difference between them. Hmm.. i'll try setting it's frame speed to 20 as well then....
Alright, now that i've done that, it's playing BOTH_STAND1TO2 instead... either that or it's playing it backwards, which I think is far more likely to be the case.
BOTH_STAND1TO2 and BOTH_STAND2TO1 must be the same animation, there's just two copies of it (which is what the "-" is for, to indicate it's playing in reverse) so they can specify each for different instances. So that's how to play animations backwards, set the frameSpeed to a negative value. However, it doesn't seem the multiplayer version has support for it...
03-25-2003, 02:39 PM
Apparently, we don't :_(
Looks like a job for the GLA Tool I've been working on ... I've been considering that feature, so it's on the list to be added.
Wtf am I talking about? Why, specify a sequence and rip it, write the new sequence in reverse :)
You could just straight-merge it back in to the GLA, adding X more frames, but I'd also like the ability to remove frames that aren't used in MP.
03-25-2003, 02:47 PM
Scarlette is correct. The some of the animations are just reverse playing versions of other animations. The target frame is the same and the framerate is negative. You can see the frame tick backwards in modview too.
03-25-2003, 02:50 PM
Or you could take my approcact and try to hack the system to run animations in reverse. Assuming it's not engine side and it's possible in SP, it should be possible in MP.
03-25-2003, 02:52 PM
That'd be so nice to have something like that, wudan...
But i think it'd be good to get support for reverse animations in multiplayer as well (assuming it doesn't already and we just don't know about it).
03-25-2003, 03:05 PM
Well, if we can play animations in reverse we'd have the ability to "remix" the current animations without having to mess with the humaniod.gla (and force all our users to download the 7 meg + file over again)
03-25-2003, 03:24 PM
There's a mention of it in the BG_ParseAnimationFile (not sure if that's the exact name), but if you wanted to edit the animation in reverse to have it different than the animation forward, the GLA tool is the way to go.
Of course, right now I'm just fleshing out an animation manipulation toolset ...
03-25-2003, 03:47 PM
Well, many animations will look fine without making changes (like BOTH_STAND2TO1).
03-25-2003, 07:20 PM
ok dokie. Unless Raven changed the animation call internals inside the engine (between SP and MP), reverse playing animations SHOULD work. Everything checks out up to the animation syscalls.
03-26-2003, 12:53 AM
Hmmm....Not good. I tried to run several backward running animations and they all don't seem to work. I've emailed Rich about it but my hope is fadeing.
The code seems to be ok, it's just the syscall that's messing things up. I guessing that this is some weird bandwidth saver by not allowing reversed animations. (which doesn't make sense cause only the animation name and timers are passed to the clients and not the framerate.
Unfortunately, this means that we're restricted to forward moving animations since the fix to this would probably require some engine code changes. Doh!
03-26-2003, 10:04 AM
Hehehe ... an optimized MP GLA (that is, SP specific animations removed) would be much smaller than the SP GLA, anyway.
03-26-2003, 03:21 PM
Shazbot! Rich wrote back and says that that SP ghoul2 system is different than the MP system. He said my backup plan idea doesn't work but the current system might work (but doesn't). It looks like backward playing animations aren't possible in MP, but I'll still play with it a little more before I give up on it. :)
03-26-2003, 05:16 PM
Oh well, guess good old fashioned GLA manipulation is still a good idea! :)
03-26-2003, 07:39 PM
Well, Rich suggested another idea I had originally where you play the backward animations one frame at a time. I'll try it but I'm not sure it'll work correctly cause you'd have to run the animation one frame forward as part of the call while actually playing it backwards. IE, it might look jerky.
03-30-2003, 11:14 PM
This is interesting. The animations are in fact playing like they should on the server but not on the client side. I'm still checking the code but I suspect it's due to the client setboneanim syscall being different than the server setboneanim. Unfortunately this means that I'll have to use a hack to run animations backwards (at least on the client side. )
vBulletin®, Copyright ©2000-2015, Jelsoft Enterprises Ltd.