Jump to content

Home

Separate Weapon Fire Animations in 1st and 3rd Person


recombinant

Recommended Posts

Anyone know if it's possible to trigger separate weapon animations depending on what view the player is in?

 

If so, where might I find the appropriate place to make the change? I'm really looking for the place where it animates in first person, since that's where I need to make the change - however, I can't seem to locate the place where it handles the animations...

Link to comment
Share on other sites

OK. Here's the problem...

 

I've been working on creating fists with punching action for Dark Forces out of the stun baton, and in third person I'm using the noweap.glm & animate attacks with BOTH_MELEE1 & BOTH_MELEE2 randomly selected (I got that working in February - works great).

 

The problem is that the first person MD3 is stun_baton.md3, and it is triggered by BOTH_ATTACK3.

 

I was just wondering if there was a way to trap (in cgame, since you can tell whether you're in 1st or 3rd person there) for the BOTH_MELEE1 & BOTH_MELEE2 calls when the player's current weapon is the stun baton, and circumvent it to call BOTH_ATTACK3 to trigger the fist's (formerly known as the stun baton) punching animation.

 

It seems to me that this happens with the saber, but I could be wrong.

 

Any suggestions will be greatly appreciated.

 

Thanks!

 

:D

Link to comment
Share on other sites

sugjestion :

 

cg_view.c

 

after

else if (cg.snap->ps.zoomMode)
{ //always force first person when zoomed
	cg.renderingThirdPerson = 0;
}

 

add this

 

else if (cg.predictedPlayerState.weapon == WP_STUN_BATON)
{
	cg.renderingThirdPerson = 1;
}

 

i have fists too (more move than u . nana ;) kiding ya)

this is how i did the switch,

actual credits go to razor ace, i asked him the same question ^.^

 

edit : placed WP_STUN_BATON cause i think u replace the stun right?

 

oups i think i didnt understand, the above it to switch to 3rd person with fists

 

u want another animation if not in 3rd person ?

 

how about

 

assuming your in bg_pmove.c

//now im not sure if this is good ..
extern vmCvar_t	cg_thirdPerson;

if (!cg_thirdPerson.integer)
{
PM_StartTorsoAnim( BOTH_ATTACK3 );
}
else
{
// random ? alt fire? 
if ( ??? ) 
{	
	PM_StartTorsoAnim( BOTH_MELEE2 );
}
else
{
	PM_StartTorsoAnim( BOTH_MELEE1 );
}
}

 

sorry bout the confusion :p

Link to comment
Share on other sites

Is cg_thirdPerson valid in the bg_* files? I didn't think that would be a server side thing as well.

 

And yes, I got third-person fists working great back in February, and looked great. I randomly selected the punch animation so Kyle would to a right-left-right kind of thing. It was all in third person so I had that all covered, but thanks for your comments. I fixed it in a different way, but that's immaterial at this juncture.

 

Our modeler recently created first-person models (md3s) to substitute for the stun baton, and I really wanted to get that going for third and first person, but I may just opt for first person only at this point, just because it looks so much better.

Link to comment
Share on other sites

uh, your modeller isn't doing animations for the third person player model so, no, you can't override the third person player animations to match it.

 

Well, technically you could, but it would require writing an animation override function (that would probably be too slow and too complicated to do).

 

I don't know if cg_thirdPerson is a bg cvar but you could make it be if you want it to be....

Link to comment
Share on other sites

uh, your modeller isn't doing animations for the third person player model so, no, you can't override the third person player animations to match it.

 

I think what I meant to say is that I would like to override the first person animation, as in the following pseudocode:

 

If (player is in thirdpersonview) 
{
   do standard animation // currently BOTH_MELEE2
} 
else
{ 
   // first person view
   trigger BOTH_ATTACK3 animation
}

 

...so is this kind of thing even possible?

 

Also, am I possibly missing something here conceptually? When I specify that the player is going to use noweap.glm, I guess I originally thought that there were animations associated with it, when really is it the player model's .glm (or .gla) that handles the animation?

 

If so, then your cvar idea might be a good one - or how about one of the missing flags in playerState_t?

 

I'm still a little fuzzy on how the communication works between client and server. Better read up on it at Code3arena, perhaps.

 

I don't know if cg_thirdPerson is a bg cvar but you could make it be if you want it to be....

 

hmmm... ok. Perhaps that's a good idea - I'll have to do some research on cvars and see how it might apply to my situation.

 

Additionally, as I re-read Code's um, code, I began to see what he was getting at, but the validity of the cvar is in question. I'll try to see about making it valid on both sides as you suggest, razorace.

 

Thanks Again!

 

:D

Link to comment
Share on other sites

Originally posted by razorace

Why would you possibly need this data server side?

 

It won't make a difference anyway, the third person model is normally invisible while you're in FPS.

 

I don't think it's that I want it server side, but by virtue of my editing bg_pmove.c as Code suggests, wouldn't that require that information to be available/accessible on both sides (client & server)?

 

I'd prefer to keep it client-side, honestly, but again, maybe I'm missing something in the overall picture. If you have an alternate suggestion, I'd love to hear (er, read) it.

 

Unless you already made the suggestion and I totally missed it or misinterpreted it.

 

At any rate, many thanks!!! All this discussion is helping immensely!

 

:D

Link to comment
Share on other sites

uh, if you wanted to do it as part of the pm stuff, yes, it would have to accessable from bg. However, you could just insert this into the client side animation system and have it be all client side. However, I'm still not sure why you want the animation to be different while in FPS....

Link to comment
Share on other sites

Originally posted by wudan

Let me get this straight - you want the client to see his own animation as different when in first person, or do you want everyone to see his animation as different while in first person?

 

Insightful question, I must say!

 

Short answer: his own animation.

 

For the player's 3rd person view and to the rest of the world it should be BOTH_MELEE1 or BOTH_MELEE2.

 

When in first person it needs to be BOTH_ATTACK3 (and this is just for the stun baton).

 

Hope that made sense.

 

Thanks for all your help so far, guys!

 

:D

Link to comment
Share on other sites

  • 3 weeks later...

OK. It looks like I'm going to need some help/suggestions/recommendations on this one.

 

The modeler who's working on the fists (Salv) and I chatted and it looks like it's going to be up to me to get this going, since he evidently can't trigger his weapon animation with a different value (like responding to BOTH_MELEE2 value instead of BOTH_ATTACK3).

 

The weird thing is that the Bryar Pistol fires with BOTH_ATTACK2, so it seems that it should be possible to control the animations on client and server independently.

 

Any ideas?

 

:holosid:

Link to comment
Share on other sites

Yeah, the animations are updated on both client and server side. There's some hacks in the client side code so the actual visual output is different than the way the server side animations are handled. I tried to fix this with ASv2 but it's not possible without some modifications in the server<->client message handling (IE engine code stuff). Rich @ Raven has stated that he will add some open slots to the data streams for JKA but until then we're stuck. This is the primary reason why MotF has been cancelled/delayed til then.

Link to comment
Share on other sites

Yep, possibly never. We'll see when JKA comes out. I might be doing something else then.

 

Unfortunately, MotF was never very popular. Even if I do bring it back it might be under another name/packaging to make it more "accessible" to the masses. Stupid masses. :D

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...