Jump to content

Animation glitch when using lightning w/o saber


Guest Redemption
Go to solution Solved by Guest Redemption,

Recommended Posts

Guest Redemption

Hi, I would like to fix this since its a bit strange. Using lightning with a saber active or not, works just fine but without is a different story. The animation looks like it has a bad case of hiccups. 

 

Can anyone here help me get started with this fix? I think to begin with, would be here:

 

wp_saber.cpp - void ForceLightning( gentity_t *self )

if ( self->client->ps.forcePowerLevel[FP_LIGHTNING] < FORCE_LEVEL_2 )
	{
		NPC_SetAnim( self, SETANIM_TORSO, BOTH_FORCELIGHTNING, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD );
	}
	else
	{
		NPC_SetAnim( self, SETANIM_TORSO, BOTH_FORCELIGHTNING_START, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD );
	}
	self->client->ps.saberMove = self->client->ps.saberBounceMove = LS_READY;//don't finish whatever saber anim you may have been in
	self->client->ps.saberBlocked = BLOCKED_NONE;

Maybe adding something like this may do it...

self->client->ps.weaponTime = Q_irand( 100, 300 );

What d'you think? @@eezstreet @@redsaurus

Link to comment
Guest Redemption

I've found out that you can still fire a weapon whilst using lightning, might this be the issue? Also, look at this...

void ForceLightning( gentity_t *self )
{
	if ( self->health <= 0 )
	{
		return;
	}
	if ( !self->s.number && (cg.zoomMode || in_camera) )
	{//can't force lightning when zoomed in or in cinematic
		return;
	}

The part with cg.zoomMode, I was firing lightning then, with the disruptor in my right hand, zooming in with alt-fire and shooting... Shouldn't return cancel the lightning?

Anyways, if we could stop the functioning of the right hand weapon, maybe we can fix this issue.

 

ps. Its a bug thats been shipped with the game; perhaps overlooked.

 

Edit: Fixed this issue to ;)

void ForceLightning( gentity_t *self )
{
	if ( self->health <= 0 )
	{
		return;
	}
	if ( self->client && (cg.zoomMode || in_camera) )
	{//can't force lightning when zoomed in or in cinematic
		return;
	}

Thought I'd share this with you @@Asgarath83 @@Noodle

Edited by Redemption
Link to comment
Guest Redemption

Are you kidding me... I've just thoroughly pointed it out pal. If its not a bug, then I'll redefine it as a f#%k up that's been overlooked by mostly everybody, it seems :(

 

Equip a blaster, then fire lightning or grip, you'll see what I mean.

Link to comment
  • 7 months later...
Guest Redemption

Giving it a bump since its really the only bugged thing left that I want to fix atm :\

 

https://www.youtube.com/watch?v=vNLtCxEa5cU

 

I'm thinking that its got something to do with this bit of code here:

self->client->ps.saberMove = self->client->ps.saberBounceMove = LS_READY;//don't finish whatever saber anim you may have been in

If I could add something for the other weapons, maybe this will fix it. Gonna go check grip...

 

Edit: I fixed it. "Move along...Move along."

 

It was a case of adding this to each weapon in bg_panimate:

case WP_BRYAR_PISTOL:
					if (pm->ps->forcePowersActive&(1 << FP_GRIP) && pm->ps->forcePowerLevel[FP_GRIP] > FORCE_LEVEL_1)
					{//holding an enemy aloft with force-grip
						//PM_SetAnim( pm, SETANIM_TORSO, BOTH_FORCEGRIP_HOLD, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD );
						return;
					}
					if (pm->ps->forcePowersActive&(1 << FP_LIGHTNING) && pm->ps->forcePowerLevel[FP_LIGHTNING] > FORCE_LEVEL_1)
					{//holding an enemy aloft with force-grip
						//PM_SetAnim( pm, SETANIM_TORSO, BOTH_FORCELIGHTNING_HOLD, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD );
						return;
					}

So... Do I get a medal for this or something?... Or "meh"...

 

Thought I'd share this with you @@Asgarath83 @@Noodle Since you'se are decent :)

Noodle and Asgarath83 like this
Link to comment

Giving it a bump since its really the only bugged thing left that I want to fix atm :\

 

https://www.youtube.com/watch?v=vNLtCxEa5cU

 

I'm thinking that its got something to do with this bit of code here:

self->client->ps.saberMove = self->client->ps.saberBounceMove = LS_READY;//don't finish whatever saber anim you may have been in

If I could add something for the other weapons, maybe this will fix it. Gonna go check grip...

 

Edit: I fixed it. "Move along...Move along."

 

It was a case of adding this to each weapon in bg_panimate:

case WP_BRYAR_PISTOL:
					if (pm->ps->forcePowersActive&(1 << FP_GRIP) && pm->ps->forcePowerLevel[FP_GRIP] > FORCE_LEVEL_1)
					{//holding an enemy aloft with force-grip
						//PM_SetAnim( pm, SETANIM_TORSO, BOTH_FORCEGRIP_HOLD, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD );
						return;
					}
					if (pm->ps->forcePowersActive&(1 << FP_LIGHTNING) && pm->ps->forcePowerLevel[FP_LIGHTNING] > FORCE_LEVEL_1)
					{//holding an enemy aloft with force-grip
						//PM_SetAnim( pm, SETANIM_TORSO, BOTH_FORCELIGHTNING_HOLD, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD );
						return;
					}

So... Do I get a medal for this or something?... Or "meh"...

 

Thought I'd share this with you @@Asgarath83 @@Noodle Since you'se are decent :)

 

I had never even heard of this bug! Good to see that you fixed it and shared the answer, I don't know much about coding but that line sure can be useful!

Link to comment
  • 1 month later...
  • 5 weeks later...
  • Solution
Guest Redemption

Hello, it seems I was mistaken and that @@eezstreet had already solved this issue a while back in his https://jkhub.org/files/file/2877-jedi-knight-ii-enhanced/ mod, but I'd thought I would share this piece of code with the community for it is the definitive solution to this topics animation issue and not the way that I had it.

 

In bg_panimate at line #3127, paste this code on that line, there.. that should do the trick.

else {
 
     if (pm->ps->forcePowersActive&(1 << FP_GRIP) && pm->ps->forcePowerLevel[FP_GRIP] > FORCE_LEVEL_1)
     {//holding an enemy aloft with force-grip
          //PM_SetAnim( pm, SETANIM_TORSO, BOTH_FORCEGRIP_HOLD, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD );
          return;
     }
     if (pm->ps->forcePowersActive&(1 << FP_LIGHTNING) && pm->ps->forcePowerLevel[FP_LIGHTNING] > FORCE_LEVEL_1)
     {//holding an enemy aloft with force-grip
          //PM_SetAnim( pm, SETANIM_TORSO, BOTH_FORCELIGHTNING_HOLD, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD );
          return;
     }
}
Noodle likes this
Link to comment

 

Hello, it seems I was mistaken and that @@eezstreet had already solved this issue a while back in his https://jkhub.org/files/file/2877-jedi-knight-ii-enhanced/ mod, but I'd thought I would share this piece of code with the community for it is the definitive solution to this topics animation issue and not the way that I had it.

 

In bg_panimate at line #3127, paste this code on that line, there.. that should do the trick.

else {
 
     if (pm->ps->forcePowersActive&(1 << FP_GRIP) && pm->ps->forcePowerLevel[FP_GRIP] > FORCE_LEVEL_1)
     {//holding an enemy aloft with force-grip
          //PM_SetAnim( pm, SETANIM_TORSO, BOTH_FORCEGRIP_HOLD, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD );
          return;
     }
     if (pm->ps->forcePowersActive&(1 << FP_LIGHTNING) && pm->ps->forcePowerLevel[FP_LIGHTNING] > FORCE_LEVEL_1)
     {//holding an enemy aloft with force-grip
          //PM_SetAnim( pm, SETANIM_TORSO, BOTH_FORCELIGHTNING_HOLD, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD );
          return;
     }
}

Would this fix also work with JKA?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...