Jump to content

Home

Something's wrong with BOTH_STAND2TO1...


Scarlett

Recommended Posts

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)
{
	if (ent->client->ps.saberHolstered)
	{
		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);
	}
	else
	{
		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...

 

Any ideas?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Unfortunatly, that change didn't fix anything, wudan. It also plays fine in ModView.

 

From animation.cfg:

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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. :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...