Jump to content

Animation glitch when using lightning w/o saber


Guest Redemption
Go to solution Solved by Guest Redemption,

Recommended Posts

Guest Redemption
Posted

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

Guest Redemption
Posted (edited)

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
Guest Redemption
Posted

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.

  • 7 months later...
Guest Redemption
Posted

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

Asgarath83 and Noodle like this
Posted

Yes you win a medal. i know the animation override function because i used many times on my custom force power. your work is interessing. i think a day i will remove this tedious glitch also by my custom code.  thanks for your work and your idea! :D

Posted

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!

Guest Redemption
Posted

I cant remember if they fixed it in Academy, But I think they havn't.

Guest Redemption
Posted

Nicely done @ ! I allways found that annoying.

 

This should probably be merged into the OpenJK public branch on Git

Thank you :) If that's the case, by all means.

Asgarath83 likes this
  • 1 month later...
  • 5 weeks later...
  • Solution
Guest Redemption
Posted

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
Posted

 

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?

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